[HELP] Include Messup - i'm sick of it
#5

Try this:

pawn Код:
#include <a_samp>
#include <YSI\y_hooks>

#define GetPlayerAFKToggle(%0) \
            AFKing[%0]

new bool:AFKing[MAX_PLAYERS char];
forward OnPlayerAFK(playerid);

/*
native TogglePlayerAFK(playerid, toggle);
native GetPlayerAFK(playerid);
*/


#if defined _FILTERSCRIPT_
     hook roAFK_OnFilterScriptInit()
     {
         print("Your filterscript is using RollTi's Afficient AFK v1.0");
         SetTimer("eOnPlayerAFK", 300000, true);
     }
#else
     hook roAFK_OnGameModeInit()
     {
         print("Your gamemode is using RollTi's Afficient AFK v1.0");
     }
#endif

stock TogglePlayerAFK(playerid, bool:toggle)
{
    static Float:hp; GetPlayerHealth(playerid, hp);
    if(!toggle)
    {
        TogglePlayerControllable(playerid, true);
        SetPlayerHealth(playerid, hp);
        KillTimer(AFKTimer[playerid]);
        AFKing{playerid} = true;

    }
    if(toggle == true)
    {
        SetPlayerHealth(playerid, 9999999.9);
        TogglePlayerControllable(playerid, 0);
        AFKing{playerid} = true;
    }
    return 1;
}

eOnPlayerAfk(); public eOnPlayerAfk()
{
    for(new i, e = GetMaxPlayers(); i != e; ++i){
        if(IsPlayerConnected(i)) {
            if(AFKing{i}){
                CallLocalFunction("OnPlayerAFK", "i", i);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] Include Messup - i'm sick of it - by RollTi - 26.04.2012, 00:42
Re: [HELP] Include Messup - i'm sick of it - by RollTi - 26.04.2012, 01:33
Re: [HELP] Include Messup - i'm sick of it - by zSuYaNw - 26.04.2012, 02:02
Re: [HELP] Include Messup - i'm sick of it - by RollTi - 26.04.2012, 02:04
Re: [HELP] Include Messup - i'm sick of it - by zSuYaNw - 26.04.2012, 02:14
Re: [HELP] Include Messup - i'm sick of it - by Ballu Miaa - 26.04.2012, 02:15
Re: [HELP] Include Messup - i'm sick of it - by Ballu Miaa - 26.04.2012, 02:17
Respuesta: [HELP] Include Messup - i'm sick of it - by Marricio - 26.04.2012, 02:18
Re: [HELP] Include Messup - i'm sick of it - by RollTi - 26.04.2012, 02:20
Respuesta: Re: [HELP] Include Messup - i'm sick of it - by Marricio - 26.04.2012, 02:22

Forum Jump:


Users browsing this thread: 1 Guest(s)