SA-MP Forums Archive
Level - 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: Level (/showthread.php?tid=632441)



Level - Loinal - 14.04.2017

Fixed


Re: Level - GangstaSunny. - 14.04.2017

Check if the user was already an admin. If so, don't ++ your variable.


Re: Level - Loinal - 14.04.2017

Quote:
Originally Posted by GangstaSunny.
View Post
Check if the user was already an admin. If so, don't ++ your variable.
How can i check that?


Re: Level - GangstaSunny. - 14.04.2017

PHP Code:
if(level > pData[lookupid][Admin]) 
        { 
            new 
irc[130]; 
            
format(irc,sizeof(str),"8,3* Admin %s (ID: %d) granted level %d to %s (ID: %d)",GetName(playerid), playerid, level,GetName(lookupid),lookupid); 
            
IRC_GroupSay(groupID, IRC_CHANNEL, irc); 
            
format(str, sizeof(str), "Admin %s (ID:%d) has granted level %d to you",GetName(playerid), playerid, level); 
            
SendClientMessage(lookupid, COLOR_YELLOW, str); 
            
format(str, sizeof(str),"You have setted %s (ID:%d) to level %d",GetName(lookupid),lookupid,level); 
            
SendClientMessage(playerid, COLOR_YELLOW, str);
            if(
level >= 3) 
            {
            if(
pData[lookupid][Admin] < 3){onlineadmins++;}//If not already an admin count ++
            
pData[lookupid][Admin] = level;//now set the level
            
new strings[100+1000]; 
            
format(strings, sizeof(strings), "Online Admins: %d",onlineadmins); 
            
TextDrawSetString(oa, strings); 
            
TextDrawShowForPlayer(playerid, oa); 
            } 
        }