[Ajuda] sobre um cmd.
#1

Gente, como ficaria esse comando aki sу que sу para admins logado na rcon? й que eu nao tenho esses leveis de adm, sу rcon e pronto..

pawn Код:
if(!strcmp(cmdtext, "/adm", true)) // By Leo
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado !");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    Delete3DTextLabel(label[playerid]);
                    SetPlayerArmour(playerid, 99999);
                    SetPlayerHealth(playerid, 99999);
                    label[playerid] = Create3DTextLabel("Administrador: Posso ajudar?!",0xFFFF00AA,10.0,40.0,10.0,20.0,0);
                    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
                    SetPlayerSkin(playerid, 217);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s entrou do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s saiu do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                    Delete3DTextLabel(label[playerid]);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um admin !");
                return 1;
            }
        }
        return 1;
    }
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/adm", true)) // By Leo
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado !");
                return 1;
            }
            if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado na RCON!");
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    Delete3DTextLabel(label[playerid]);
                    SetPlayerArmour(playerid, 99999);
                    SetPlayerHealth(playerid, 99999);
                    label[playerid] = Create3DTextLabel("Administrador: Posso ajudar?!",0xFFFF00AA,10.0,40.0,10.0,20.0,0);
                    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
                    SetPlayerSkin(playerid, 217);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s entrou do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s saiu do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                    Delete3DTextLabel(label[playerid]);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um admin !");
                return 1;
            }
        }
        return 1;
    }
Reply
#3

IsPlayerAdmin....

Shick. 5 a cada 5 seg.
Reply
#4

Shick n deu certo..
Reply
#5

O que nгo deu certo?
Estб tudo ok sу fiz adicionar o comando :S
Reply
#6

masp q vc deixou akeles " ==> 1 ? "
Reply
#7

Olб Felipe_Wesker, pelo que percebi vocк quer colocar este comando para que administradores normais nгo possam usar, apenas logados na rcon... Se й isso, aqui estб:
pawn Код:
if(!strcmp(cmdtext, "/adm", true)) // By Leo
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado !");
                return 1;
            }
            if( IsPlayerAdmin( playerid )
            {
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    Delete3DTextLabel(label[playerid]);
                    SetPlayerArmour(playerid, 99999);
                    SetPlayerHealth(playerid, 99999);
                    label[playerid] = Create3DTextLabel("Administrador: Posso ajudar?!",0xFFFF00AA,10.0,40.0,10.0,20.0,0);
                    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
                    SetPlayerSkin(playerid, 217);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s entrou do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s saiu do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                    Delete3DTextLabel(label[playerid]);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um administrador logado na RCON !");
                return 1;
            }
        }
        return 1;
    }
Reply
#8

Nao deu, deu 13 erros :S
Reply
#9

pawn Код:
if(!strcmp(cmdtext, "/adm", true)) // By Leo
{
 if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado !");
 if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado na RCON!");
 if(AdminDuty[playerid] == 0)
 {
  AdminDuty[playerid] = 1;
  Delete3DTextLabel(label[playerid]);
  SetPlayerArmour(playerid, 99999);
  SetPlayerHealth(playerid, 99999);
  label[playerid] = Create3DTextLabel("Administrador: Posso ajudar?!",0xFFFF00AA,10.0,40.0,10.0,20.0,0);
  Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
  SetPlayerSkin(playerid, 217);
  SetPlayerColor(playerid,TEAM_HIT_COLOR);
  GetPlayerName(playerid, sendername, sizeof(sendername));
  format(string, sizeof(string), "|ADMIN|: [ID:%d] %s entrou do serviзo de admin.", playerid, sendername);
  ABroadCast(COLOR_YELLOW,string,1);
 }
 else if(AdminDuty[playerid] == 1)
 {
  AdminDuty[playerid] = 0;
  SetPlayerArmour(playerid, 0);
  SetPlayerHealth(playerid, 100);
  SetPlayerColor(playerid,TEAM_HIT_COLOR);
  GetPlayerName(playerid, sendername, sizeof(sendername));
  format(string, sizeof(string), "|ADMIN|: [ID:%d] %s saiu do serviзo de admin.", playerid, sendername);
  ABroadCast(COLOR_YELLOW,string,1);
  Delete3DTextLabel(label[playerid]);
  return 1;
 }
 return 1;
}
Reply
#10

pawn Код:
if(!strcmp(cmdtext, "/adm", true)) // By Leo
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк precisa estar logado !");
                return 1;
            }
            if(IsPlayerAdmin(playerid))
            {
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    Delete3DTextLabel(label[playerid]);
                    SetPlayerArmour(playerid, 99999);
                    SetPlayerHealth(playerid, 99999);
                    label[playerid] = Create3DTextLabel("Administrador: Posso ajudar?!",0xFFFF00AA,10.0,40.0,10.0,20.0,0);
                    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
                    SetPlayerSkin(playerid, 217);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s entrou do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "|ADMIN|: [ID:%d] %s saiu do serviзo de admin.", playerid, sendername);
                    ABroadCast(COLOR_YELLOW,string,1);
                    Delete3DTextLabel(label[playerid]);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um administrador logado na RCON !");
            }
        }
        return 1;
    }
Tenta agora ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)