02.06.2017, 20:46
this is the best i think
PHP Code:
CMD:adestroycar(playerid, params[])
{
new TargetID,destroyveh,str1[128];
if(sscanf(params, "u", TargetID)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /adestroycar [id]");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID)) return SendClientMessage(playerid, COLOR_RED, "That Player Is Not Connected");
if(GetPlayerState(TargetID) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "Player Is Not In A Vehicle.");
else
{
format(str1,sizeof(str1),"%s (%d)'s Vehicle Has Been Destroyed.",pname(TargetID),TargetID);
SendClientMessage(playerid,COLOR_HOTPINK,str1);
destroyveh = GetPlayerVehicleID(TargetID);
DestroyVehicle(destroyveh);
}
return 1;
}