admin check? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: admin check? (
/showthread.php?tid=443398)
admin check? -
semaj - 11.06.2013
Can anyone help me i have
pawn Код:
stock GetPlayerAdminLevel(playerid)
{
new
a_level_string[ 128 ];
if ( userData[ playerid ][ Admin_Level ] == 1 )
format( a_level_string, sizeof ( a_level_string ), "Mod" );
else if ( userData[ playerid ][ Admin_Level ] == 2 )
format( a_level_string, sizeof ( a_level_string ), "Super Mod" );
else if ( userData[ playerid ][ Admin_Level ] == 3 )
format( a_level_string, sizeof ( a_level_string ), "Admin" );
else if ( userData[ playerid ][ Admin_Level ] == 4 )
format( a_level_string, sizeof ( a_level_string ), "Owner" );
else
format( a_level_string, sizeof ( a_level_string ), "Unknown admin level!" );
return a_level_string;
}
but how do i get it to save to my user account
thats my GM
http://pastebin.com/59wNYDic
Re: admin check? -
feartonyb - 11.06.2013
You don't need to save the string.
Код:
new AdminString[12];
if(userData[playerid][Admin_Level] == 1) { AdminString = "Mod"; }
else if(userData[playerid][Admin_Level] == 2) { AdminString = "Super Mod"; }
else if(userData[playerid][Admin_Level] == 3) { AdminString = "Admin"; }
else if(userData[playerid][Admin_Level] == 4) { AdminString = "Owner"; }
else { AdminString = "Unknown"; }
Re: admin check? -
semaj - 11.06.2013
what do you mean?
Re: admin check? -
feartonyb - 11.06.2013
I just posted the code in edit of previous post, read it
Re: admin check? -
semaj - 11.06.2013
pawn Код:
stock GetPlayerAdminLevel(playerid)
{
new AdminString[12];
if(userData[playerid][Admin_Level] == 1) { AdminString = "Mod"; }
else if(userData[playerid][Admin_Level] == 2) { AdminString = "Super Mod"; }
else if(userData[playerid][Admin_Level] == 3) { AdminString = "Admin"; }
else if(userData[playerid][Admin_Level] == 4) { AdminString = "Owner"; }
else { AdminString = "Unknown"; }
return a_level_string;
}
Re: admin check? -
feartonyb - 11.06.2013
You need to return
AdminString not
a_level_string
Re: admin check? -
Brandon_More - 11.06.2013
Try this:
Код:
stock GetPlayerAdminLevel(playerid)
{
new
tmp[ 40 ];
switch(PlayerInfo[playerid][Admin_Level])
{
case 4: myStrcpy(tmp, "Owner");
case 3: myStrcpy(tmp, "Admin");
case 2: myStrcpy(tmp, "Super Mod");
case 1: myStrcpy(tmp, "Mod");
case 0: myStrcpy(tmp, "Player");
default: myStrcpy(tmp, "N/A");
}
return tmp;
}