22.02.2012, 01:50
I am trying to make a /setadmin command, and I am trying to make it available for only RCON Admins or Level 1337 Admins. Now how do I go about this? I even looked in a C help forum to figure out the difference between
and once I figured that out I changed my command in light of this and there was no difference.
So here is my question. How can I make this command available for RCON Admins or Level 1337 Admins? Not a real big issue I just really need to learn to distinguish || from &&.
My code.
And here is the if statement that sets their admin level.
Am I using the if statements correctly?
Код:
|| and &&
So here is my question. How can I make this command available for RCON Admins or Level 1337 Admins? Not a real big issue I just really need to learn to distinguish || from &&.
My code.
pawn Код:
if(!IsPlayerAdmin(playerid) || pInfo[playerid][pAdmin] != 1337)
{
return SendClientMessage(playerid,COLOR_LIGHTGRAY,"You are not authorized to use that command.");
}
pawn Код:
else if(IsPlayerAdmin(playerid) || pInfo[playerid][pAdmin] == 1337)
{
format(tidstring,sizeof(tidstring),"Administrator %s has made you a level %d Adminstrator.",sin,aLevel);
format(sidstring,sizeof(sidstring),"You have made %s a level %d Administrator.",tin,aLevel);
SendClientMessage(tid,COLOR_AQUA,tidstring);
SendClientMessage(sid,COLOR_AQUA,sidstring);
pInfo[tid][pAdmin] = aLevel;
return 1;
}