[PEDIDO] /Admins
#1

Eu sei que varias pessoas ja devem ter pedido isso xD, mais eu procurei atй o fim do mundo tanto no Search quanto no ****** e nгo achei, entгo poderiam me dizer como faзo o Comando /Admins para todos os players, e mostra todos os Admins logados na Rcon. Agradeзo por tudo deis de ja
Reply
#2

pawn Код:
if(strcmp(cmdtext,"/admins",true)==0)
{
    new string[128];
    SendClientMessage(playerid,0x00CD00FF,"Admins online");
    for(new i;i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                new name[24];
                GetPlayerName(i,name,sizeof(name));
                format(string,sizeof(string),"Nome: %s [ID: %i]",name,i);
                SendClientMessage(playerid,0x0000FFFF,string);
            }
        }
    }
    return 1;
}
Testa ai
Reply
#3

7 Erros xD

pawn Код:
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(59) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(60) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(73) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(102) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(563) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(566) : error 021: symbol already defined: "SendClientMessage"
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(567) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(569) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(571) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(574) : error 021: symbol already defined: "GetPlayerName"
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(580) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(585) : warning 203: symbol is never used: "name"
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(585) : warning 203: symbol is never used: "string"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
Linhas dos erros 219:

pawn Код:
59: new string[128];
60: new name[24];

73: new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];

102: new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
Reply
#4

Tenta apagar o new string e o new name do meu comando
Reply
#5

5 Erros ainda :/

pawn Код:
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(563) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(566) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(568) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(570) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(578) : error 010: invalid function or declaration
Reply
#6

tenta
pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
    SendClientMessage(playerid, 0x00CD00FF, "(INFO) Checando por administradores on-line...");
    new count=0;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                new str[128];
                new pname[24];
                GetPlayerName(i, pname, 24);
                format(str, 128, "Nome: [%s] | [ID: %d] ", pname, playerid);
                SendClientMessage(playerid, -1, str);
                count++;
            }
        }
    }
}
Reply
#7

5 Erros tbm:

pawn Код:
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(73) : warning 219: local variable "pname" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(102) : warning 219: local variable "pname" shadows a variable at a preceding level
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(563) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(567) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(569) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(571) : error 010: invalid function or declaration
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(575) : error 021: symbol already defined: "GetPlayerName"
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(584) : warning 203: symbol is never used: "count"
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(584) : warning 203: symbol is never used: "pname"
C:\Documents and Settings\Hwak v1\Meus documentos\MyServer (STAP)\Server\gamemodes\hwakworld.pwn(584) : warning 203: symbol is never used: "str"
Reply
#8

pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0)
{
    new Jogador[24];
    new count = 0;
    new msg[120];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            GetPlayerName(i,Jogador,24);
            format(msg,sizeof(msg),"Nome: [%s] | ID: [%d]", Jogador,playerid);
            SendClientMessage(playerid, 0x000FFFAA, msg);
            count++;
        }
    }
    if(count == 0)
    {
        SendClientMessage(playerid, -1, "Nгo tem nenhum adm online agora!");
    }
    return 1;
}
Tenta agora lol
Reply
#9

Quote:
Originally Posted by [LF]PlaYer
Посмотреть сообщение
tenta
pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
    SendClientMessage(playerid, 0x00CD00FF, "(INFO) Checando por administradores on-line...");
    new count=0;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                new str[128];
                new pname[24];
                GetPlayerName(i, pname, 24);
                format(str, 128, "Nome: [%s] | [ID: %d] ", pname, playerid);
                SendClientMessage(playerid, -1, str);
                count++;
            }
        }
    }
}
Vocк nгo sabe o que й return nгo?

pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
    SendClientMessage(playerid, 0x00CD00FF, "(INFO) Checando por administradores on-line...");
    new count = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            new str[70], pname[MAX_PLAYER_NAME];
            GetPlayerName(i, pname, 24);
            format(str, 70, "Nome: [%s] | [ID: %d] ", pname, playerid);
            SendClientMessage(playerid, -1, str);
            count++;
        }
    }
    if(count == 0) {
        SendClientMessage(playerid, -1, "Sem admins online.");     
    }
    return 1;  
}
Reply
#10

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
Vocк nгo sabe o que й return nгo?

pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
    SendClientMessage(playerid, 0x00CD00FF, "(INFO) Checando por administradores on-line...");
    new count = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            new str[70], pname[MAX_PLAYER_NAME];
            GetPlayerName(i, pname, 24);
            format(str, 70, "Nome: [%s] | [ID: %d] ", pname, playerid);
            SendClientMessage(playerid, -1, str);
            count++;
        }
    }
    if(count == 0) {
        SendClientMessage(playerid, -1, "Sem admins online.");     
    }
    return 1;  
}
esse cod nгo й meu , '-'
tirei do Andre Admin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)