[Ajuda]Meu /daradmins nao funfa
#1

Aki ele nao seta os playes e nao aprece nada pq ?


PHP код:
    if(strcmp(cmd"/eudoadmin"true) == 0)
    {
        if (
IsPlayerAdmin(playerid))
        {
            if(
IsPlayerConnected(playerid))
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
                    return 
1;
                }
                new 
para1;
                new 
level;
                
para1 ReturnUser(tmp);
                
tmp strtok(cmdtextidx);
                
level strval(tmp);
                if (
PlayerInfo[playerid][pAdmin] == 4999 || IsPlayerAdmin(playerid))
                {
                    if(
IsPlayerConnected(para1))
                    {
                        if(
para1 != INVALID_PLAYER_ID)
                        {
                            
GetPlayerName(para1giveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
PlayerInfo[para1][pAdmin] = level;
                            
printf("|ADMIN|: %s promoveu %s para administrador no nivel %d."sendernamegiveplayerlevel);
                            
format(stringsizeof(string), "Vocк foi promovido a admin, no nнvel %d pelo administrador %s."levelsendername);
                            
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                            
format(stringsizeof(string), "Vocк promoveu %s com nнvel %d."giveplayer,level);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        }
                    }
                }
                    else
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"   Vocк nгo pode usar esse comando!");
                }
            }
            return 
1
Reply
#2

Cade a Funзao De Setar o Level Do Cara ?
Reply
#3

pawn Код:
if(strcmp(cmd, "/eudoadmin", true) == 0)
    {
        if (IsPlayerAdmin(playerid))
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
                    return 1;
                }
                new para1;
                new level;
                para1 = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                level = strval(tmp);
                if (PlayerInfo[playerid][pAdmin] == 4999 || IsPlayerAdmin(playerid))
                {
                    if(IsPlayerConnected(para1))
                    {
                        if(para1 != INVALID_PLAYER_ID)
                        {
                            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            PlayerInfo[para1][pAdmin] = level;
                            printf("|ADMIN|: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level);
                            format(string, sizeof(string), "Vocк foi promovido a admin, no nнvel %d pelo administrador %s.", level, sendername);
                            SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode usar esse comando!");
                }
            }
        }
        else return SendClientMessage(playerid, COLOR_RED, "Voce tem probleminha!!! tem q logar na RCONNNNNNNNNNNNN!!!!!!!!!!!!!!!!!");
        return 1;
    }
Reply
#4

Detalhe:
Quote:

if (IsPlayerAdmin(playerid))

vocк estб logado na rcon? porque para fazer isto й preciso estar ok :P acho que pode ser isto
no codigo nгo hб nada de errado ok

Duvidas: davidchristia@gmail.com
Reply
#5

pawn Код:
if(strcmp(cmd, "/eudoadmin", true) ==0)
{
    if(!IsPlayeradmin(playerid)) return SendClientMessage(playerid, -1," Vocк nгo й um Admin Rcon.");
    if(PlayerInfo[playerid][pAdmin] < = 0) return SendClientMessage(playerid,-1, "Vocк nгo й um Admin");
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1,"USE: /eudoadmin [playerid][level]");
    new lel;
    new outro;
    outro = strval(tmp);
    if(!IsPlayerConnected(outro)) return SendClientMessage(playerid, -1, " Player desconhecido.");
    lel = strval(tmp);
    // if(lel < 0 || level > 5) return SendClientMessage(playerid, -1, "Leveis proibidos."); isso й opcional vocк poderia usar para definir um nivel proibido.
    PlayerInfo[outro][pAdmin] = lel;
    SendClientMessage(playerid, -1 ,"Admin dado com sucesso");
    new strinn[70];
    format(strinn,sizeof(strinn),"Vocк virou admin graзas nivel %d", lel);
    SendClientMessage(outro, -1, strinn);
    return 1;
}
Nгo testei e_e mais se der erro, tu pode voltar e me chingar >< que te ajudo novamente
Reply
#6

PHP код:
    if(strcmp(cmd"/daradmin"true) ==)
    {
        
GetPlayerName(playeridsendername256);
         if (
strcmp(sendername,"Seu_Nome",true)==|| strcmp(sendername,"NomeDo_Amigo",true)==|| strcmp(sendername,"NomeDeOutro_Amigo",true)==0)
         {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /daradmin [ id ] [Level 0 б 1341]");
                return 
true;
            }
            new 
para1;
            new 
level;
            
para1 ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            
level strval(tmp);
            
GetPlayerName(playeridsendername256);
               {
                if(
IsPlayerConnected(para1))
                {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(para1giveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
PlayerInfo[para1][pAdmin] = level;
                        
printf("ADMIN CMD: %s has promoted %s to a level %d admin."sendernamegiveplayerlevel);
                        
format(stringsizeof(string), "   Voce foi promovido para level  %d de Admin - Por %s"levelsendername);
                        
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "   Voce promoveu o(a) %s Para o level %d de Admin."giveplayer,level);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "%s Promoveu %s a adm level %d ",sendername,giveplayer,level);
                    }
                }
                
SendClientMessage(playeridCOLOR_LIGHTGREEN"[ERRO]: Voce nгo esta autorizado a usar este comando!");
            }
        }
        return 
true;
    } 
Reply
#7

Lucas evite ressucitar tуpicos..

04/09/2011

Quase 1 ano jб vei..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)