Command /asay help me please
#3

Quote:
Originally Posted by BulletRaja
Посмотреть сообщение
you can make it like this
PHP код:
CMD:asay(playeridparams[])
{
 new 
text[128],string[128], tmp2[33];
 if(
sscanf(params"ss[128]"tmp2text)) return SendClientMessage(playerid,-1"Use: /asay [color] [message]");
 if(
strlen(tmp2) < || strlen(tmp2) > 30) return SendClientMessage(playeridCOLOR_RED"Error: The color should be between 3 and 30 characters.");
 
format(stringsizeof(string),"Admin %s: {%s}%s"Name(playerid), tmp2text);
 
SendClientMessageToAll(-1,string);
 return 
1;

00FF00 = Light Green
008800 = Dark Green
FF0000 = Red
CBCBCB = Grey
you can check color codes on w3school
/asay 00FF00 [message]

hope it work
Whaaaaaaaat the fuck. Did you tested your code before posting it? Plus do you know that color are integer?

First, your code can be optimized by using isnull which check if a string is empty or no. If you want to add some color to your text, check that : https://sampwiki.blast.hk/wiki/Colors_List#Color_embedding
PHP код:
CMD:asay(playeridparams[])
{
    new 
string[128];
    if(
isnull(params)) return SendClientMessage(playerid,-1"Use: /asay [message]");
    
format(stringsizeof(string),"Admin %s: %s"Name(playerid), text);
    
SendClientMessageToAll(-1,string);
    return 
1;

Reply


Messages In This Thread
Command /asay help me please - by SapMan - 29.03.2018, 05:46
Re: Command /asay help me please - by BulletRaja - 29.03.2018, 06:08
Re: Command /asay help me please - by Dayrion - 29.03.2018, 06:55
Re: Command /asay help me please - by SapMan - 29.03.2018, 15:04
Re: Command /asay help me please - by ivndosos - 29.03.2018, 15:20
Re: Command /asay help me please - by Lokii - 29.03.2018, 15:39
Re: Command /asay help me please - by SapMan - 29.03.2018, 16:02
Re: Command /asay help me please - by rfr - 29.03.2018, 16:06
Re: Command /asay help me please - by SyS - 29.03.2018, 16:09
Re: Command /asay help me please - by Dayrion - 29.03.2018, 16:31

Forum Jump:


Users browsing this thread: 3 Guest(s)