[Ajuda] quando digita /daradmin meu FS desliga
#1

Quando eu digito /daradmin todos os Comandos do meu FS para de funfar queria saber porque


COD;
PHP код:
    if(strcmp(cmd"/daradmin"true) == || strcmp(cmd"/daradmin"true) == 0)
    {
        
tmp strtok(cmdtextidx);
        
giveplayerid strval(tmp);
        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
        
PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), "level");
        
giveplayerid strval(tmp);
        if (
PlayerInfo[playerid][pAdmin] >= 7)
        {
            
SendClientMessage(playeridCOLOR_GRAD1"[USO]: /daradmin [ID/Nick][Level ADM]");
            return 
1;
        }
        
tmp strtok(cmdtextidx);
        if (
PlayerInfo[playerid][pAdmin] >= 7)
        {
            
SendClientMessage(playeridCOLOR_GRAD1"[USO]: /daradmin [ID/Nick][Level ADM]");
            return 
1;
        }
        
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
        
level[playerid] = strval(tmp);
        if(
level[playerid] < 0)
        {
            
SendClientMessage(playerid0x980000AA"[ERRO] o Level de ADM й invalido");
            return 
1;
        }
        if(
level[playerid] > 7)
        {
            
SendClientMessage(playerid0x980000AA"[ERRO] Level de ADM invalido.!");
            return 
1;
        }
        if(
level[playerid] == PlayerInfo[giveplayerid][pAdmin])
        {
            
format(stringsizeof(string), "Este player ja tem level %d de admin!"level[playerid]);
            
SendClientMessage(playeridCOLOR_BLUEstring);
            return 
1;
        }
        if(
logged[playerid] == 1)
        {
            if(
IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 7)
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
logged[giveplayerid] == 0)
                    {
                        
SendClientMessage(playeridCOLOR_RED"[ERRO] O player tem que estar logado para poder receber o level de admin!");
                        return 
1;
                    }
                    else
                    {
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
dini_IntSet(udb_encode(giveplayer), "level"level[playerid]);
                        
format(stringsizeof(string), "Vocк deu para %s level %d de admin!"giveplayerlevel[playerid]);
                        
SendClientMessage(playeridCOLOR_BLUEstring);
                        
format(stringsizeof(string), "Vocк,%s, foi setado Administrador (level %d) pelo admin %s "giveplayer ,level[playerid], sendername);
                        
SendClientMessage(giveplayeridCOLOR_BLUEstring);
                        
PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), "level");
                        new 
PlayerName[30];
                        
GetPlayerName(playeridPlayerName30);
      
printf("[Command] %s usou /setadmin para dar par %s level %d de admin."PlayerNamegiveplayerlevel[playerid]);
                    }
                }
                else
                {
                    
format(stringsizeof(string), "%d nгo й o nъmero de ID de um player ativo!"giveplayerid);
                    
SendClientMessage(playeridCOLOR_REDstring);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"[ERRO] Vocк nгo tem permissгo para usar este comando!");
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_RED"[ERRO] Vocк tem que estar logado para usar este comando!");
        }
        return 
1;
    } 
Reply
#2

Sim no meu tbm mas nao й apenas o /daradmin que bugou foi varios comandos.
Reply
#3

pawn Код:
if(strcmp(cmdtext,"/daradmin",true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Use /DarAdmin [ID][AdminLevel]");
    new admin = strval(tmp);
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Use /DarAdmin [ID][AdminLevel]");
    new adminlevel = strval(tmp);
    if(adminlevel < valorminimo || adminlevel > valormaximo) return SendClientMessage(playerid,-1,"Level de admin invбlido.");
    new name[MAX_PLAYER_NAME];
    new name2[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    GetPlayerName(admin,name2,sizeof(name2));
    new string[128];
    format(string,sizeof(string),"%s Promoveu %s Para Level %d de Admin!"name,name2,adminlevel);
    SendClientMessageToAll(GetPlayerColor(admin),string);
    PlayerInfo[admin][pAdmin] = adminlevel;//troque isto pela variavel equivalente a do seu sistema de admin
    return 1;
}
Tente isto.

PS: Troque valorminimo e valormaximo pelo nivel minimo e maximo de admin
Ex:
pawn Код:
if(adminlevel < 1 || admilevel > 10)
Reply
#4

Seu FS ? Certeza, me parace um antigo FS de um Server de Facзгo!
Reply
#5

Valeu Pedro_Miranda Ajudou e Muito Resolvido


Nake01
Esse й o AdminHelp Digo meu no modo de falar.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)