[Ajuda] ativar comando chat local
#1

ae gente meu gm ta sem o comando /f chat local aquem tem os codes para ativalo fico grato!
Reply
#2

Que tal vocК criб-los!!

seria uma boa nй, uma vez que nгo tem no gm, nгo tem com "ativar" digamos assim.. teria que fazer. portanto. maonamassa! ^^
Reply
#3

e mano se eu tivese esperiencia e panw ate que dava ne
Reply
#4

pawn Код:
if(!strcmp(cmd, "/f", true))
    {
        new tmp[128];
        strmid(tmp, cmdtext, 3, strlen(cmdtext), 128);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "/f [texto]");
        new Float:diegox,Float:diegoy,Float:diegoz;
        format(tmp, sizeof(tmp), "|»»| Chat Prуximo |««| %s: %s", PlayerName(playerid), tmp);
        GetPlayerPos(playerid, diegox, diegoy, diegoz);
        for(new diego; diego < MAX_PLAYERS; diego++)
        {
            if(IsPlayerInRangeOfPoint(diego, 10.0, diegox, diegoy, diegoz))
            {
                SendClientMessage(diego, COLOR_RED, tmp);
            }
        }
        return 1;
    }
Reply
#5

Carinha cima tudo copiado, apenas fazer isso.

pawn Код:
if(!strcmp(cmdtext, "/f", true))
    {
        strdel(cmdtext,0,3);
        if(!strlen(cmdtext)) return SendClientMessage(playerid, -1, "/f [texto]");
        static Float:x,Float:y,Float:z,i;
        i = 0;
        GetPlayerPos(playerid, x, y, z);
        format(cmdtext, 128 , "|Chat local %s: %s",pegarnome(playerid),cmdtext);
        for(; i < MAX_PLAYERS; ++i)
        {
            if(!IsPlayerInRangeOfPoint(i, 50.0, x, y, z)) continue;
            SendClientMessage(i, -1, cmdtext);
        }
        return 1;
    }

pegarnome(p)
{
  static nome[24];
  GetPlayerName(p,nome,sizeof nome);
  return nome;
}
Reply
#6

Fiz o comando para vocк :


pawn Код:
if(!strfind(cmdtext, "/f", true))
    {
        if(cmdtext[2] == 0 || cmdtext[2] == 32)
        {
            if(cmdtext[2] != 32 || (cmdtext[3] == 0 && cmdtext[2] == 32))   return SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /f [texto]");
            new Float:P_Pos[3];
            new NickName[25];
            GetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
            GetPlayerName(playerid, NickName, 25);
            format(cmdtext, 129, "[Local] %s diz: %s", NickName, cmdtext[3]);
            for(new x = 0, y = GetMaxPlayers(); x != y; x++)
            {
                if(!IsPlayerInRangeOfPoint(x, 10.0, P_Pos[0], P_Pos[1], P_Pos[2]))  continue;
                SendClientMessage(x, 0xFFFFFFAA, cmdtext);
            }
            return true;
        }
    }


Espero ter ajudado .
Reply
#7

tentei colocar no final do gm o code e deu esse erro:
Код:
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(29311) : warning 219: local variable "anim" shadows a variable at a preceding level
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(29317) : warning 219: local variable "anim" shadows a variable at a preceding level
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30501) : error 010: invalid function or declaration
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30503) : error 010: invalid function or declaration
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30505) : error 010: invalid function or declaration
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30508) : error 021: symbol already defined: "GetPlayerPos"
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30511) : error 010: invalid function or declaration
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30513) : error 010: invalid function or declaration
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30516) : error 010: invalid function or declaration
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30519) : warning 203: symbol is never used: "NickName"
C:\DOCUME~1\Vitor\Desktop\SERVID~1\GAMEMO~1\EXPRPG.pwn(30519) : warning 203: symbol is never used: "P_Pos"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
-----------------------------------------EDIT----------------------------
rjjjj vlw pelo code fis funcionar vlw!
Reply
#8

Nгo e no final da GM e no OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)