[BIG PROBLEM] Problem with SendClientMessage
#1

Hello guys, i have this:
Код:
#define SCM    SendClientMessage
and when i have a more then 2-3 SCMS in script it wont send it to player..
Like this:
Код:
 	SCM(playerid,-1,""BELA"~ "BPRP"DOBRODOSLI "BELA"~");
 	SCM(playerid,-1," ");
    SCM(playerid,-1,""BPRP"- "BELA"Dobrodosli na -- Community.");
    SCM(playerid,-1,""BPRP"- "BELA"Za krsenje RolePlay pravila, dobija se "MOJA2"BAN/JAIL"BELA"!");
    SCM(playerid,-1,""BPRP"- "BELA"Sada ce Vam biti prikazan kratki tutorial o nasem serveru.");
and here is list of includes:
Код:
#include < a_samp >
#include < foreach >
#include < YSI\y_ini >
#include < YSI\y_commands >
#include < streamer >
#include < sscanf2 >
#include < regex >
#include < progressv2 >
#include < crashdetect >
Reply
#2

what problem ?
Reply
#3

The problem is for some players that SCM is not send to them, like that text up they dont get it...
Reply
#4

What happens if you used it like that?
PHP код:
SendClientMessage(playerid, -1"kthxbai"); 
Reply
#5

Quote:
Originally Posted by PawnHunter
Посмотреть сообщение
What happens if you used it like that?
PHP код:
SendClientMessage(playerid, -1"kthxbai"); 
same...
Reply
#6

I think, in SCM you should write quotation marks inside your message like : \"
Example: (SCM or)SendClientMessage(playerid, color, " blah blah blah \" Ha Ha \" blah blah blah ");
Output in server: blah blah blah " Ha Ha " blah blah blah

Corrected code:
pawn Код:
SCM(playerid,-1,"\"BELA\"~ \"BPRP\"DOBRODOSLI \"BELA\"~");
    SCM(playerid,-1," ");
    SCM(playerid,-1,"\"BPRP\"- \"BELA\"Dobrodosli na -- Community.");
    SCM(playerid,-1,"\"BPRP\"- \"BELA\"Za krsenje RolePlay pravila, dobija se \"MOJA2\"BAN/JAIL\"BELA\"!");
    SCM(playerid,-1,"\"BPRP\"- \"BELA\"Sada ce Vam biti prikazan kratki tutorial o nasem serveru.");
Reply
#7

You need to escape the quotation marks (\") if the text in the double quotes are actual text, as so (dark blue highlight):



If they are hexadecimal colors, go with:

pawn Код:
#define COL_WHITE "{FFFFFF}"
#define COL_YELLOW "{FFFF00}"


"Test "#COL_WHITE" %s "#COL_YELLOW"."
Reply
#8

Personally, don't use SCM, in my eyes I consider it lazy scripting. Second, it's like
SendClientMessage(playerid, COLOR_HERE, "Hello world!");

So for example

Код HTML:
CMD:hi(playerid) {
	SendClientMessage(playerid, COLOR_HERE, "Hello!");
	return 1;
}
Reply
#9

Quote:
Originally Posted by Kevln
Посмотреть сообщение
You need to escape the quotation marks (\") if the text in the double quotes are actual text, as so (dark blue highlight):



If they are hexadecimal colors, go with:

pawn Код:
#define COL_WHITE "{FFFFFF}"
#define COL_YELLOW "{FFFF00}"


"Test "#COL_WHITE" %s "#COL_YELLOW"."
Tnx that solution worked for me, REP+

@kamiliuxliuxliux - u got REP+ too mate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)