LiOneLMeSsIShoT Posted August 17, 2013 Posted August 17, 2013 I made this script to show marker and pickups...only for test..but i got Error: You may help me guys ERROR: :13: Bad argument @ 'createPickup' local pbags = { {2293.154296875, 561.470703125, 7.78125} {2422.3,-2261.6,16}, {1758.9,-2767.9,1.7}, {2493.3,-951.8,82.25}, {815.7,-1108.2,25.8}, {390.9,-2054.3,13.8}, {-719.05,-1938.8,8.35}, {-625.7,-2249.5,23.05}, {-1812.3,-168.5,18.2}, {-2659.5,1528.05,54.79}, {-1733.76,194.75,3.6}, {-2535.5,40.15,8.5}, {-1804.85,558.45,35.15}, {-752.6,-131.6,65.8}, } local marker = createMarker (2291.1999511719,537,0.80000001192093,"cylinder", 1.5, 255, 0, 0) function createBags ( thePlayer ) local x, y, z = pbags local bag = createPickup ( x, y, z, 3, 1550 ) end addEventHandler ("onResourceStart", getRootElement(), createBags) function onPickupHit ( thePlayer ) if ( source ~= bag ) then return end if ( isPedInVehicle ( thePlayer ) ) then return end setElementCollisionsEnabled ( bag, false ) attachElements ( bag, thePlayer, 0, -0.3, 0.3 ) setElementData ( thePlayer, "bag", true ) destroyElement ( bag ) end addEventHandler ("onPickupHit", getRootElement(), onPickupHit)
Castillo Posted August 17, 2013 Posted August 17, 2013 local x, y, z = pbags Change it to: local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] )
LiOneLMeSsIShoT Posted August 17, 2013 Author Posted August 17, 2013 local x, y, z = pbags Change it to: local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] ) but i want all pickups spawn around the city with the x, y, z..not only 1 or 2
Castillo Posted August 17, 2013 Posted August 17, 2013 Ah, then you have to loop the table and create them.
LiOneLMeSsIShoT Posted August 17, 2013 Author Posted August 17, 2013 Ah, then you have to loop the table and create them. Give me an example please .. also the pickup when i pick it up.. not be attached in the player back ..help please
LiOneLMeSsIShoT Posted August 17, 2013 Author Posted August 17, 2013 http://lua.lickert.net/loop/index_en.html also the pickup when i pick it up.. not be attached in the player back also i didn't understand anything in that loop ! please give me an example with it? or something to make me understand
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now