toxicsmoke11 Posted March 12, 2014 Share Posted March 12, 2014 hello. i want to make a command to make an explosion around a player. so like, /explode *playername* it should make explosion around the *playername* and make sure it kills him whether hes in car or on foot. i just don't know how to make that,i've never made anything with addCommandHandler,and that's why i'm asking in here about this,so could anyone help me with this please? Link to comment
Castillo Posted March 12, 2014 Share Posted March 12, 2014 addCommandHandler ( "explode", function ( thePlayer, _, target ) local theTarget = getPlayerFromName ( target ) -- Get the player element from it's name. if ( theTarget ) then -- If the player exists... local x, y, z = getElementPosition ( theTarget ) -- Get his position. for index = 1, 10 do -- Execute createExplosion 10 times. createExplosion ( x, y, z, 11, thePlayer ) end end end ) Read comments. Link to comment
toxicsmoke11 Posted March 12, 2014 Author Share Posted March 12, 2014 Thank you solidsnake14,now i understand more about positions and addCommandHandler 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