This is the first part of what causes you to be kicked out of shops when fighting or even bullying other peds.
main = function()
if shared.playerAggressedInStore then
shared.playerAggressedInStore = nil
end
AreaDisableCameraControlForTransition(true)
F_RequestWeapons()
DATLoad("Store.DAT", 0)
flagState = PedGetFlag(gPlayer, 108)
PedSetFlag(gPlayer, 108, true)
Another part of the code
elseif not gSkipAggression and IsButtonPressed(9, 0) and PlayerIsInAreaXYZ(l_0_17, l_0_18, l_0_19, 1, 0) then
F_MakePlayerSafeForNIS(true)
gSkipAggression = true
elseif gSkipAggression then
if not PlayerIsInAreaXYZ(l_0_17, l_0_18, l_0_19, 1, 0) then
F_MakePlayerSafeForNIS(false)
end
gSkipAggression = false
end
end
if not gSkipAggression then
F_Aggression(l_0_5)
end
This part deals with punishments for being aggressive in a store say against a little kid...girl or adult
if l_1_1 == 30 then
if not gPunishmentOff and (PlayerIsInTrigger(TRIGGER._NERDSMALLROOM) or PlayerIsInTrigger(TRIGGER._NERDMAINROOM) or PlayerIsInTrigger(TRIGGER._NERDCOMPUTERROOM)) then
DisablePunishmentSystem(true)
gPunishmentOff = true
elseif gPunishmentOff and PlayerIsInTrigger(TRIGGER._COMICSHOP) then
DisablePunishmentSystem(false)
gPunishmentOff = false
end
Another part of this
DisablePunishmentSystem(false)
F_MakePlayerSafeForNIS(false, true)
AreaClearDockers()
AreaClearSpawners()
AreaSetPopulationSexGeneration(true, true)
ShopEnd()
shared.minigameRunning = nil
shared.finishedLoadingShop = nil
shared.unlockedClothing = nil
PedStop(gPlayer)
if gPlayerBrokeStuff then
PlayerSetControl(1)
end
DisablePunishmentSystem(true) disables the punishment system totally.
Here are some items in the comic shop
ShopAddItem(0, 394, 394._STORE_DT_COMIC_ITEM1, MODELENUM._BIKERMAG, 474, 517, 5)
ShopAddItem(0, 309, POINTLIST._STORE_DT_COMIC_ITEM3, 100, 400, CbComicRich, 5)
ShopAddItem(0, 349, POINTLIST._STORE_DT_COMIC_ITEM7, 30, 300, CbComicRich, 5)
Here is the main code for getting kicked out
F_Aggression = function(l_9_0)
if not shared.g3_R09_N and not gPlayerBrokeStuff and (PAnimNumDestroyed(gAreaTrigger) > 0 or PedHasAggressed(gPlayer)) then
PlayerSetControl(0)
shared.playerAggressedInStore = true
AreaCancelStoredTransition()
SoundStopCurrentSpeechEvent(l_9_0)
PedIgnoreStimuli(l_9_0, true)
PedFaceObject(l_9_0, gPlayer, 3, 1)
CameraSetWidescreen(true)
Wait(500)
SoundSetAudioFocusCamera()
F_PedSetCameraOffsetXYZ(l_9_0, 0.076659999787807, 2.1552770137787, 1.798231959343, 0.028457999229431, 1.1699600219727, 1.6412600278854)
CameraAllowChange(false)
PedSetActionNode(l_9_0, "/Global/Welcome/ShakeFist", "Act/Conv/Store.act")
F_PlaySpeechAndWait(l_9_0, "STORE_VIOLENCE_RESPONSE", 0, "supersize")
CameraFade(500, 0)
Wait(500)
CameraAllowChange(true)
SoundSetAudioFocusPlayer()
CameraReturnToPlayer()
CameraReset()
CameraSetWidescreen(false)
LaunchScript("AreaScripts/StoreTransition.lua")
Wait(100)
gPlayerBrokeStuff = true
PedClearHasAggressed(gPlayer)
end
end
Hope some of this has shed light for a few people here...heh.
This is all in sstores.lur and I am rewriting that script. It is about 80% done and once fixed will pave the way for the v2 megastores mod.
I am currently doing the same for the v2 vehicle spawner which should allow driving of any vehicle. I am also currently nearly finished enabling driving any vehicle globally too.....sry to go offtopic there..