SA-MP Forums Archive
Joining/Leaving - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Joining/Leaving (/showthread.php?tid=125980)



Joining/Leaving - jesuschristlordandsavior - 06.02.2010

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


Re: Joining/Leaving - ettans - 06.02.2010

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;
}



Re: Joining/Leaving - Correlli - 06.02.2010

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


Re: Joining/Leaving - ettans - 06.02.2010

Yeah, fixed it already. :P


Re: Joining/Leaving - jesuschristlordandsavior - 06.02.2010

I used that script without editing and got this:

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

How do I fix that?


Re: Joining/Leaving - ¤Adas¤ - 06.02.2010

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


Re: Joining/Leaving - jesuschristlordandsavior - 06.02.2010

Ah thanks! That worked


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


Re: Joining/Leaving - DeathOnaStick - 06.02.2010

Click