SA-MP Forums Archive
Need Help About Text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help About Text (/showthread.php?tid=169414)



Need Help About Text - xinix000 - 19.08.2010

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


Re: Need Help About Text - Jeffry - 19.08.2010

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.


Re: Need Help About Text - Hiddos - 19.08.2010

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)


Re: Need Help About Text - Jeffry - 19.08.2010

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


Re: Need Help About Text - xinix000 - 19.08.2010

Thanks It Can use ^^


Re: Need Help About Text - xinix000 - 19.08.2010

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


Re: Need Help About Text - xinix000 - 20.08.2010

anyone can help me ??


Re: Need Help About Text - BP13 - 20.08.2010

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


Re: Need Help About Text - xinix000 - 20.08.2010

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


Re: Need Help About Text - BP13 - 20.08.2010

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.