19.08.2010, 15:22
How To make a text on head when people press Esc And didn't stay in a game
Thks For All Answer
I'm a newbie
Thks For All Answer
I'm a newbie
public OnPlayerDisconnect(playerid, reason)
{
new PlayerName[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
switch (reason) {
case 0: format(str, sizeof(str), "*** %s (ID: %d) has left the server (Timeout).", PlayerName, playerid);
case 1: format(str, sizeof(str), "*** %s (ID: %d) has left the server (Leaving).", PlayerName, playerid);
case 2: format(str, sizeof(str), "*** %s (ID: %d) has left the server (Kicked/Banned).", PlayerName, playerid);
}
SendClientMessageToAll(0xC0C0C0AA, str);
return 1;
}
new AFKTimer[MAX_PLAYERS];
forward OnAfk(playerid);
public OnAfk(playerid)
{
SetPlayerChatBubble(playerid, "AFK", 0xff00ffff, 80, 1000);
}
public OnPlayerUpdate(playerid)
{
KillTimer(AFKTimer[playerid];
AFKTimer[playerid] = SetTimerEx("OnAfk", 2000, 0, "i", playerid)
return 1;
}
SetPlayerChatBubble(playerid, " ", 0xff00ffff, 80, 1000);