SA-MP Forums Archive
[Pedido] Chats - 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: [Pedido] Chats (/showthread.php?tid=643744)



Chats - Blackpine - 26.10.2017

Olб eu queria tipo um sisteminha de chat aki pequeno e simples ensinando como criar chat tipo digito "Olб" normalzinho t "Olб" ae aparece tipo "Blackpine [Local]: Olб" ae aparece pra todo mundo perto do player e outro queria que eu digitase @Olб ae aparece assim "@Global "Blackpine: Olб" aparecer isso pra geral do servidor entende todo mundo
se alguem poder me ajudar procurei tutoriais e nгo achei entгo vim pedir ajuda de vocкs


Re: Chats - Don_Speed - 26.10.2017

https://sampwiki.blast.hk/wroot/index.ph...&printable=yes


Re: Chats - Rato22 - 26.10.2017

Explique-me mais.


Re: Chats - Skream - 26.10.2017

pawn Код:
public OnPlayerText(playerid, text[]) {
    new
        pname[MAX_PLAYER_NAME],
        pcolor = GetPlayerColor(playerid),
        str[128];
       
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
   
    format(str, sizeof(str), "%s [Local] diz: {ffffff}%s", pname, text);
   
    new
        Float:x,
        Float:y,
        Float:z;
       
    GetPlayerPos(playerid, x, y, z);
   
    foreach(new i : Player) {
        //
        // 30.0 й o range que a mensagem alcanзa
        // streamedin й para ter certeza que estгo no mesmo interior/vw
        if(IsPlayerStreamedIn(playerid, i) && IsPlayerInRangeOfPoint(i, 30.0, x, y, z)) {
            SendClientMessage(i, pcolor, str);
        }
    }
   
    //
    // OnPlayerText deve retornar 0 para anular o chat padrгo do sa-mp
    return 0;
}
pra fazer o global chat vc usa SendClientMessageToAll e verifica se

pawn Код:
if(text[0] == '@' && text[1]) { // checa se hб continuidade apуs o @
    SendClientMessageToAll..
}