Joining/Leaving
#1

I looked on the Wiki Page and used the example code but I could not get it to work.

What would be the code so when someone joins the server it says "<name><id> Has joined the server"

And when they join the server it says "Welcome to <server>" to the player connected?

Thanks for any help
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
  new string[128],
    name[MAX_PLAYER_NAME];

  GetPlayerName(playerid,name,sizeof(name);
 
  format(string,sizeof(string),"<%s> <%d> has joined the server",name,playerid);
  SendClientMessageToAll(0xFFFFFFFF,string);
  SendClientMessage(playerid,0xFFFFFFAA,"Welcome to the server!");
  return 1;
}
Reply
#3

Quote:
Originally Posted by Ettans
pawn Код:
SendClientMessage(0xFFFFFFFF,string);
You meant SendClientMessageToAll?
Reply
#4

Yeah, fixed it already. :P
Reply
#5

I used that script without editing and got this:

error 001: expected token: ",", but found ";"

How do I fix that?
Reply
#6

Add ')' behind GetPlayerName(playerid, name, sizeof(name)<HERE>;
Reply
#7

Ah thanks! That worked


How would I go about making the color of the message different?
Reply
#8

Click
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)