Added Effects:
new file: Peds/PedsSetEveryoneIntoRandomVehicle.lua new file: Player/PlayerBankHeist.lua new file: Player/PlayerTPToLastVehicle.lua Modified: Weather/WeatherCanadian.lua - reversed a True/False Statement to potentially fix a bug that throws around vehicles when the ped gets a snowman spawned on them.
This commit is contained in:
31
Peds/PedsSetEveryoneIntoRandomVehicle.lua
Normal file
31
Peds/PedsSetEveryoneIntoRandomVehicle.lua
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
EffectInfo = {
|
||||||
|
Name = "Set Everyone Into Random Vehicle",
|
||||||
|
EffectId = "peds_seteveryoneintorandom",
|
||||||
|
HideRealNameOnStart = true,
|
||||||
|
TimedType = "None",
|
||||||
|
EffectGroup = "_group_trafficspawner",
|
||||||
|
EffectCategory = "TrafficSpawner"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function OnStart()
|
||||||
|
vehicles = {}
|
||||||
|
for _, model in ipairs(GetAllVehicleModels()) do
|
||||||
|
table.insert(vehicles, model)
|
||||||
|
end
|
||||||
|
randomVehicle = random_choice(vehicles)
|
||||||
|
vehicleHash = randomVehicle
|
||||||
|
SetSurroundingPedsInVehicles(vehicleHash, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnStop()
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnTick()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function random_choice(p1)
|
||||||
|
choice = p1[math.random(#p1)]
|
||||||
|
return choice
|
||||||
|
end
|
44
Player/PlayerBankHeist.lua
Normal file
44
Player/PlayerBankHeist.lua
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
EffectInfo = {
|
||||||
|
Name = "The Big Score",
|
||||||
|
EffectId = "player_tptoheistlocation",
|
||||||
|
TimedType = "None",
|
||||||
|
EffectGroup = "None",
|
||||||
|
EffectCategory = "None"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function OnStart()
|
||||||
|
EnableScriptThreadBlock()
|
||||||
|
bankLoc = {22.70556, -744.3594, 43.93562}
|
||||||
|
|
||||||
|
vanModel = "burrito4"
|
||||||
|
vanHash = GET_HASH_KEY(vanModel)
|
||||||
|
van = CreatePoolVehicle(vanHash, bankLoc[1], bankLoc[2], bankLoc[3], -61) -- translates the table into coords using a simple method
|
||||||
|
|
||||||
|
gunManModel = "hc_gunman"
|
||||||
|
hackerModel = "hc_hacker"
|
||||||
|
gunManModelHash = GET_HASH_KEY(gunManModel)
|
||||||
|
hackerModelHash = GET_HASH_KEY(hackerModel)
|
||||||
|
|
||||||
|
gunMan = CreatePoolPed(0, gunManModelHash, bankLoc[1], bankLoc[2], bankLoc[3]+20, 0)
|
||||||
|
SET_PED_INTO_VEHICLE(gunMan, van, -2)
|
||||||
|
|
||||||
|
hackerMan = CreatePoolPed(0, hackerModelHash, bankLoc[1], bankLoc[2], bankLoc[3]+20, 0)
|
||||||
|
SET_PED_INTO_VEHICLE(hackerMan, van, -2)
|
||||||
|
|
||||||
|
|
||||||
|
SET_PED_INTO_VEHICLE(PLAYER_PED_ID(), van, -1)
|
||||||
|
|
||||||
|
if GET_PLAYER_WANTED_LEVEL(PLAYER_ID()) < 3 then
|
||||||
|
SET_PLAYER_WANTED_LEVEL(PLAYER_ID(), 3, 0)
|
||||||
|
SET_PLAYER_WANTED_LEVEL_NOW(PLAYER_ID(), 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
DisableScriptThreadBlock()
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnStop()
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnTick()
|
||||||
|
end
|
22
Player/PlayerTPToLastVehicle.lua
Normal file
22
Player/PlayerTPToLastVehicle.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
EffectInfo = {
|
||||||
|
Name = "Teleport to last used vehicle",
|
||||||
|
EffectId = "player_tptolastveh",
|
||||||
|
TimedType = "None",
|
||||||
|
EffectGroup = "None",
|
||||||
|
EffectCategory = "None"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function OnStart()
|
||||||
|
playerPed = PLAYER_PED_ID()
|
||||||
|
vehicle = GET_LAST_DRIVEN_VEHICLE()
|
||||||
|
if DOES_ENTITY_EXIST(vehicle) and IS_PED_DEAD_OR_DYING(playerPed,0) then
|
||||||
|
SET_PED_INTO_VEHICLE(playerPed, vehicle, -1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnStop()
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnTick()
|
||||||
|
end
|
@@ -32,7 +32,7 @@ function OnTick()
|
|||||||
coords = GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ped, 0, 0, 50)
|
coords = GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ped, 0, 0, 50)
|
||||||
|
|
||||||
snowManProp = CreatePoolProp(snowManModelhash, coords.x, coords.y, coords.z, false)
|
snowManProp = CreatePoolProp(snowManModelhash, coords.x, coords.y, coords.z, false)
|
||||||
SET_ENTITY_COLLISION(snowManProp, false, true)
|
SET_ENTITY_COLLISION(snowManProp, false, false)
|
||||||
ATTACH_ENTITY_TO_ENTITY(snowManProp, ped, GET_PED_BONE_INDEX(ped, 0x0), 0, 0, 0, 0, 0, 0, false, false, false, false, 0, true)
|
ATTACH_ENTITY_TO_ENTITY(snowManProp, ped, GET_PED_BONE_INDEX(ped, 0x0), 0, 0, 0, 0, 0, 0, false, false, false, false, 0, true)
|
||||||
|
|
||||||
snowMen[ped] = true -- allows me to internally track which ped has a snowman attached to them to prevent spawning duplicates and causing a memory crash
|
snowMen[ped] = true -- allows me to internally track which ped has a snowman attached to them to prevent spawning duplicates and causing a memory crash
|
||||||
|
Reference in New Issue
Block a user