SA-MP Forums Archive
Explode vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Explode vehicle (/showthread.php?tid=531776)



Explode vehicle - Banditukas - 14.08.2014

Hi,

How instantly explode car? because setvehiclehealth, i set 200 but vehicle just burn and after 5-7 sec. boom


Re: Explode vehicle - Faisal_khan - 14.08.2014

Set health to 0 and then instantly create an explosion.


Re: Explode vehicle - GShock - 14.08.2014

Set the vehicle health to 0.


Re: Explode vehicle - biker122 - 14.08.2014

A simple /explode command:
pawn Код:
CMD:explode(playerid, params[])
{
    new ID, Float:x, Float:y, Float:z;
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFF, "Usage: /explode (player name/id)");
    if(!IsPlayerConnected(ID) return SendClientMessage(playerid, 0xFFFF00, "Invalid player!");
    switch(IsPlayerInAnyVehicle(ID))
    {
        case 0:
        {
            GetPlayerPos(playerid, x, y, z), CreateExplosion(x, y, z, 12, 20);
        }
        case 1:
        {
            new vID = GetPlayerVehicleID(playerid);
            GetVehiclePos(vID, x, y, z), SetVehicleHealth(vID, 0), CreateExplosion(x, y, z, 12, 20);
        }
    }
    return 1;
}