Admin -
MatriXgaMer - 08.01.2014
Hey guys, back from Bozic(Chrismas). I have this Error.
pawn Код:
if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_RED,"[SA:RP] Niste ovlasceni da koristite ovu komandu.");
PAWNO is showing no errors, but i am admin level 5 and its showing me that i am not allowed to do this command.
pawn Код:
isAdmin(playerid,a_level)
{
if(sInfo[playerid][alevel]>=a_level)return 1;
return 0;
}
Re: Admin -
DexterC - 08.01.2014
Try using
pawn Код:
if (isAdmin(playerid, 3))return SendClientMessage(playerid,COLOR_RED,"[SA:RP] Niste ovlasceni da koristite ovu komandu.");
Re: Admin -
Seif- - 08.01.2014
Try to set yourself admin level 5(with the same variable) and execute the command again, it should work. If it works, then the problem is likely your loading.
Re: Admin - Patrick - 08.01.2014
Try this, for more accuracy, I am not sure if that's the problem as
Seif- stated it might be your
loading/saving system.
pawn Код:
isAdmin(playerid,a_level)
{
//so basically if the level is the same or higher than a_level it will return true, else it will return false.
if(sInfo[playerid][alevel] >= a_level) return true;
else return false;
}
// or
isAdmin(playerid, a_level)
{
if(sInfo[playerid][alevel] >= a_level) //if higher than a_level or equals than a_level
{
print("return true"); //debug, remove this after problem fixed
return true;
}
else if(sInfo[playerid][alevel] <= 0) //if lower than 0 or equals than 0
{
print("return false"); //debug, remove this after problem fixed
return false;
}
return false; //return false = default
}
Goodnight!
Re: Admin -
Seif- - 08.01.2014
Quote:
Originally Posted by pds2k12
Try this, for more accuracy, I am not sure if that's the problem as Seif- stated it might be your loading/saving system.
pawn Код:
isAdmin(playerid,a_level) { if(sInfo[playerid][alevel]>=a_level) return true; else return false; }
// or
isAdmin(playerid, a_level) { if(sInfo[playerid][alevel] >= a_level) { print("return 1"); return 1; } print("return 0"); return 0; }
|
That will actually change nothing. true and false is the same as 1 and 0. Printing will also not help debug his issue because he receives his message, which is only possible when the function returns false. It has to be the loading/saving part.
Re: Admin - Patrick - 08.01.2014
Quote:
Originally Posted by Seif-
That will actually change nothing. true and false is the same as 1 and 0. Printing will also not help debug his issue because he receives his message, which is only possible when the function returns false. It has to be the loading/saving part.
|
It doesn't but better to make it more accurate, sorry for using
true or
false, that's how I script instead of using
1 or
0. another thing, try to check the
variable if there is something
stored on it, if there is not then the problem would be on your
loading/saving sytem.
Re: Admin -
MatriXgaMer - 09.01.2014
Thanks everybody!