SendClientMessageEx - 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: SendClientMessageEx (
/showthread.php?tid=497782)
SendClientMessageEx -
mirou123 - 28.02.2014
Hello.If someone types a long message it won't show up or it will only show cut off.So what I am trying to do is to create a custom function that will send that long message in two sections using two SendClientMessage's.This code I made is not working very well,sometimes only the second message show up and sometimes it will write the last bit of the first part twice.I hope you can help me.
Код:
SendClientMessageEx(playerid, color, string[])
{
if(strlen(string) >= 128)
{
SendClientMessage(playerid, color, string);
strdel(string, 0, 128);
SendClientMessage(playerid, color, string);
}
else SendClientMessage(playerid, color, string);
return 1;
}
Re: SendClientMessageEx -
Kirollos - 28.02.2014
Hi there, strdel deletes the part of text, you can use
strmid which extracts a part of text from a string.
pawn Код:
SendClientMessageEx(playerid, color, string[])
{
if(strlen(string) >= 128)
{
new partone[129], parttwo[129];
strmid(partone, string, 0, 128);
strmid(parttwo, string, 128, strlen(string));
SendClientMessage(playerid, color, partone);
SendClientMessage(playerid, color, parttwo);
}
else
SendClientMessage(playerid, color, string);
return 1;
}
Re : SendClientMessageEx -
mirou123 - 01.03.2014
Thanks +rep'ed