Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT \
- By Yiin
- #include <a_samp>
- #define p [playerid]
- new bool: afk[MAX_PLAYERS];
- new afk_skaiciavimas[MAX_PLAYERS];
- new t;
- new zaidejai;
- new Text3D:afk_tekstas[MAX_PLAYERS];
- new afklaikas[MAX_PLAYERS];
- new bool: spawned[MAX_PLAYERS];
- PlayerPause(playerid)
- {
- afk p = true;
- afklaikas p = GetTickCount();
- new txt[32];
- format(txt, 32, "AFK :: %i", ( GetTickCount() - afklaikas p ) / 1000);
- afk_tekstas p = Create3DTextLabel(txt, 0xFF0000FF, 0,0,0,50,-1,1);
- Attach3DTextLabelToPlayer(afk_tekstas p, playerid, 0,0,0.8);
- // Kai nueina į afk.
- }
- PlayerUnPause(playerid)
- {
- afk p = false;
- Delete3DTextLabel(afk_tekstas p);
- // Kai gryžta iš afk.
- }
- PlayerAFK(playerid)
- {
- new txt[32];
- format(txt, 32, "AFK :: %i", ( GetTickCount() - afklaikas p ) / 1000);
- Update3DTextLabelText(afk_tekstas p, 0xFF0000FF, txt);
- }
- public OnFilterScriptInit() return print(" ---:: ` AFK ` "), zaidejai = GetMaxPlayers(), t = SetTimer("AFK", 500, 1), 1;
- public OnPlayerSpawn(playerid) return spawned p = true, 1;
- public OnFilterScriptExit() return KillTimer(t);
- public OnPlayerConnect(playerid) return afk_skaiciavimas p = 0, spawned p = false, 1;
- public OnPlayerUpdate(playerid) return afk_skaiciavimas p = 0, 1;
- forward AFK();
- public AFK()
- for(new i = 0; i < zaidejai; i++)
- if(spawned[i])
- if(afk_skaiciavimas[i] > 15 && !afk[i]) PlayerPause(i);
- else if(!afk_skaiciavimas[i] && afk[i]) PlayerUnPause(i);
- else if(afk_skaiciavimas[i] > 15 && afk[i]) PlayerAFK(i);
- else afk_skaiciavimas[i]++;
Advertisement
Add Comment
Please, Sign In to add comment