18.06.2014, 15:56
I got the American Roleplay Script, and i need to make a command which will delete a players car.. Help ?
CMD:destroyvehicle(playerid, params[]) return cmd_destroycar(playerid, params);
CMD:destroycar(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 2) {
new car;
if(!sscanf(params, "i", car)) {
if(GetVehicleModel(car) >= 400) {
DestroyVehicleEx(car);
new string[30];
format(string, sizeof(string), "* Vehicle %d destroyed!", car);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
} else {
SendClientMessage(playerid, COLOR_LIGHTRED, " That vehicle doesn't exist!");
}
return 1;
} else {
if(IsPlayerInAnyVehicle(playerid)) {
car = GetPlayerVehicleID(playerid);
DestroyVehicleEx(car);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "* Vehicle destroyed!");
return 1;
} else {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Destroycar [Car ID]");
return 1;
}
}
}
return 1;
}