I Need Setlevel CMD That Using zcmd And Sscanf
#1

Help me I Trying To Making Own Administrator System I Need Setlevel Command And I already done to make register/login
Reply
#2

First, what's your specific problem?
Second, we can't guess how you define "admin", show the enumerator or whatever you use.
Reply
#3

enum Extra
{
Name[MAX_PLAYER_NAME],
Password,
Ip[16],
Regged,
Logged,
Admin,
Vip,
#if EnableTwoRcon == true
MaxRcon,
#endif
Money,
Score,
Skin,
Kills,
Deaths,
Attempts,
}
Reply
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
First, what's your specific problem?
He doesn't seem to have any, he is asking for it
Reply
#5

Considering you've this:
PHP код:
new PlayerInfo[MAX_PLAYERS][Extra]; 
Defines:
PHP код:
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA 
Command would be:
PHP код:
CMD:setlevelplayeridcmdtext[] ) {
    new 
targetid,
        
adminlevel,
        
string[128],
        
targetname[MAX_PLAYER_NAME],
        
playername[MAX_PLAYER_NAME];
    
GetPlayerName(targetidtargetnamesizeof(targetname));
    
GetPlayerName(playeridplayernamesizeof(playername));
    if(
PlayerInfo[playerid][Admin] < 6// or whatever admin level you want
        
return SendClientMessage(playeridCOLOR_RED"SERVER: You can't use this command.");
    if(
sscanf(cmdtext"ud"targetidadminlevel))
        return 
SendClientMessage(playeridCOLOR_RED"USAGE: /setlevel [playerid] [adminlevel]");
    if(
PlayerInfo[targetid][Admin] <= adminlevel) {
    
        
format(stringsizeof(string), "* You have promoted %s to Admin Level %d."targetname);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
format(stringsizeof(string"* You have been promoted by %s to Admin Level %d."playernameadminlevel);
        
SendClientMessage(targetidCOLOR_YELLOWstring);
    }
    if(
PlayerInfo[targetid][Admin] > adminlevel ) {
    
        
format(stringsizeof(string), "You demoted %s to Admin Level %d."targetname);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
format(stringsizeof(string), "* You have been demoted by %s to Admin Level %d."playernameadminlevel);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
    }
    return 
1;

I haven't tried it out. Please reply if you've any problems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)