Set Admin Level command
#1

How to make a set admin level command, but in strcmp ?
Reply
#2

what admin system are you using?
Reply
#3

PHP код:
if(strcmp(cmd"/makeadmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 99998)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /makeadmin [playerid/PartOfName] [level]");
                    return 
1;
                }
                new 
para1;
                new 
level;
                
para1 ReturnUser(tmp);
                
tmp strtok(cmdtextidx);
                
level strvalEx(tmp);
                if(
IsPlayerConnected(para1))
                {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(para1giveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
PlayerInfo[para1][pAdmin] = level;
                        
printf("Info: %s has promoted %s to a level %d admin."sendernamegiveplayerlevel);
                        
format(stringsizeof(string), "   You have been promoted to a level %d admin by %s"levelsendername);
                        
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "   You have promoted %s to a level %d admin."giveplayer,level);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
            }
        }
        return 
1;
    } 
Done.
Reply
#4

I have errors:

Код:
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(144) : error 017: undefined symbol "tmp"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(144) : error 017: undefined symbol "idx"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(145) : error 017: undefined symbol "tmp"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(147) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(152) : error 017: undefined symbol "tmp"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(153) : error 017: undefined symbol "tmp"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(153) : error 017: undefined symbol "idx"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(154) : error 017: undefined symbol "strvalEx"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(159) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(159) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(159) : error 029: invalid expression, assumed zero
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\reg syst.pwn(159) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Errors.
Reply
#5

PHP код:
if(strcmp(cmd"/makeadmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 99998)
            {
                new 
idx;
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /makeadmin [playerid/PartOfName] [level]");
                    return 
1;
                }
                new 
para1;
                new 
level;
                new 
tmp[256];
                new 
strvalEx;
                new 
giveplayer[MAX_PLAYER_NAME];
                
para1 ReturnUser(tmp);
                
tmp strtok(cmdtextidx);
                
level strvalEx(tmp);
                if(
IsPlayerConnected(para1))
                {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(para1giveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
PlayerInfo[para1][pAdmin] = level;
                        
printf("Info: %s has promoted %s to a level %d admin."sendernamegiveplayerlevel);
                        
format(stringsizeof(string), "   You have been promoted to a level %d admin by %s"levelsendername);
                        
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "   You have promoted %s to a level %d admin."giveplayer,level);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                }
            }
        }
        return 
1;
    } 
Sry if i forgot something
Reply
#6

EDIT: Removed
Reply
#7

EDIT: Removed
Reply
#8

Now only : error 017: undefined symbol "strvalEx"
Reply
#9

PHP код:
if(strcmp(cmd"/makeadmin"true) == 0
    { 
        if(
IsPlayerConnected(playerid)) 
        { 
            if(
PlayerInfo[playerid][pAdmin] >= 99998
            { 
                new 
idx
                
tmp strtok(cmdtextidx); 
                if(!
strlen(tmp)) 
                { 
                    
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /makeadmin [playerid/PartOfName] [level]"); 
                    return 
1
                } 
                new 
para1
                new 
level
                new 
tmp[256]; 
                new 
giveplayer[MAX_PLAYER_NAME]; 
                
para1 ReturnUser(tmp); 
                
tmp strtok(cmdtextidx); 
                
level strval(tmp); 
                if(
IsPlayerConnected(para1)) 
                { 
                    if(
para1 != INVALID_PLAYER_ID
                    { 
                        
GetPlayerName(para1giveplayersizeof(giveplayer)); 
                        
GetPlayerName(playeridsendernamesizeof(sendername)); 
                        
PlayerInfo[para1][pAdmin] = level
                        
printf("Info: %s has promoted %s to a level %d admin."sendernamegiveplayerlevel); 
                        
format(stringsizeof(string), "   You have been promoted to a level %d admin by %s"levelsendername); 
                        
SendClientMessage(para1COLOR_LIGHTBLUEstring); 
                        
format(stringsizeof(string), "   You have promoted %s to a level %d admin."giveplayer,level); 
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring); 
                    } 
                } 
            } 
        } 
        return 
1
    } 
Please this should work
Reply
#10

yes this work thanks a lot +REP : )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)