SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Filterscripts (https://forum.sa-mp.com/forumdisplay.php?f=17)
-   -   [FilterScript] Easy AFK/BRB (https://forum.sa-mp.com/showthread.php?t=345647)

Kathleen 25/05/2012 09:13 PM

Easy AFK/BRB
 
Hello SA-MP Forum Users, ;'d
I made a easy Filterscript...
Also Players can't abuse this script if they typ /afk you still can lose HP when you not tabbed etc,
Just look at the script

Download (AMX+PWN)
http://dl.dropbox.com/u/75302440/AfkBRBFs.rar
http://www.2shared.com/file/nOalz9ew/AfkBRBFs.html

Code:

CMD:afk(playerid, params [])
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "You are now AFK.");
    format(string,sizeof string, "%s is now AFK (Away From Keyboard).",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    TogglePlayerControllable(playerid, 0);
    return 1;
}

CMD:brb(playerid, params [])
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "You are now BRB.");
    format(string,sizeof string, "%s is now BRB (Be Right Back).",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    TogglePlayerControllable(playerid, 0);
    return 1;
}

CMD:back(playerid, params [])
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "You are no longer AFK/BRB.");
    format(string,sizeof string, "%s is no longer AFK/BACK.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    TogglePlayerControllable(playerid, 1);
    return 1;
}


irfu 26/05/2012 04:40 AM

Re: Easy AFK/BRB
 
can you add a command as /whoisafk to find who is afk????

Kathleen 26/05/2012 08:22 AM

Re: Easy AFK/BRB
 
When you stand 15 seconds on the same place you stand in the /listafk
This AFK List is based on Godfather, LS RP, NGG
pawn Code:
CMD:listafk(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] >= 2) {

        new
            szMessage[36 + MAX_PLAYER_NAME];

        SendClientMessageEx(playerid,COLOR_WHITE,"--[AFK PLAYERS]--");
        foreach(Player, i) if(playerAFK[i] != 0 && playerAFKTime[i] > 15) {
            format(szMessage,sizeof(szMessage),"* %s (ID %d), AFK for %d minutes.", GetPlayerNameEx(i), i, playerAFKTime[i] / 15);
            if(PlayerInfo[i][pAdmin] >= 2) SendClientMessageEx(playerid,COLOR_RED,szMessage);
            else SendClientMessageEx(playerid,COLOR_GREY,szMessage);
        }
    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
    return 1;
}

Tuntun 26/05/2012 08:29 AM

Re: Easy AFK/BRB
 
Can you add /afk Reason & Back for /afk?? :)

Kathleen 26/05/2012 10:21 AM

Re: Easy AFK/BRB
 
Quote:

Originally Posted by Tuntun (Post 1885730)
Can you add /afk Reason & Back for /afk?? :)

Sure, Here is the New Code for you bro <3
By the way, If you want i can make it with Label on your head also

pawn Code:
CMD:afk(playerid, params[], help)
{
        new reason[64];
        if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afk [reason]");
        TogglePlayerControllable(playerid, 0);
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s is now AFK Reason: %s.",pName, reason);
        SendClientMessageToAll(0xFF0000AA,string);
        return 1;
}

CMD:brb(playerid, params[], help)
{
        new reason[64];
        if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /brb [reason]");
        TogglePlayerControllable(playerid, 0);
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s is now BRB Reason: %s.",pName, reason);
        SendClientMessageToAll(0xFF0000AA,string);
        return 1;
}

x96664 26/05/2012 12:34 PM

Re: Easy AFK/BRB
 
Quote:

Originally Posted by Kathleen (Post 1885922)
Sure, Here is the New Code for you bro <3
By the way, If you want i can make it with Label on your head also

It will be nice if you make it, something as [AFK].

Kathleen 26/05/2012 01:27 PM

Re: Easy AFK/BRB
 
Quote:

Originally Posted by x96664 (Post 1886102)
It will be nice if you make it, something as [AFK].

Here is the CMD with label "I'm afk/brb" enjoy it, Before you include it,,,
Add this line by your other "NEW" or what else


new Text3D:afkbrb[MAX_PLAYERS];

pawn Code:
CMD:afk(playerid, params[], help)
{
        new reason[64];
        if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afk [reason]");
        TogglePlayerControllable(playerid, 0);
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s is now AFK Reason: %s.",pName, reason);
        LabelOn[playerid] = Create3DTextLabel("I'm AFK (Away From Keyboard)",0xCCCC00FF,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer(afkbrb[playerid], playerid, 0.0, 0.0, 0.3);
        SendClientMessageToAll(0xFF0000AA,string);
        return 1;
}

CMD:brb(playerid, params[], help)
{
        new reason[64];
        if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /brb [reason]");
        TogglePlayerControllable(playerid, 0);
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s is now BRB Reason: %s.",pName, reason);
        LabelOn[playerid] = Create3DTextLabel("I'm BRB (Be Right Back)",0xCCCC00FF,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer(afkbrb[playerid], playerid, 0.0, 0.0, 0.3);
        SendClientMessageToAll(0xFF0000AA,string);
        return 1;
}

CMD:back(playerid, params [])
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "You are no longer AFK/BRB.");
    format(string,sizeof string, "%s is no longer AFK/BACK.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    Delete3DTextLabel(afkbrb[playerid]);
    TogglePlayerControllable(playerid, 1);
    return 1;
}

Tuntun 26/05/2012 05:25 PM

Re: Easy AFK/BRB
 
Can you help me with add there /afklist.. Cmd... for see Who is afk?

Kathleen 26/05/2012 07:10 PM

Re: Easy AFK/BRB
 
Quote:

Originally Posted by Tuntun (Post 1886653)
Can you help me with add there /afklist.. Cmd... for see Who is afk?

Sure, Add me on Skype: xifamous
or msn elewoutr@hotmail.com (im not always active on MSN)

KINGINA 26/05/2012 07:37 PM

Re: Easy AFK/BRB
 
excuse me! Look mine: http://forum.sa-mp.com/showthread.php?t=332879
Same system and you have just remove (/AFK) take a look on mine! and i was firs upload it!


All times are GMT. The time now is 01:08 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.