nice daniel but some parts arent necessary
pawn Код:
if(strcmp(cmd, "/car", true) == 0)
{
if (AdminLevel[playerid] < 5)
return SendClientMessage(playerid, red, "Your not high enough level to use this command");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /car [carid]");
new car = strval(tmp);
if(car < 400 || car > 611)
return SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerFacingAngle(playerid, A);
GetPlayerPos(playerid, X, Y, Z);
X += 5 * floatsin(-A, degrees);
Y += 5 * floatcos(-A, degrees);
tmp = strtok(cmdtext, idx);
if(strlen(tmp))
{
new color_1 = strval(tmp);
new color_2 = strval(strtok(cmdtext, idx));
if(!First_Spawned_Car) return (First_Spawned_Car = CreateVehicle(car, X, Y, Z, -A, color_1, color_2, -1));
return CreateVehicle(car, X, Y, Z, -A, color_1, color_2, -1);
}
if(!First_Spawned_Car) return (First_Spawned_Car = CreateVehicle(car, X, Y, Z, -A, -1, -1, -1));
return CreateVehicle(car, X, Y, Z, -A, -1, -1, -1);
}
pawn Код:
if(strcmp(cmd, "/destroycar", true) == 0)
{
if(AdminLevel[playerid] < 5)
return SendClientMessage(playerid, red, "Your not high enough level to use this command");
for(; First_Spawned_Car <= MAX_VEHICLES; First_Spawned_Car++)
DestroyVehicle(First_Spawned_Car);
return !(First_Spawned_Car = 0);
}