[Ajuda] Ajuda com comando
#1

Bem estou com um comando aqui queria por ele pra ser usado so com minha pessoa ou seja so com meu nick que e Rollyan



PHP код:
if(strcmp(cmd,"/amudarnick",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /amudarnick [ id ]");
                return 
true;
            }
            new 
playa;
            
playa ReturnUser(tmp);
            
GetPlayerName(playeridsendername256);
            if (
PlayerInfo[playerid][pAdmin] >= 1341)
            {
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        
MudarNickAceito[playa] = 1;
                        
GetPlayerName(playagiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
//format(string, sizeof(string), "Vocк autorizou %s a mudar o nick.", giveplayer);
                        //SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                         
format(stringsizeof(string), "Admin %s: Autorizou vocк a mudar o nick, digite /mudarnick."sendername);
                        
SendClientMessage(playaCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "ADMIN CMD: %s autorizou %s a mudar o nick !",sendername,giveplayer);
                        
ABroadCast(COLOR_LIGHTRED,string,1);
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб autorizado a usar este comando!");
                return 
true;
            }
        }
        return 
true;
    } 
Reply
#2

pawn Код:
new
    Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
if(strcmp(Nome, "Rollyan", false) != 0)
{
    SendClientMessage(playerid, -1, "Apenas Rollyan tem permissгo para isso");
    return 1;
}
Reply
#3

PHP код:
[PHP]
if(
strcmp(cmd,"/amudarnick",true)==0
    { 
        if(
IsPlayerConnected(playerid)) 
        { 
            
tmp strtok(cmdtextidx); 
            if(!
strlen(tmp)) 
            { 
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /amudarnick [ id ]"); 
                return 
true
            }
            new 
Nome[MAX_PLAYER_NAME];
            
GetPlayerName(playeridNomesizeof(Nome));
            if(
strcmp(Nome"Rollyan"false) != 0)
           {
                
SendClientMessage(playerid, -1"Apenas Rollyan tem permissгo para isso");
            return 
1;
            } 
            new 
playa
            
playa ReturnUser(tmp); 
            
GetPlayerName(playeridsendername256); 
            if (
PlayerInfo[playerid][pAdmin] >= 1341
            { 
                if(
IsPlayerConnected(playa)) 
                { 
                    if(
playa != INVALID_PLAYER_ID
                    { 
                        
MudarNickAceito[playa] = 1
                        
GetPlayerName(playagiveplayersizeof(giveplayer)); 
                        
GetPlayerName(playeridsendernamesizeof(sendername)); 
                        
//format(string, sizeof(string), "Vocк autorizou %s a mudar o nick.", giveplayer); 
                        //SendClientMessage(playerid, COLOR_LIGHTBLUE, string); 
                         
format(stringsizeof(string), "Admin %s: Autorizou vocк a mudar o nick, digite /mudarnick."sendername); 
                        
SendClientMessage(playaCOLOR_LIGHTBLUEstring); 
                        
format(stringsizeof(string), "ADMIN CMD: %s autorizou %s a mudar o nick !",sendername,giveplayer); 
                        
ABroadCast(COLOR_LIGHTRED,string,1); 
                    } 
                } 
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб autorizado a usar este comando!"); 
                return 
true
            } 
        } 
        return 
true
    } 
[/PHP]
Reply
#4

Quote:
Originally Posted by yNexus
Посмотреть сообщение
PHP код:
[PHP]
if(
strcmp(cmd,"/amudarnick",true)==0
    { 
        if(
IsPlayerConnected(playerid)) 
        { 
            
tmp strtok(cmdtextidx); 
            if(!
strlen(tmp)) 
            { 
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /amudarnick [ id ]"); 
                return 
true
            }
            new 
Nome[MAX_PLAYER_NAME];
            
GetPlayerName(playeridNomesizeof(Nome));
            if(
strcmp(Nome"Rollyan"false) != 0)
           {
                
SendClientMessage(playerid, -1"Apenas Rollyan tem permissгo para isso");
            return 
1;
            } 
            new 
playa
            
playa ReturnUser(tmp); 
            
GetPlayerName(playeridsendername256); 
            if (
PlayerInfo[playerid][pAdmin] >= 1341
            { 
                if(
IsPlayerConnected(playa)) 
                { 
                    if(
playa != INVALID_PLAYER_ID
                    { 
                        
MudarNickAceito[playa] = 1
                        
GetPlayerName(playagiveplayersizeof(giveplayer)); 
                        
GetPlayerName(playeridsendernamesizeof(sendername)); 
                        
//format(string, sizeof(string), "Vocк autorizou %s a mudar o nick.", giveplayer); 
                        //SendClientMessage(playerid, COLOR_LIGHTBLUE, string); 
                         
format(stringsizeof(string), "Admin %s: Autorizou vocк a mudar o nick, digite /mudarnick."sendername); 
                        
SendClientMessage(playaCOLOR_LIGHTBLUEstring); 
                        
format(stringsizeof(string), "ADMIN CMD: %s autorizou %s a mudar o nick !",sendername,giveplayer); 
                        
ABroadCast(COLOR_LIGHTRED,string,1); 
                    } 
                } 
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб autorizado a usar este comando!"); 
                return 
true
            } 
        } 
        return 
true
    } 
[/PHP]
Obrigado por ter colocado meu cуdigo dentro do comando dele.
Muito ъtil para novatos.
Reply
#5

NOSSA MANO ME AJUDOU MUITO MESMO AGRADEЗO DE CORAЗГO NEXUS E JAURO
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)