Guest User

afk sistemele

a guest
Aug 25th, 2012
1,683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.65 KB | None | 0 0
  1. #include <a_samp>
  2. #include <onplayerpause>
  3. //// AFK systemas darytas Vygio.
  4. //// Special thanks FireCatui už includą
  5.  
  6.  
  7. #define FILTERSCRIPT
  8. //////////////
  9. new Text3D:labelis1[MAX_PLAYERS];
  10. new laikmatisafk[MAX_PLAYERS];
  11. new afklaikas[MAX_PLAYERS];
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print(" Automatinė AFK sistema įjungta.");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     print("\n----------------------------------");
  24.     print(" Automatinė AFK sistema išjungta.");
  25.     print("----------------------------------\n");
  26.     return 1;
  27. }
  28. public OnPlayerDisconnect(playerid, reason)
  29. {
  30.     ///afk
  31.     KillTimer(laikmatisafk[playerid]);
  32.     afklaikas[playerid] = 0;
  33.     Delete3DTextLabel(labelis1[playerid]);
  34.     return 1;
  35. }
  36. forward afklaikas1(playerid);
  37. public afklaikas1(playerid)
  38. {
  39.     afklaikas[playerid] ++;
  40.     new afklabelioupdateas[64];
  41.     format(afklabelioupdateas,sizeof(afklabelioupdateas),"{FFFFFF}[AFK] {33AA33}%d {FFFFFF}Sec.",afklaikas[playerid]);
  42.     Update3DTextLabelText(labelis1[playerid], 0xFFFFFFFF, afklabelioupdateas);
  43.     return 1;
  44. }
  45. forward OnPlayerPause(playerid);
  46. public OnPlayerPause(playerid)
  47. {
  48.     laikmatisafk[playerid] = SetTimerEx("afklaikas1", 1000, true, "i", playerid);
  49.     labelis1[playerid] = Create3DTextLabel("[AFK]", 0xFFFFFFFF, 30.0, 40.0, 50.0, 40.0, 0);
  50.     Attach3DTextLabelToPlayer(labelis1[playerid], playerid, 0.0, 0.0, 0.4);
  51.     return 1;
  52. }
  53. forward OnPlayerUnpause(playerid);
  54. public OnPlayerUnpause(playerid)
  55. {
  56.     KillTimer(laikmatisafk[playerid]);
  57.     afklaikas[playerid] = 0;
  58.     Delete3DTextLabel(labelis1[playerid]);
  59.     return 1;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment