on player login
#4

Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
}

#endif

public OnPlayerConnect(playerid)
{
  new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string, sizeof(string), "%s has joined the server", pname);
  SendClientMessageToAll(0x0689ffff, string);
  return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
  new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  switch(reason)
  {
    case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
    case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
    case 2: format(string, sizeof(string), "%s has left the server. (Kicked/banned)", pname);
  }
  SendClientMessageToAll(0x0689ffff, string);
  return 1;
}
Worked good. Try this
Reply


Messages In This Thread
on player login - by marine - 17.01.2010, 23:11
Re: on player login - by kmzr - 18.01.2010, 01:08
Re: on player login - by marine - 18.01.2010, 03:01
Re: on player login - by deather - 18.01.2010, 10:39
Re: on player login - by Correlli - 18.01.2010, 10:41
Re: on player login - by [HiC]TheKiller - 18.01.2010, 10:49
Re: on player login - by marine - 18.01.2010, 16:25
Re: on player login - by marine - 18.01.2010, 18:01
Re: on player login - by KnooL - 18.01.2010, 18:05

Forum Jump:


Users browsing this thread: 1 Guest(s)