[Ajuda] Cargo Admin!
#1

Olб! eu criei uns cargos de acordo com o level de admin. Porem na hora de testar,simplesmente nao aparece nd.

eu coloquei no comeзo da GM:

PHP код:
CargoAdmin(playerid)
{
    new var[
17];
    switch(
CallRemoteFunction("GetPlayerAdminLevel","i",playerid))
    {
        case 
1: var = "Ajudante";
        case 
3: var = "Moderador(a)";
        case 
4: var = "Administrador(a)";
        case 
5: var = "Staff";
    }
    return var;
}/ 
e para testar coloquei no cmd do ban isso aqui:

PHP код:
format(string,sizeof(string),"| GNC-Admin | O(A) %s %s baniu o(a) jogador(a) %s ( Motivo: %s )",CargoAdmin(playerid),adminname,playername,params[2],day,month,year); 
e na hora de testar apareceu "| GNC-Admin | O(A) Dean baniu o(a) jogador(a) Player1 ( Motivo: %s )" fazendo assim nгo aparecendo o cargo,no caso eu era level 2 quando testei.entt deveria aparecer "Moderador(a) baniu o(a)..." Alguem poderia me ajudar?


CMD COMPELTO DO BAN:

PHP код:
dcmd_ban(playerid,params[]) {
    if(
PlayerInfo[playerid][LoggedIn] == 1)
    {
        if(
PlayerInfo[playerid][Level] >= 2)
        {
            new 
tmp[256], tmp2[256], Indextmp strtok(params,Index), tmp2 strtok(params,Index);
            if(!
strlen(params)) return SendClientMessage(playeridred"| ERRO | Digite: /Ban [ID] [Motivo]");
            if(!
strlen(tmp2)) return SendClientMessage(playeridred"| ERRO | Coloque um Motivo!");
            new 
player1playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[800], string2[800];
            
player1 strval(tmp);
            if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) )
            {
                if(
PlayerInfo[player1][Level] >= && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"| ERRO | Vocк nгo pode banir um Admin!");
                if(!
IsNumeric(tmp)) return SendClientMessage(playerid,red,"| ERRO | ID invalido.");
                
GetPlayerName(player1playernamesizeof(playername)); GetPlayerName(playeridadminnamesizeof(adminname));
                new 
year,month,day,hour,minuite,secondgetdate(yearmonthday); gettime(hour,minuite,second);
                
CMDMessageToAdmins(playerid,"Ban");
                
format(string,sizeof(string),"| GNC-Admin | O(A) %s %s baniu o(a) jogador(a) %s ( Motivo: %s )",CargoAdmin(playerid),adminname,playername,params[2],day,month,year);
                
format(string2,sizeof(string2),"| BAN-LOG | O(A) Admin %s baniu o(a) jogador(a) %s Motivo: (%s)",adminname,playername,params[2],day,month,year,hour,minuite);
                new 
bani2[980];
                
format(bani2,sizeof(bani2),"| INFO | Vocк baniu o(a) jogador(a) %s ( Motivo: %s ) - ( %d/%d/%d )",playername,params[2],day,month,year);
                
SendClientMessage(playerid,0x00BFFFFF,bani2);
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                
SendClientMessageToAll(vermelho,string);
                
SaveToFile("BanLog",string2);
                print(string);
                if(
udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1dUserSetINT(PlayerName2(player1)).("banned",1);
                
format(string,sizeof(string),"Banido pelo Administrador %s ( Motivo: %s )"adminnameparams[2] );
                
//BanNotify(player1);
                
                
new bani[900];
                
format(bani,sizeof(bani),"| BAN | Vocк foi banido(a) do nosso servidor pelo motivo ' %s ' ",params[2]);
                
SendClientMessage(player1,-1,bani);
                
SendClientMessage(player1COR_BRANCO"| BAN | Se vocк acha que foi banido(a) injustamente, tire uma print ( F8 ) desse banimento!");
                
SendClientMessage(player1COR_BRANCO"| BAN | Peзa revisгo em nosso fуrum ( www.servercss.net ) seguindo todas as regras de postagem!");
                
SendClientMessage(player1COR_BRANCO"| BAN | E aguarde a Administraзгo resolver seu Caso!");
                
TogglePlayerControllable(player1,false);
                
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
                
GameTextForPlayer(player1,"~r~BANIDO!",100000000,3);
                
                new 
stringg[400];
                
format(stringg,sizeof(stringg),"%d/%d/%d",day,month,year);
                
dUserSet(PlayerName2(player1)).("ban_data",stringg);
                
dUserSet(PlayerName2(player1)).("ban_admin",PlayerName2(playerid));
                
dUserSet(PlayerName2(player1)).("ban_motivo",params[2]);
                return 
SetTimerEx("DelayedBan"1000false"d"player1);
            }
            else return 
SendClientMessage(playeridred"| ERRO | Jogador(a) nгo conectado(a) ou й vocк mesmo ou admin de alto Nivel.");
        }
        else return 
SendClientMessage(playerid,red,"| ERRO | Comando Invalido!  /Comandos");
    }
    else return 
SendClientMessage(playerid,red,"| ERRO | Voce deve estar logado para usar estes comandos");

Obg a quem ajudar! ^^
Reply


Messages In This Thread
Cargo Admin! - by CSSDean - 25.04.2018, 14:57
Re: Cargo Admin! - by ipsLuan - 25.04.2018, 15:00
Re: Cargo Admin! - by CSSDean - 25.04.2018, 15:03

Forum Jump:


Users browsing this thread: 1 Guest(s)