Need Help About Text
#1

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
Reply
#2

pawn Код:
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;
}
I hope this helps you.
Reply
#3

pawn Код:
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;
}
Could work. OnPlayerUpdate isn't called when players aren't active (Alt-tabbed or on the ESC menu)
Reply
#4

Oh, he means this. I thought he ment with "didnt stay in game" the the player leaves. -_-
Reply
#5

Thanks It Can use ^^
Reply
#6

SetPlayerChatBubble(playerid, "AFK", 0xff00ffff, 80, 1000);

in this line it will show AFK about 1 second and disappear so i change it into 60000 so it will show about 1 minute

but when people come into game it still show AFK until 1 minute. how can i change it when people come into game it will disappear automaically
Reply
#7

anyone can help me ??
Reply
#8

pawn Код:
SetPlayerChatBubble(playerid, " ", 0xff00ffff, 80, 1000);
under OnPlayerUpdate.
Reply
#9

Quote:
Originally Posted by BP13
Посмотреть сообщение
pawn Код:
SetPlayerChatBubble(playerid, " ", 0xff00ffff, 80, 1000);
under OnPlayerUpdate.
yes it can use but the message when you talking will disappear too
Reply
#10

Quote:
Originally Posted by xinix000
Посмотреть сообщение
yes it can use but the message when you talking will disappear too
Maybe you should use it in a bool and use if's to check if you are afk or not and if it returns true then do it and if not don't do the code posted.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)