[help on y_commands.inc]player permissions and commands with multiple parameters
#2

Код HTML:
YCMD:vehicle(playerid, params[])
{
    if(!IsPlayerAdmin(playerid) && GetPVarInt(playerid, "Admin") < 2) return SendClientMessage(playerid,RED,"You are not RCON or Head admin!");
    else
    {
        new vehid;new b1;new b2;
        if(sscanf(params, "iii", vehid,b1,b2)) SendClientMessage(playerid, RED, "Use: /vehicle [car id] [color 1] [color 2]");
        else if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, RED, "Wrong car id!");
        else if(vehid == 425 || vehid == 520 || vehid == 537 || vehid == 538 || vehid == 569 || vehid == 570 || vehid == 590) return SendClientMessage(playerid, CRVENA, "You can't spawn a hydra and the rest military vehicles!");
        else if(b2 <=0 || b2 >= 252) return SendClientMessage(playerid, RED, "Invalid color 1 id!");
        else if(b1 <=0 || b1 >= 252) return SendClientMessage(playerid, RED, "Invalid color 2 id!");
        else
        {
            new Float:x, Float:y, Float:z;new Float:fa;
            GetPlayerPos(playerid, x, y, z);
            GetPlayerFacingAngle(playerid, fa);
            CreateVehicle(vehid, x + 3, y + 1, z, fa, b1, b2, -1);
            SendClientMessage(playerid, GREEN, "You have spawned a vehicle");
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)