OnPlayerConnect - Message to all
#1

Hello,

I wanted to disappear the 'Connected to SERVERNAME' message,
so i made a new forward: ShowMessage(playerid); and i made a
timer in OnPlayerConnect: SetTimer("WelcomeMessage", 300, false);
And this is the public WelcomeMessage(playerid); :
Код:
public WelcomeMessage(playerid)
{
	ClearChat(playerid, 10);
	SendClientMessage(playerid, COLOR_NICEBLUE, "[======================|  |======================]");
	SendClientMessage(playerid, COLOR_WHITE,    "Server Last Update: lalal ");
	SendClientMessage(playerid, COLOR_WHITE,    "Server Version: blabla");
	SendClientMessage(playerid, COLOR_WHITE,    "Server Scripter:bdfd ");
	SendClientMessage(playerid, COLOR_WHITE,    "---------------------------------------------------------------------");
	SendClientMessage(playerid, COLOR_WHITE,    "Welcome to blabla Roleplay.");
	SendClientMessage(playerid, COLOR_WHITE,    "Please /login or /register to enter the server.");
	SendClientMessage(playerid, COLOR_NICEBLUE, "[======================|  |======================]");
}
When there are for example two players online and when another player connects to the
server everyone gets the message.. What did i wrong? the (playerid) is just for one player,
isn't it? How can i fix this problem? Thanks.

K. Regards,
I. C.
Reply
#2

In OnPlayerConnect, use this:

pawn Код:
SetTimerEx("WelcomeMessage", 300, false, "i", playerid);
You need to use SetTimerEx to pass the playerid variable to the timer, or it'll send as 0 to the playerid variable. You also might want to change the timer time, 300 is in milliseconds, if you want to keep it that way, you're better off just putting the client messages directly in OnPlayerConnect.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)