When a player join the server...
#1

Hi, I just added this codes...It shows to the player a Joining Message

Код:
new Text:Intro1, Text:Intro2, Text:Intro3;
Код:
Intro1 = TextDrawCreate(323, 124, "- ToX Gang Wars 2.8 -");
 	TextDrawLetterSize(Intro1, 0.8, 2.28);
 	TextDrawFont(Intro1, 3);
 	TextDrawSetOutline(Intro1, 1);
	TextDrawBackgroundColor(Intro1, 0x000000FF);
	TextDrawColor(Intro1, 0xFF3300FF);
	TextDrawAlignment(Intro1, 2);
	TextDrawSetProportional(Intro1, 1);
	TextDrawTextSize(Intro3,150.0,440.0);
 	TextDrawUseBox(Intro1, 1);
	TextDrawBoxColor(Intro1, 0x000000FF);
	TextDrawHideForAll(Intro1);

	Intro2 = TextDrawCreate(323, 155, "To play clean, you need to follow this rules:~n~~n~~w~No hacking/moding/cheating~n~Be respectful to all~n~No impersonating or spamming~n~No teamkilling or spawnkilling~n~No flaming/racism~n~No excessive driveby or helikill~n~~n~Type /rules for more!");
	TextDrawLetterSize(Intro2, 0.4, 1.26);
	TextDrawFont(Intro2, 1);
	TextDrawColor(Intro2, 0xFF3300FF);
	TextDrawAlignment(Intro2, 2);
	TextDrawSetProportional(Intro2, 1);
	TextDrawTextSize(Intro2,230.0,440.0);
 	TextDrawUseBox(Intro2, 1);
	TextDrawBoxColor(Intro2, 0x00000099);
	TextDrawHideForAll(Intro2);

	Intro3 = TextDrawCreate(323, 280, "failure to comply will result in a kick/ban");
	TextDrawLetterSize(Intro3, 0.4, 1.26);
	TextDrawFont(Intro3, 3);
	TextDrawSetOutline(Intro3, 1);
	TextDrawBackgroundColor(Intro3, 0x000000FF);
	TextDrawAlignment(Intro3, 2);
	TextDrawSetProportional(Intro3, 1);
	TextDrawColor(Intro3, 0xFF3300FF);
	TextDrawTextSize(Intro3,150.0,440.0);
 	TextDrawUseBox(Intro3, 1);
	TextDrawBoxColor(Intro3, 0x000000FF);
	TextDrawHideForAll(Intro3);
Код:
stock SendJoinMessage(playerid)
{
	if(!IsPlayerConnected(playerid)) { return 1; }

	new string[256], name[MAX_PLAYER_NAME], ip[20];
	GetPlayerName(playerid, name, sizeof(name));
	GetPlayerIp(playerid, ip, sizeof(ip));

	for(new i=0; i<MAX_PLAYERS; i++) {
		if(IsPlayerConnected(i) && playerid != i) {
		  if(IsAdmin(i) >= 5) {
		  	format(string,sizeof(string),"*** %s (%d) joined the server. (%s)",name, playerid, ip);
			}
			else {
			  format(string,sizeof(string),"*** %s (%d) joined the server.",name, playerid);
			}
			SendClientMessage(i,COLOR_WHITE,string);
		}
	}
	return 1;
}
I have no problem at the compiling.
But when a player join the server, this won't show up.
What else I need to code?
And btw, my teams aren't yet configured, I am not sure if that affect.
Thanks for helping!
Reply
#2

Where does "SendJoinMessage" get called?
Reply
#3

Quote:
Originally Posted by MenaceX^
Where does "SendJoinMessage" get called?
I thought this will send the message to the players...

I added this too:
Код:
public OnPlayerConnect(playerid)
{
  OnPlayerConnect_TW(playerid);
  
  SendJoinMessage(playerid);
  SetPlayerColor(playerid,COLOR_WHITE);
  GivePlayerMoney(playerid,500);
  
	return 1;
}
That's the matter I had to define that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)