SA-MP Forums Archive
/vkill with object attached deleter - 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: /vkill with object attached deleter (/showthread.php?tid=473426)



/vkill with object attached deleter - gotwarzone - 02.11.2013

Hi guys. I have here a vkill command which deletes the vehicle. But I also want to add to this command a attach vehicle object delete. Coz I tried to delete a vehicle with an objects attached on it but it doesn't, the objects just floats and only stay in current position, but the vehicle deletes.

Код:
CMD:vkill(playerid, params[])
{
    if(pInfo[playerid][pLevel] >= 1)
	{
        new vehicleid, string[64];
        if(vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, white,"{FF0000}>> Vehicle not found");
        if(!sscanf(params, "i", vehicleid))
        {
            DestroyVehicle(vehicleid);
            format(string, sizeof(string), ">> Vehicle ID: %d has been successfully deleted", vehicleid);
            SendClientMessage(playerid, white, string);
            return 1;
        }
        else return SendClientMessage(playerid, white, "{FFFF00}Usage: /vkill <Vehicle ID>");
    }
    else return ShowMessage(playerid, red, 1);
}