06.08.2014, 03:14
You can test this, it surely will work:
PHP код:
new CarToDestroy[MAX_VEHICLES];
COMMAND:car(playerid,params[])
{
if(AdminLevel[playerid] >= 3)
{
new car;
if(IsPlayerInAnyVehicle(playerid)) return 1;
if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_RED, "USE: /car [car id]");
if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "That id doesn't exist[400-611]");
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
CarToDestroy[car] = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
PutPlayerInVehicle(playerid, CarToDestroy[car], 0);
}
else SendClientMessage(playerid,COLOR_RED,"You need to be an level 3 admin to use this command");
return 1;
}
public OnVehicleSpawn(vehicleid)
{
for(new i; i < MAX_VEHICLES; i++)
{
if(vehicleid == CarToDestroy[i])
{
DestroyVehicle(vehicleid);
break;
}
}
return 1;
}