SendClientMessage
#1

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); 
Reply
#2

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

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

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); 
Reply
#5

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

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

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

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

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); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)