26.05.2013, 19:16
Joining Message:
Now join text done.
Leave Message:
If you want to make 1 more case you can do like this , EXAMPLE:
Hope it worked
Код:
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(0xAAAAAAAA, string); return 1; }
Leave Message:
Код:
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)", pname); } SendClientMessageToAll(0xAAAAAAAA, 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)", pname); case 3: format(string, sizeof(string), "%s has left the server. (Relogging)", pname); } SendClientMessageToAll(0xAAAAAAAA, string); return 1; }