Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- // AFK System by </Signature> //
- ////////////////////////////////////////////////////////////////////////////////
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- ////////////////////////////////////////////////////////////////////////////////
- new pName[24];
- new string[128];
- new string2[128];
- new Mute[128];
- new PlayerAFK[MAX_PLAYERS];
- ////////////////////////////////////////////////////////////////////////////////
- public OnFilterScriptInit()
- {
- print("\n-----------------------------------------------------------");
- print(" Filterscript: AFK System je uspjesno ucitana.");
- print("-----------------------------------------------------------\n");
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------------------------");
- print(" Filterscript: AFK System je ucitana bez problema.");
- print("--------------------------------------------------------\n");
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnPlayerConnect(playerid)
- {
- PlayerAFK[playerid] = 0;
- }
- ////////////////////////////////////////////////////////////////////////////////
- CMD:afklist(playerid, params[])
- {
- new string3[MAX_PLAYER_NAME], AFKIgraci[MAX_PLAYER_NAME];
- for(new pID = 0; pID < MAX_PLAYERS; pID ++)
- {
- if(IsPlayerConnected(pID))
- {
- if(PlayerAFK[pID] == 1)
- {
- SendClientMessage(playerid, 0xB00000FF, "** AFK IGRACI **");
- GetPlayerName(playerid, AFKIgraci, sizeof(AFKIgraci));
- format(string3, sizeof(string3), "%s", AFKIgraci);
- SendClientMessage(playerid, 0xFFFFFFFF, string3);
- }
- }
- }
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- CMD:afk(playerid, params[])
- {
- if(PlayerAFK[playerid] == 0)
- {
- TogglePlayerControllable( playerid, 0);
- GetPlayerName(playerid, pName, 24);
- format(string, 128, "** AFK: {FFFFFF}Igrac %s je otisao {B00000}AFK.", pName);
- SendClientMessageToAll( 0xB00000FF, string);
- PlayerAFK[playerid] = 1;
- }
- else return SendClientMessage(playerid, 0xB00000FF, "ERROR: {FFFFFF}Trenutno ste vec AFK.");
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- CMD:back(playerid, params[])
- {
- if(PlayerAFK[playerid] == 1)
- {
- TogglePlayerControllable(playerid,1);
- GetPlayerName(playerid, pName, 24);
- format(string2, 128, "** AFK: {FFFFFF}Igrac %s vise nije {B00000}AFK.", pName);
- SendClientMessageToAll( 0xB00000FF, string2 );
- PlayerAFK[playerid] = 0;
- }
- else return SendClientMessage(playerid, 0xB00000FF, "ERROR: {FFFFFF}Trenutno niste AFK.");
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnPlayerDisconnect(playerid)
- {
- PlayerAFK[playerid] = 0;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnPlayerText(playerid, text[])
- {
- if(PlayerAFK[playerid] == 1)
- format(Mute, 128, "ERROR: {FFFFFF}Niste u mogucnosti pisati jer ste AFK !");
- SendClientMessage(playerid, 0xB00000FF, Mute);
- return 0;
- }
- ////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement