OnPlayerText - 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: OnPlayerText (
/showthread.php?tid=344683)
OnPlayerText -
MechaTech - 22.05.2012
Hey i have a problem, i have a code so i can see my (id) while i am chatting, but if i type something i will get 2 messages.
http://imageshack.us/f/201/samp007wo.png/
And the code:
pawn Код:
public OnPlayerText(playerid, text[])
{
new textstring[128];
format(textstring, sizeof(textstring), "(%i) %s", playerid, text);
SendPlayerMessageToAll(playerid, textstring);
return 1;
}
Re: OnPlayerText -
ReneG - 22.05.2012
Returning 0 under OnPlayerText gets rid of the default SA-MP chat, and shows the one you scripted only.
pawn Код:
public OnPlayerText(playerid, text[])
{
new textstring[128];
format(textstring, sizeof(textstring), "(%i) %s", playerid, text);
SendPlayerMessageToAll(playerid, textstring);
return 0; // this
}
Re: OnPlayerText -
MechaTech - 22.05.2012
Thanks it worked.