Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <onplayerpause>
- //// AFK systemas darytas Vygio.
- //// Special thanks FireCatui už includą
- #define FILTERSCRIPT
- //////////////
- new Text3D:labelis1[MAX_PLAYERS];
- new laikmatisafk[MAX_PLAYERS];
- new afklaikas[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Automatinė AFK sistema įjungta.");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n----------------------------------");
- print(" Automatinė AFK sistema išjungta.");
- print("----------------------------------\n");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- ///afk
- KillTimer(laikmatisafk[playerid]);
- afklaikas[playerid] = 0;
- Delete3DTextLabel(labelis1[playerid]);
- return 1;
- }
- forward afklaikas1(playerid);
- public afklaikas1(playerid)
- {
- afklaikas[playerid] ++;
- new afklabelioupdateas[64];
- format(afklabelioupdateas,sizeof(afklabelioupdateas),"{FFFFFF}[AFK] {33AA33}%d {FFFFFF}Sec.",afklaikas[playerid]);
- Update3DTextLabelText(labelis1[playerid], 0xFFFFFFFF, afklabelioupdateas);
- return 1;
- }
- forward OnPlayerPause(playerid);
- public OnPlayerPause(playerid)
- {
- laikmatisafk[playerid] = SetTimerEx("afklaikas1", 1000, true, "i", playerid);
- labelis1[playerid] = Create3DTextLabel("[AFK]", 0xFFFFFFFF, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(labelis1[playerid], playerid, 0.0, 0.0, 0.4);
- return 1;
- }
- forward OnPlayerUnpause(playerid);
- public OnPlayerUnpause(playerid)
- {
- KillTimer(laikmatisafk[playerid]);
- afklaikas[playerid] = 0;
- Delete3DTextLabel(labelis1[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment