I have a problem with a command "/vehicle"
#3

Alright, I have converted your command to ZCMD and used sscanf.
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;
}
* 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!
Reply


Messages In This Thread
I have a problem with a command "/vehicle" - by radiobizza - 10.01.2016, 17:24
Re: I have a problem with a command "/vehicle" - by radiobizza - 10.01.2016, 19:36
Re: I have a problem with a command "/vehicle" - by Stanford - 10.01.2016, 20:03
Re: I have a problem with a command "/vehicle" - by radiobizza - 10.01.2016, 20:30
Re: I have a problem with a command "/vehicle" - by Jefff - 10.01.2016, 20:35
Re: I have a problem with a command "/vehicle" - by radiobizza - 10.01.2016, 20:49
Re: I have a problem with a command "/vehicle" - by Jefff - 10.01.2016, 20:51
Re: I have a problem with a command "/vehicle" - by radiobizza - 11.01.2016, 03:36

Forum Jump:


Users browsing this thread: 1 Guest(s)