SA-MP Forums Archive
SendClientMessage - 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: SendClientMessage (/showthread.php?tid=651210)



SendClientMessage - Zeus666 - 15.03.2018

Hi. Can you fix my code pls? I want only "Trial Admin" to be shown as lightblue.

PHP код:
        SendClientMessage(playerid, -1" - Comenzi Administrator - ");
        
format(strsizeof(str),"*COL_LIGHTBLUE*Trial Admin: /o(oc), /acmds, /info, /getcar, /cc, /wslap\n
        "
*COL_LIGHTBLUETrial Admin: /a, /gethere, /spec, /specoff, /goto, /gotols, /gotolv, /gotosf\n
        
"*COL_LIGHTBLUE* Trial Admin: /mute, /unmute, /kick, /clearanim");
          
SendClientMessage(playerid,-1str); 



Re: SendClientMessage - iKarim - 15.03.2018

You need to insert another colour, say white, after Trial Admin: to colour the reset differently.


Re: SendClientMessage - Zeus666 - 15.03.2018

Yea but my code is giving me errors, it's not correct, i need to put some brackets i think, idk.


Re: SendClientMessage - iKarim - 15.03.2018

Yeah I see. You didn't use the colours definition correctly, it should be used outside of the string and there's no need of asterisks.

PHP код:
SendClientMessage(playerid, -1" - Comenzi Administrator - ");  
format(strsizeof(str),""COL_LIGHTBLUE"Trial Admin:{FFFFFF} /o(oc), /acmds, /info, /getcar, /cc, /wslap\n"COL_LIGHTBLUE" Trial Admin:{FFFFFF} /a, /gethere, /spec, /specoff, /goto, /gotols, /gotolv, /gotosf\n"COL_LIGHTBLUE" Trial Admin:{FFFFFF} /mute, /unmute, /kick, /clearanim");  
SendClientMessage(playerid,-1str); 



Re: SendClientMessage - Zeus666 - 15.03.2018

Quote:
Originally Posted by iKarim
Посмотреть сообщение
Yeah I see. You didn't use the colours definition correctly, it should be used outside of the string and there's no need of asterisks.

PHP код:
SendClientMessage(playerid, -1" - Comenzi Administrator - "); 
format(strsizeof(str),""COL_LIGHTBLUE"Trial Admin:{FFFFFF} /o(oc), /acmds, /info, /getcar, /cc, /wslap\n""COL_LIGHTBLUE" Trial Admin:{FFFFFF} /a, /gethere, /spec, /specoff, /goto, /gotols, /gotolv, /gotosf\n""COL_LIGHTBLUE" Trial Admin:{FFFFFF} /mute, /unmute, /kick, /clearanim"); 
SendClientMessage(playerid,-1str); 
(9575) : error 001: expected token: "-string end-", but found "-identifier-"
(9575) : error 017: undefined symbol "Trial"
9575) : error 017: undefined symbol "FFFFFF"
(9575) : fatal error 107: too many error messages on one line


Re: SendClientMessage - iKarim - 15.03.2018

Retry the code I just edited my post, sorry I typed that on the forum post, didn't notice the extra quote mark.


Re: SendClientMessage - Zeus666 - 15.03.2018

Now it doesn't show the str in game, shall i incrase the size of str?

edit: I increased it, still doesn't show.


Re: SendClientMessage - AdamsLT - 15.03.2018

The message you are trying to send is too long for SendClientMessage. You can't send more than 144 characters but you are trying to send 255.

Split it into several messages. One of these should work:

PHP код:
SendClientMessage(playerid, -1" - Comenzi Administrator - ");  
format(strsizeof(str),"Trial Admin:{FFFFFF} /o(oc), /acmds, /info, /getcar, /cc, /wslap");
SendClientMessage(playeridCOL_LIGHTBLUEstr);  
format(strsizeof(str),"Trial Admin:{FFFFFF} /a, /gethere, /spec, /specoff, /goto, /gotols, /gotolv, /gotosf");
SendClientMessage(playeridCOL_LIGHTBLUEstr);  
format(strsizeof(str),"Trial Admin:{FFFFFF} /mute, /unmute, /kick, /clearanim");  
SendClientMessage(playeridCOL_LIGHTBLUEstr); 
or

PHP код:
SendClientMessage(playerid, -1" - Comenzi Administrator - ");   
format(strsizeof(str),""#COLOR_LIGHTBLUE"Trial Admin:{FFFFFF} /o(oc), /acmds, /info, /getcar, /cc, /wslap"); 
SendClientMessage(playerid,-1str);   
format(strsizeof(str),""#COLOR_LIGHTBLUE" Trial Admin:{FFFFFF} /a, /gethere, /spec, /specoff, /goto, /gotols, /gotolv, /gotosf"); 
SendClientMessage(playerid,-1str);   
format(strsizeof(str),""#COLOR_LIGHTBLUE"Trial Admin:{FFFFFF} /mute, /unmute, /kick, /clearanim");   
SendClientMessage(playerid,-1str);