SA-MP Forums Archive
[AJUDA] Comando bugado - 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] Comando bugado (/showthread.php?tid=229568)



[AJUDA] Comando bugado - [AF]Junior - 21.02.2011

pawn Код:
if(strcmp(cmd, "/avisar", true) == 0 || strcmp(cmd, "/av", true) == 0)
    {
new string[256];
new sendername[MAX_PLAYER_NAME];
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][PlayerAdmin] == 0)
            {
                SendClientMessage(playerid, COLOR_RED, "Vocк nгo й Administrador!");
                return 1;
            }
        GetPlayerName(playerid, Pname, sizeof(Pname));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_RED, "USE: /av [texto]");
                return 1;
            }
            SendClientMessageToAll(COLOR_WHITE, "|______________ Aviso da Administraзгo [TAG] ______________|");
            format(string, sizeof(string), "{FF0000}Administrador %s: %s", sendername, result);
        }
        return 1;
    }
Quando dou /avisar nгo aparece o texto meu sу o Aviso da Administraзгo [TAG]...

Como arrumo isso?


Re: [AJUDA] Comando bugado - steki. - 21.02.2011

pawn Код:
SendClientMessageToAll(COLOR_WHITE, "|______________ Aviso da Administraзгo [TAG] ______________|");
            format(string, sizeof(string), "{FF0000}Administrador %s: %s", sendername, result);
            SendClientMessageToAll(COLOR_WHITE, string);

Vocк ajunta as str e nгo envia? Cabeзгo


Re: [AJUDA] Comando bugado - ManoLexuS - 21.02.2011

Lol, acho que abaixo do format й necessario conter o SendClientMessage nй?
SendClientMessageToAll(COR, string);

ou

SendClientMessage(playerid, COR, string);

Espero ter ajudado.


Re: [AJUDA] Comando bugado - [AF]Junior - 21.02.2011

pawn Код:
C:\Documents and Settings\Luciano\Desktop\Gaming of Life - Gang War\filterscripts\Register_Login.pwn(544) : error 017: undefined symbol "sendername"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
E eu coloquei

pawn Код:
new sendername;
no topo e funcionou sem nenhum problema, vai dar pau nй?

@aк porra funcionou \o


Re: [AJUDA] Comando bugado - junioor - 22.02.2011

pawn Код:
new sendername[MAX_PLAYER_NAME];