open.mp forum
[Pawn] Message separator issue - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Message separator issue (/showthread.php?tid=1939)



Message separator issue - unix - 2021-04-24

Hello,



I am having an issue with the code below - it only works once for one player which has the ascending player id - for other it will just bug out and send out 2 dots ".." completely not doing the work as previously for the asc. player id.



Code:
stock SendMessageToPlayer(playerid, color, text[], len = 124)

{

new

? ? text2[ 256 ],

maxstring = 384;



if(strlen(text) > len)

{

? ? strmid(text2, text, len, maxstring);

? ? strdel(text, len, maxstring);

? ? strins(text, " ..", len, maxstring);

? ? strins(text2, ".. ", 0, maxstring);

? ? SendClientMessage(playerid, color, text);

? ? SendClientMessage(playerid, color, text2);

? ? return 1;

}

else return SendClientMessage(playerid, color, text);

}