Player Connect and disconnect
#6

pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has joined the server", name);
    SendClientMessageToAll(0xAAAAAAAA, string);
}

public OnPlayerDisconnect(playerid, reason)
{
  new pName[MAX_PLAYER_NAME];
  new string[56];
  GetPlayerName(playerid, pName, sizeof(pName));

  switch(reason)
  {
    case 0: format(string, sizeof(string), "%s has left the server. |~Crashed~|", 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(0xAAAAAAAA, string);
}
Reply


Messages In This Thread
Player Connect and disconnect - by Namaco - 25.06.2009, 05:56
Re: Player Connect and disconnect - by abhinavdabral - 25.06.2009, 06:25
Re: Player Connect and disconnect - by Namaco - 25.06.2009, 06:28
Re: Player Connect and disconnect - by abhinavdabral - 25.06.2009, 06:55
Re: Player Connect and disconnect - by Namaco - 25.06.2009, 07:08
Re: Player Connect and disconnect - by dice7 - 25.06.2009, 07:50
Re: Player Connect and disconnect - by abhinavdabral - 25.06.2009, 10:05
Re: Player Connect and disconnect - by Namaco - 25.06.2009, 14:24
Re: Player Connect and disconnect - by dice7 - 25.06.2009, 14:27
Re: Player Connect and disconnect - by Namaco - 25.06.2009, 14:45

Forum Jump:


Users browsing this thread: 1 Guest(s)