SA-MP Forums Archive
Using @ to chat - 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: Using @ to chat (/showthread.php?tid=529066)



Using @ to chat - Derexi - 31.07.2014

I've searched around for this but to no avail.

I want to create a feature that allows you to send a message using a symbol (for example @ or #), like this:

Typing
Код:
@Hello!
would appear as
Код:
-CHAT- Hello!
in the chat.

Basically the @ or # would be used as a command, as if it were /chat. How would I go about this?


Respuesta: Using @ to chat - IceBilizard - 31.07.2014

I think this will help you
https://sampforum.blast.hk/showthread.php?tid=134865


Re: Using @ to chat - Clad - 31.07.2014

pawn Код:
if(text[0] == '#')
    {
        GetPlayerName(playerid,sendername,sizeof(sendername));

        format(string, sizeof(string), "CHAT:%s (%d): %s", sendername, playerid, text[1]);
        SendClientMessage(COLOR_WHITE, string);
       
        printf("%s: %s",sendername, text[1]);
        return 0;
    }