SA-MP Forums Archive
[Ajuda] #Define CmdText '-' - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] #Define CmdText '-' (/showthread.php?tid=327418)



[Ajuda] #Define CmdText '-' - CaioMiglioli - 21.03.2012

Editei um comando pra adm e agora tб pedindo pra mim Definir "cmdtext"

Cуdigo:
PHP код:
dcmd_vercmds(playeridparams[])
{
    
#pragma unused params
    
for(new i=0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerAdmin(i)){
    new 
stringcmd[256];
    new 
playa[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplaya,MAX_PLAYER_NAME);
    
format(stringcmd256"O jogador %s Id:%d Digitou o Comando: %s"playa,playerid,cmdtext);
    
SendClientMessage(i,0xFFFFFFAAstringcmd);
    }
    }
    return 
1;

A msg do compilador:

PHP код:
D:\Documents and Settings\HOME-PC\Meus documentos\server-teste\gamemodes\adrenaline.pwn(2183) : error 017undefined symbol "cmdtext"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

Como posso resolver isso?


Re: [Ajuda] #Define CmdText '-' - Kmatsu - 21.03.2012

tente assim
pawn Код:
dcmd_vercmds(playerid, params[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i)){
    new stringcmd[256];
    new playa[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playa,MAX_PLAYER_NAME);
    format(stringcmd, 256, "O jogador %s Id:%d Digitou o Comando: %s", playa,playerid,params);
    SendClientMessage(i,0xFFFFFFAA, stringcmd);
    }
    }
    return 1;
}



Re: [Ajuda] #Define CmdText '-' - Lуs - 21.03.2012

pawn Код:
dcmd_vercmds(playerid, params[])
{
    #pragma unused params
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo й admin.");
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        new stringcmd[256];
        new playa[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playa,MAX_PLAYER_NAME);
        format(stringcmd, 256, "O jogador %s Id:%d Digitou o Comando: /vercmds", playa,playerid);
        SendClientMessage(i,0xFFFFFFAA, stringcmd);
    }
    return 1;
}



Re: [Ajuda] #Define CmdText '-' - CaioMiglioli - 21.03.2012

Quote:
Originally Posted by Kmatsu
Посмотреть сообщение
tente assim
pawn Код:
dcmd_vercmds(playerid, params[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i)){
    new stringcmd[256];
    new playa[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playa,MAX_PLAYER_NAME);
    format(stringcmd, 256, "O jogador %s Id:%d Digitou o Comando: %s", playa,playerid,params);
    SendClientMessage(i,0xFFFFFFAA, stringcmd);
    }
    }
    return 1;
}
Atй compilou tudo, mais o comando sу funcionou na hora que digitei o comando, dae parou de funcionar '-'


Re: [Ajuda] #Define CmdText '-' - DarkScripter - 21.03.2012

pawn Код:
// Topo:

new bool: Read = false;

// Na public: OnPlayerCommandPerformed(playerid, cmdtext[], success) caso nao tiver crie uma.
if(Read)
{
    new strcmd[128], pl[24]; GetPlayerName(playerid, pl, 24);
    for(new i, e = GetMaxPlayers(); i != e; ++i)
    {
        if(IsPlayerAdmin(i))
        {
            format(strcmd, sizeof(strcmd), "O jogador %s Id:%d Digitou o Comando: /vercmds", playa,playerid);
            SendClientMessage(i, -1, strcmd);
        }
    }
}


// qualquer lugar do gm
dcmd_vercmds(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"No es ademir");
    if(Read) SendClientMessage(playerid, -1,"VER COMANDOS: Deslgiado");
    if(!Read)   SendClientMessage(playerid, -1,"VER COMANDOS: Ligado");
   
    Read = !Read;
    return true;
}