Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function newPickups.tick()
- newPickups.currentTime = GAMEPLAY.GET_GAME_TIMER()
- newPickups.playerExists = ENTITY.DOES_ENTITY_EXIST(PLAYER.PLAYER_PED_ID())
- if(newPickups.playerExists == true) then
- if((newPickups.currentTime - newPickups.checkTime) > newPickups.replenishInterval) then
- newPickups.checkTime = newPickups.currentTime
- newPickups.spawnPickups = true
- end
- if(newPickups.spawnPickups == true) then
- if(newPickups.firstRun) then
- for i, coords in pairs(newPickups.armorLocations) do
- newPickups.armorObjects[i] = OBJECT.CREATE_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"), coords[1], coords[2], coords[3], 0, 1, false, GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"))
- newPickups.firstRun = false
- newPickups.logAction("New Pickup Spawned x:" .. coords[1] .. ",y:" .. coords[2] .. ",z:" .. coords[3])
- end
- else
- for i, coords in pairs(newPickups.armorLocations) do
- if(OBJECT.DOES_PICKUP_OBJECT_EXIST(newPickups.armorObjects[i]) == false) then
- newPickups.armorObjects[i] = OBJECT.CREATE_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"), coords[1], coords[2], coords[3], 0, 1, false, GAMEPLAY.GET_HASH_KEY("PICKUP_ARMOUR_STANDARD"))
- newPickups.logAction("New Pickup Spawned x:" .. coords[1] .. ",y:" .. coords[2] .. ",z:" .. coords[3])
- else
- newPickups.logAction("Pickup Already Exists At x:" .. coords[1] .. ",y:" .. coords[2] .. ",z:" .. coords[3])
- end
- end
- end
- newPickups.spawnPickups = false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement