Iae Pessoal beleza? aqui esta um tutorial que encontrei hoje mais cedo como coloca sistema de chat proximo espero que seja util
No começo do GameMode:
#define COLOUR_CHATPROX 0x00FFFFFF
Como Usar:
; para falar no Chat Proximo
public OnPlayerText(playerid, text[])
{
No Final do gamemode
No começo do GameMode:
#define COLOUR_CHATPROX 0x00FFFFFF
Como Usar:
; para falar no Chat Proximo
public OnPlayerText(playerid, text[])
{
- Codigo:
- new chat[128]; format(chat, sizeof(chat), "%s",text);
if(text[0] == ';'){ChatProximo(playerid, COLOUR_CHATPROX, text[1]);return 0;}
No Final do gamemode
- Codigo:
- stock ChatProximo(playerid, color, const string[])
{
new output[128], pNameX[MAX_PLAYER_NAME],outadm[128],rawstring[128];
GetPlayerName(playerid, pNameX, sizeof(pNameX));
format(output, sizeof(output), "CHAT PROXIMO By : Leo_Gangster >> %s: [ID: %i]: %s", pNameX, playerid, string);
format(rawstring, sizeof(rawstring), "%s",string);
new Float:PosX, Float:PosY, Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
format(outadm, sizeof(outadm), "CHAT PROXIMO >> %s: [ID: %i]: %s", pNameX,playerid,string);
for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i)){
if(CallRemoteFunction("GetPlayerAdminLevel","i",i) >= 4){
if(!IsPlayerInRangeOfPoint(i, 20.0, PosX, PosY, PosZ)){
SendClientMessage(i, 0xFF9900AA, outadm);}}}}
for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i)){
if(IsPlayerInRangeOfPoint(i, 20.0, PosX, PosY, PosZ)){
SendClientMessage(i, color, output);
PlayerPlaySound(i,1057,0.0,0.0,0.0);}}}
SetPlayerChatBubble(playerid, rawstring, COLOUR_CHATPROX, 20.0, 10000);
return 1;
}