SA-MP Forums Archive
AFK system [HELP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: AFK system [HELP] (/showthread.php?tid=381871)



AFK system [HELP] - Desi_Dude - 01.10.2012

hey guys , Is it possible to make a AFK Systemm based on ZCMD?

Such as The player Types /AFK and he goes afk together with other players will see a textlabel on top of that player saying The player is currently AFK .

IF yes could you help with with it ?

Help would be appriciated


Re: AFK system [HELP] - M3mPHi$_S3 - 01.10.2012

of course it is possible Read my signature and you can create that by using
pawn Код:
new 3dText:Label [MAX_PLAYERS];



Re: AFK system [HELP] - Danyal - 01.10.2012

Here is full afk system with 3d text...

pawn Код:
#define YELLOW 0xFFFF00AA
#define COLOR_YELLOW 0xFFFF00AA
new IsAFK[MAX_PLAYERS];

new Text3D:label[MAX_PLAYERS];


public OnPlayerConnect(playerid)
{
    IsAFK[playerid] = 0;
    return 1;
}


CMD:afk(playerid, params[])
{
    if(IsAFK[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You are now AFK, type /back to move again!");
        TogglePlayerControllable(playerid,0);
        label[playerid] = Create3DTextLabel("AFK",YELLOW,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
        IsAFK[playerid] = 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You are Already AFK!");
    }
    return 1;
}

CMD:back(playerid, params[])
{
    if(IsAFK[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You are now back!");
        TogglePlayerControllable(playerid,1);
        Delete3DTextLabel(Text3D:label[playerid]);
        IsAFK[playerid] = 0;
    }
    else
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You are not AFK!");
    }
    return 1;
}