What is wrong with this ?
#1

So can someone please tell me what is wrong with this check

pawn Код:
if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster] == 0) return SCM(playerid, GREY, "Not Allowed.");
or

pawn Код:
if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster] < 2) return SCM(playerid, GREY, "Not Allowed.");
My Admin level is 6 but my gamemaster level is 0, which means i can use this command, bc im admin lvl 6 but it allways returns to me Not Allowed.
Reply
#2

pawn Код:
if(PI[playerid][Admin] >= 1)
If player is admin level 1 or greater then he can use the command

pawn Код:
if(PI[playerid][Admin] == 6 && PI[playerid][GameMaster] == 0 || 1 || 2 || 3 || 4 || 5)
{
    //Means player is admin level 6 and Gamemaster level 0 or 1, or 2 or 3 or 4 or 5
}
else
{
    //Player is either not admin lvl 6 or not gamemaster lvl 1,2,3,4,5
}
Reply
#3

Wouldn't that mean that player has to be admin and game master so he could use that command ?
Reply
#4

That means player has to be admin level 6 and either gamemaster level 0,1,2,3,4, or 5 ...

' Must be admin but won't matter if he's gamemaster or not'
Is that what you wanted?
Reply
#5

Yeah, you know gamemaster is lower rank than admin, so he can use some of the commands that admin can too
Reply
#6

Can i put it in one line like

pawn Код:
if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster] == 0) return SCM(playerid, GREY, "Not Allowed.");
but that one is not working
Reply
#7

pawn Код:
if(PI[playerid][Admin] == 6 && PI[playerid][GameMaster] == 0 || 1 || 2 || 3 || 4 || 5)
Reply
#8

You don't understand. For example in this command, admin have to be level 1 or greater to use this command, or if player is not an admin he has to be GameMaster level 1 or greater, and if player is not admin or game master he can't use this command at all..

pawn Код:
CMD:goto(playerid, params[])
{
    if(LoggedIN[playerid] == 0) return SCM(playerid, GREY, "YOu have to be logged-in first.");

    new id, veh = GetPlayerVehicleID(playerid), Float:X, Float:Y, Float:Z;
    if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster]) return SCM(playerid, GREY, "Not allowed.");
    if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Use: /goto [ID / Part of Name]");
    if(!IsPlayerConnected(id)) return SCM(playerid, GREY, "That player is not online.");

    if(IsPlayerInAnyVehicle(playerid))
    {
        GetPlayerPos(id, X, Y, Z);
        SetVehiclePos(veh, X, Y+2, Z);
        LinkVehicleToInterior(veh, GetPlayerInterior(id));
        SetPlayerVirtualWorld(veh, GetPlayerVirtualWorld(id));
    }
    else
    {
        GetPlayerPos(id, X, Y, Z);
        SetPlayerPos(playerid, X, Y+2, Z);
        SetPlayerInterior(playerid, GetPlayerInterior(id));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    }

    SCM(playerid, GREY, "You have been teleported.");
    return 1;
}
Reply
#9

pawn Код:
CMD:goto(playerid, params[])
{
    if(LoggedIN[playerid] == 0) return SCM(playerid, GREY, "YOu have to be logged-in first.");

    new id, veh = GetPlayerVehicleID(playerid), Float:X, Float:Y, Float:Z;
    if(!PI[playerid][Admin] || !PI[playerid][GameMaster]) return SCM(playerid, GREY, "Not allowed.");
    if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Use: /goto [ID / Part of Name]");
    if(!IsPlayerConnected(id)) return SCM(playerid, GREY, "That player is not online.");

    if(IsPlayerInAnyVehicle(playerid))
    {
        GetPlayerPos(id, X, Y, Z);
        SetVehiclePos(veh, X, Y+2, Z);
        LinkVehicleToInterior(veh, GetPlayerInterior(id));
        SetPlayerVirtualWorld(veh, GetPlayerVirtualWorld(id));
    }
    else
    {
        GetPlayerPos(id, X, Y, Z);
        SetPlayerPos(playerid, X, Y+2, Z);
        SetPlayerInterior(playerid, GetPlayerInterior(id));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    }

    SCM(playerid, GREY, "You have been teleported.");
    return 1;
}
Reply
#10

Quote:
Originally Posted by ShoortyFl
Посмотреть сообщение
You don't understand. For example in this command, admin have to be level 1 or greater to use this command, or if player is not an admin he has to be GameMaster level 1 or greater, and if player is not admin or game master he can't use this command at all..

pawn Код:
CMD:goto(playerid, params[])
{
    if(LoggedIN[playerid] == 0) return SCM(playerid, GREY, "YOu have to be logged-in first.");

    new id, veh = GetPlayerVehicleID(playerid), Float:X, Float:Y, Float:Z;
    if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster]) return SCM(playerid, GREY, "Not allowed.");
    if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Use: /goto [ID / Part of Name]");
    if(!IsPlayerConnected(id)) return SCM(playerid, GREY, "That player is not online.");

    if(IsPlayerInAnyVehicle(playerid))
    {
        GetPlayerPos(id, X, Y, Z);
        SetVehiclePos(veh, X, Y+2, Z);
        LinkVehicleToInterior(veh, GetPlayerInterior(id));
        SetPlayerVirtualWorld(veh, GetPlayerVirtualWorld(id));
    }
    else
    {
        GetPlayerPos(id, X, Y, Z);
        SetPlayerPos(playerid, X, Y+2, Z);
        SetPlayerInterior(playerid, GetPlayerInterior(id));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    }

    SCM(playerid, GREY, "You have been teleported.");
    return 1;
}
But i said this later
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)