10.01.2016, 20:03
Alright, I have converted your command to ZCMD and used sscanf.
At the top of your gamemode include ZCMD and sscanf2.
* I also removed the if(IsPlayerConnected(playerid)) condition I mean how if the player is not even connected he could use the command?
->Any feedback would be appreciated!
At the top of your gamemode include ZCMD and sscanf2.
pawn Код:
CMD:vehicle(playerid, params[]) {
{
new car,color,color2;
if(PlayerInfo[playerid][pAdmin] == 10)
{
if(sscanf(params,"iii", car, color, color2))
{
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;
}
->Any feedback would be appreciated!