rendered paste bodyif(strcmp(cmd, "/vehicle", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid) == 1)
{
SendClientMessage(playerid, 0xAA3333AA, "Exit the vehicle first!");
return 1;
)
else
{
new vehicleID;
new color1;
new color2;
new Float:x, Float:y, Float:z;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFF00AA, "USAGE: \"/vehicle [vehicleid] [color1] [color2]\"");
return 1;
}
vehicleID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFF00AA, "USAGE: \"/vehicle [vehicleid] [color1] [color2]\"");
return 1;
}
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFF00AA, "USAGE: \"/vehicle [vehicleid] [color1] [color2]\"");
return 1;
}
color2 = strval(tmp);
GetPlayerPos(playerid, x, y, z);
CreateVehicle(vehicleID, x+2, y+2, z+2, 0, color1, color2, 1000000);
return 1;
}
}