Player Text problems
#1

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.
Reply
#2

Lets see your "onplayertext"
Reply
#3

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

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.
Reply
#5

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...
Reply
#6

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
Reply
#7

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"
Reply
#8

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?
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)