pawn Код:
if(strcmp(cmd, "/vehicle", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] != 10) SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
else
{
new Model[4];
strcat(Model,strtok(cmdtext, idx));
if(!Model[0]) SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /vehicul [model] [culoare1] [culoare2]");
else if(!(400 <= (Model[0] = strval(Model)) <= 611)) SendClientMessage(playerid,COLOR_GRAD2, "Invalid vehicle ID specified !(411 - 611)");
else
{
new color_1[4];
strcat(color_1,strtok(cmdtext, idx));
if(!color_1[0]) SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /vehicul [model] [culoare1] [culoare2]");
else if(!(0 <= (color_1[0] = strval(color_1)) <= 255)) SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
else
{
new color_2[4];
strcat(color_2,strtok(cmdtext, idx));
if(!color_2[0]) SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /vehicul [model] [culoare1] [culoare2]");
else if(!(0 <= (color_2[0] = strval(color_2)) <= 255)) SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
else
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,A);
new carid = CreateVehicle(Model[0], X, Y, Z, A, color_1[0], color_2[0], -1);
LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid,carid,0);
}
}
}
}
return 1;
}