19.04.2013, 13:20
Hey I have made a command for admins to spawn a vehicle, but when the are done with this and leave it, it just stays there. But I want something like when they are done with it, it destory the vehicle. I need a little help with it. Here is my code.
pawn Код:
CMD:veh(playerid, params[])
{
if(GetAdminLevel(playerid) >= 2) {
new car;
if(IsPlayerInAnyVehicle(playerid)) return 1;
if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehid]");
if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "Invalid model id!");
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
PutPlayerInVehicle(playerid, car, 0);
}
return 1;
}