Making a command useable for two different groups (VIPs and Admins)
#1

Hello I want to have a command that can be used for two different groups,
as you can see this command works for admins:
pawn Код:
CMD:vr(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1) {
        if (IsPlayerInAnyVehicle(playerid)) {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
            RecentVR[playerid] =1;
            return GameTextForPlayer(playerid,"~green~Vehicle Repaired", 2000, 3);
        } else return SendClientMessage(playerid,red,"Error: You are not in a vehicle");
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 1 to use this command");}
But I want VIPs to able to use the same command:
pawn Код:
if(PlayerInfo[playerid][VIPMember] >= 1) {
but I dont know if this works or how I can do it so I need some help please.. :/
Reply
#2

pawn Код:
if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][VIPMember] >= 1) {
Reply
#3

pawn Код:
if (PlayerInfo[playerid][playerVIP] == 1 || PlayerInfo[playerid][playerAdmin] == 1)
{
//run code.
}
Is this what you want? (the || indicates OR)
Reply
#4

pawn Код:
CMD:vr(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1 ||PlayerInfo[playerid][VIPMember] >=  ) {
        if (IsPlayerInAnyVehicle(playerid)) {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
            RecentVR[playerid] =1;
            return GameTextForPlayer(playerid,"~green~Vehicle Repaired", 2000, 3);
        } else return SendClientMessage(playerid,red,"Error: You are not in a vehicle");
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 1 to use this command");}
Reply
#5

Are you guys sure that this will let VIPs that arent ADMIN can use the command?
Like are you sure if a player only needs to be in one of the groups to be able to use the command and not the both at same time.
Reply
#6

I am sure, "||" means or.
Reply
#7

Quote:
Originally Posted by OleKristian95
Посмотреть сообщение
Are you guys sure that this will let VIPs that arent ADMIN can use the command?
Like are you sure if a player only needs to be in one of the groups to be able to use the command and not the both at same time.
I am 100% sure...
Reply
#8

Ok, thanks alot for the help guy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)