10.01.2016, 17:24
Hello. I have a problem with my command "/vehicle".
In the past it was a command like this: /veh
And now when I try to type: /vehicle 411 3 3 it says this: "Invalid vehicle ID specified !(411 - 611)"
I really don't know what to do. So I hope you can help me
Here is the command:
In the past it was a command like this: /veh
And now when I try to type: /vehicle 411 3 3 it says this: "Invalid vehicle ID specified !(411 - 611)"
I really don't know what to do. So I hope you can help me
Here is the command:
PHP код:
if(strcmp(cmd, "/vehicle", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new car,color,color2;
if(PlayerInfo[playerid][pAdmin] == 10)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /vehicul [model] [culoare1] [culoare2]");
return 1;
}
if(car < 400 || car > 611) return SendClientMessage(playerid,COLOR_GRAD2, "Invalid vehicle ID specified !(411 - 611)");
if(color> 255 || color< 0) return SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
if(color2> 255 || color2< 0) return SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
if(IsPlayerInAnyVehicle(playerid)) return RemovePlayerFromVehicle(playerid);
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,A);
new carid = CreateVehicle(car, X,Y,Z,A, color, color2, -1);
PutPlayerInVehicle(playerid,carid, 0);
LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
}
else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
}
return 1;
}