SA-MP Forums Archive
Player Text problems - 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: Player Text problems (/showthread.php?tid=340593)



Player Text problems - kamzaf - 07.05.2012

So when I go on my server and type something in the chat box. On my server console it shows the text that was entered:


But when I go on my server the text is not shown:




But when an admin is typing the text is shown:



Any help on that? I chjanged the OnPlayerText Command but no luck.


Re: Player Text problems - Passout - 07.05.2012

Lets see your "onplayertext"


Re: Player Text problems - 2KY - 07.05.2012

You're probably returning 0 if the player is not an administrator.


Re: Player Text problems - kamzaf - 08.05.2012

Quote:

public OnPlayerText(playerid, text[])
{
new msg[128];
format(msg, sizeof(msg), "[%d] %s", playerid, text);
SendPlayerMessageToAll(playerid, msg);
return 0;
}

This is my OnPlayerText

I am using LuxAdmin FS, could there be any thing wrong in that FS that is making my GM corrupted?


EDIT: I just removed LuxAdmin FS and everything went MUCH smoother afterwards. Probably a mix up of commands between scripts.


Re: Player Text problems - Scenario - 08.05.2012

Change this:

Код:
return 0;
to this:

Код:
return 1;
When you "return 0", it means you are stopping the callback from fully funcitoning and since that callback is called each time someone types a message, you need to return something greater than 0. That way, it will finish functioning...


Re: Player Text problems - kamzaf - 08.05.2012

No actually i have to put it return 0; i just took out the LuxAdmin FS and everything worked.

So i probably have to edit the file


Re: Player Text problems - Scenario - 08.05.2012

Quote:
Originally Posted by kamzaf
Посмотреть сообщение
No actually i have to put it return 0; i just took out the LuxAdmin FS and everything worked.

So i probably have to edit the file
Try using "SendClientMessageToAll" instead of "SendPlayerMessageToAll"


Re: Player Text problems - ReneG - 08.05.2012

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Change this:

Код:
return 0;
to this:

Код:
return 1;
When you "return 0", it means you are stopping the callback from fully funcitoning and since that callback is called each time someone types a message, you need to return something greater than 0. That way, it will finish functioning...
I thought returning 0 would simply prevent the traditional sa-mp chat?


Re: Player Text problems - Scenario - 08.05.2012

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
I thought returning 0 would simply prevent the traditional sa-mp chat?
It does.


Re: Player Text problems - SuperViper - 08.05.2012

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Change this:

Код:
return 0;
to this:

Код:
return 1;
When you "return 0", it means you are stopping the callback from fully funcitoning and since that callback is called each time someone types a message, you need to return something greater than 0. That way, it will finish functioning...
He has his own chat code. Returning 0 in OnPlayerText only stops the default SA:MP chat from appearing. Returning 0 isn't always a bad thing.