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



Set Admin Level command - IvancheBG - 16.09.2012

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


Re: Set Admin Level command - BadgerLedger - 16.09.2012

what admin system are you using?


Re: Set Admin Level command - Sig Hansen - 16.09.2012

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.


Re: Set Admin Level command - IvancheBG - 16.09.2012

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.



AW: Set Admin Level command - BiosMarcel - 16.09.2012

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


Re: AW: Set Admin Level command - clarencecuzz - 16.09.2012

EDIT: Removed


AW: Set Admin Level command - BiosMarcel - 16.09.2012

EDIT: Removed


Re: Set Admin Level command - IvancheBG - 16.09.2012

Now only : error 017: undefined symbol "strvalEx"


AW: Set Admin Level command - BiosMarcel - 16.09.2012

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


Re: Set Admin Level command - IvancheBG - 16.09.2012

yes this work thanks a lot +REP : )