[Pedido] Chats
#4

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..
}
Reply


Messages In This Thread
Chats - by Blackpine - 26.10.2017, 14:51
Re: Chats - by Don_Speed - 26.10.2017, 17:57
Re: Chats - by Rato22 - 26.10.2017, 18:54
Re: Chats - by Skream - 26.10.2017, 22:41

Forum Jump:


Users browsing this thread: 4 Guest(s)