Need help with chat commands. [+REP]
#1

Alright, I need help with creating a local chat command.
Please use <a_samp>. Thanks alot.
Reply
#2

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
Reply
#3

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.
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=279575
This should do the trick.
Reply
#5

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;
}
Reply
#6

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

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>
Reply
#8

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
Reply
#9

Код:
error 001: expected token: ";", but found "-identifier-"
i got this
Reply
#10

Trying to fix :P hard lol (I'm new scripter)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)