Jump to content

createExplosion cmd


Recommended Posts

Posted

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?

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...