Having trouble with functions, stocks.
#2

What you have done wrong is this:
new superadmin;

The line above you used, this isn't a player but a global one.
So it should be this:

new superadmin[MAX_PLAYERS];

So this would be a correct check:
PHP код:
stock IsPlayerSuperAdmin(playerid)
{
 if(
superadmin[playerid]==1){
      return 
1;
    }
  return 
0;

About your login:

PHP код:
CMD:login(playeridparams[]){
    new 
password;
    if(
sscanf(params"i",password))return SendClientMessage(playerid0x33AA33AA"USAGE: /login [PASSWORD]");
    if(
password != blablabla) return SendClientMessage(playerid0x33AA33AA"Wrong Password.");
    
superadmin=1;
    
SendClientMessage(playerid0x33AA33AA"You have logged in.");
    return 
1;
    } 
superadmin=1; sets only one var while in this case we want to use superadmin[playerid]=1;

Also don't forget to empty the it on connect or disconnect otherwise when ID5 admin leaves, the next ID5 is still admin.
superadmin[playerid]=0;
Reply


Messages In This Thread
Having trouble with functions, stocks. - by XpoZzA - 27.09.2018, 10:01
Re: Trouble with functions, stocks. - by jasperschellekens - 27.09.2018, 10:07
Re: Having trouble with functions, stocks. - by XpoZzA - 27.09.2018, 10:13
Re: Having trouble with functions, stocks. - by jasperschellekens - 27.09.2018, 10:14
Re: Having trouble with functions, stocks. - by Dayrion - 27.09.2018, 10:58
Re: Having trouble with functions, stocks. - by XpoZzA - 27.09.2018, 11:26
Re: Having trouble with functions, stocks. - by TheToretto - 27.09.2018, 12:17

Forum Jump:


Users browsing this thread: 2 Guest(s)