xXNemesiSXx Posted February 20, 2011 Share Posted February 20, 2011 Sorry for my bad english, i'm italian I don't know how i can get all players and all vehicles in a lua script... i want to kill and destroy all players and all vehicles, but before to do this i have to get them. how ca i do this ? Link to comment
Castillo Posted February 20, 2011 Share Posted February 20, 2011 function killBlow() for i,players in pairs(getElementsByType("player")) do killPed(players) end for i,vehicles in pairs(getElementsByType("vehicle")) do blowVehicle(vehicles) end end addCommandHandler("killandblow") Should work. Link to comment
xXNemesiSXx Posted February 20, 2011 Author Share Posted February 20, 2011 function killBlow() for i,players in pairs(getElementsByType("player")) do killPed(players) end for i,vehicles in pairs(getElementsByType("vehicle")) do blowVehicle(vehicles) end end addCommandHandler("killandblow") Should work. thanks a lot !! but ...look here... do killPed(players) end why you used killPed and not killPlayer or something like that? Link to comment
Castillo Posted February 20, 2011 Share Posted February 20, 2011 killPlayer is outdated if i'm right Link to comment
xXNemesiSXx Posted February 20, 2011 Author Share Posted February 20, 2011 killPlayer is outdated if i'm right thanks a lot !! Link to comment
xXNemesiSXx Posted February 20, 2011 Author Share Posted February 20, 2011 Sorry if i do another post, but now i've to ask how to destroy a marker called "energyderiv"... to create a marker i can use createMarker, but to destroy it? Link to comment
HunT Posted February 21, 2011 Share Posted February 21, 2011 setTimer ( destroyElement, "time" , 1 , "name function" ) i'm scripter Link to comment
Castillo Posted February 21, 2011 Share Posted February 21, 2011 Hunter, just because you can make a timer it doesn't means you are an scripter also this fails. setTimer ( destroyElement, time_in_milliseconds, times_to_execute_the_function, element_name ) example of element name: myelement = createObject() P.S: Why would he use a timer instead of just destroyElement? Link to comment
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