SA-MP Forums Archive
Chat text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chat text (/showthread.php?tid=327782)



Chat text - Gooday - 22.03.2012

Hello i saw multiple servers having a script:


When you write something it creates your text over your Nametag

Like in this pic but no health bar, The text of hat you say (EX: HEllo it creates a text over you with"Hello")

http://gtat.dracoblue.net/media/ab6b...6af42c2f45.png


Re: Chat text - RicaNiel - 22.03.2012

simple
streamer
and dynamic 3D label
and then with the help of strings and etc..


Re: Chat text - Faisal_khan - 22.03.2012

This may help you:
pawn Код:
#include <a_samp>
#include "../include/gl_common.inc"

#define MESSAGE_COLOR         0xEEEEEEFF
#define ECHO_COLOR            0xEEEEEEFF
#define ACTION_COLOR          0xEE66EEFF

//------------------------------------------------

public OnFilterScriptInit()
{
    print("\n--Goodday chat bubble loaded!\n");
    return 1;
}

//------------------------------------------------

public OnPlayerText(playerid, text[])
{
     if(strlen(text) > 128) return 0;
     
     new to_others[MAX_CHATBUBBLE_LENGTH+1];
     new to_me[MAX_CHATBUBBLE_LENGTH+1];
     
     format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
     format(to_me,MAX_CHATBUBBLE_LENGTH,">> %s",text);
     
     SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
     SendClientMessage(playerid,ECHO_COLOR,to_me);
     
     return 0;
}

//------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new Message[256];
    new idx;
    new actiontext[MAX_CHATBUBBLE_LENGTH+1];

    cmd = strtok(cmdtext, idx);

    // Action command
    if(strcmp("/me", cmd, true) == 0)
    {
        Message = strrest(cmdtext,idx);
        format(actiontext,MAX_CHATBUBBLE_LENGTH,"* %s",Message);
        SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,30.0,10000);
        SendClientMessage(playerid,ACTION_COLOR,actiontext);
        return 1;
    }
   
    return 0;
}

//------------------------------------------------



Re: Chat text - new121 - 22.03.2012

SetPlayerChatBubble