Need help with chat commands. [+REP] -
Biggy54 - 28.09.2014
Alright, I need help with creating a local chat command.
Please use <a_samp>. Thanks alot.
Re: Need help with chat commands. [+REP] -
SWGamer - 29.09.2014
Hello this uses an Include known as Local Chat
Its made by Goudewup.
Heres the include
http://pastebin.com/f12af5060
And heres how to use it.An Example:
Код:
public OnPlayerText(playerid,text[])
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s: %s", name, text);
SendLocalMessage(playerid, COLOR_WHITE, 7,string);// Send the message
return 0; // Makes sure the original message isn't send
}
Or If you really want to use a_samp.
Use this.
https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius
Re: Need help with chat commands. [+REP] -
Biggy54 - 29.09.2014
Thanks, but. I need something like an OOC local chat command.
something like
/say [text]
It should be sent like '((Biggy)) says/said [text] '
Help please.
Re: Need help with chat commands. [+REP] -
SWGamer - 29.09.2014
https://sampforum.blast.hk/showthread.php?tid=279575
This should do the trick.
Re: Need help with chat commands. [+REP] -
Josh_Main - 29.09.2014
Here you are
pawn Код:
CMD:asay(playerid, params[])
{
new message[128], string[128], talker;
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, GREY, "USAGE: /asay [text]");
GetPlayerName(playerid, talker, sizeof(talker))
format(string, sizeof(string), "(( %s says: %s ))", talker, message);
SendClientMessageToAll(0xffffff, string);
return 1;
}
Re: Need help with chat commands. [+REP] -
MeCom - 29.09.2014
Above post is correct but i would like to post the link of
THIS tutorial so you can make your own chatting commands in future.
Re: Need help with chat commands. [+REP] -
Biggy54 - 29.09.2014
Quote:
Originally Posted by Josh_Main
Here you are
pawn Код:
CMD:asay(playerid, params[]) { new message[128], string[128], talker; if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, GREY, "USAGE: /asay [text]"); GetPlayerName(playerid, talker, sizeof(talker)) format(string, sizeof(string), "(( %s says: %s ))", talker, message); SendClientMessageToAll(0xffffff, string); return 1; }
|
I need the same code but with <a_samp>
Re: Need help with chat commands. [+REP] -
DavidBilla - 29.09.2014
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/say",true,4))
{
if(!cmdtext[4]) return SendClientMessage(playerid,-1,"USAGE:/say [text]");
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name))
format(string, sizeof(string), "(( %s)) says: %s ", name, cmdtext[5]);
return SendClientMessageToAll(0xffffff, string);
}
return 1;
}
guess it'll work
Re: Need help with chat commands. [+REP] -
Biggy54 - 29.09.2014
Код:
error 001: expected token: ";", but found "-identifier-"
i got this
Re: Need help with chat commands. [+REP] -
YanLanger - 29.09.2014
Trying to fix :P hard lol (I'm new scripter)