[FilterScript] Simple AFK System
#1

Hi,
This Is Simple FS Made By Me
That When You Type /AFK You Will Be Away From Keyboard And When You Type /Back You Will Return From AFK

Commands:
/AFK
/BACK

[EDITED]Here Is It:
pawn Code:
////////////////////////////Simple AFK System By Misho//////////////////////////
#include a_samp
#include ysi\y_commands
#define RED   0xFF0000FF
#define GREEN 0x008000FF
#define BLUE  0x0000FFFF
#define ORANGE    0xFF8000FF
new AFK[MAX_PLAYERS];
new Float:Health;


public OnFilterScriptInit()
{
    print("\n**************************************");
    print("********Simple AFK FS By Misho*********");
    print("**************************************\n");
    return 1;
}



public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] ==1)
    {
        SendClientMessage(playerid,RED,"You're In AFK You Can't Talk");
        return 0;
}
    return 1;
}


                YCMD:afk(playerid,params[],help)
                {
                new string[128];
                new PNAME[MAX_PLAYER_NAME];
                if(AFK[playerid] ==1)
                {
                return SendClientMessage(playerid,RED,"You're Already In AFK");
                }
                if(IsPlayerInAnyVehicle(playerid) == 1)
                {
                AFK[playerid] = 1;
                SetVehicleHealth(GetPlayerVehicleID(playerid),9999999999);
                GetVehicleHealth(GetPlayerVehicleID(playerid),Health);
                SendClientMessage(playerid,RED,"You're Now In AFK");
                GetPlayerName(playerid, PNAME, MAX_PLAYERS);
                format(string, sizeof(string), "%s Is Now In AFK", PNAME);
                SendClientMessageToAll(BLUE,string);
                TogglePlayerControllable(playerid,0);
                return 1;
                }
                AFK[playerid] = 1;
                SetPlayerHealth(playerid,999999999);
                GetPlayerHealth(playerid,Health);
                SendClientMessage(playerid,RED,"You're Now In AFK");
                GetPlayerName(playerid, PNAME, MAX_PLAYERS);
                format(string, sizeof(string), "%s Is Now In AFK", PNAME);
                SendClientMessageToAll(BLUE,string);
                TogglePlayerControllable(playerid,0);
                return 1;
            }

                YCMD:back(playerid,params[],help)
                {
                new string[128];
                new PNAME[MAX_PLAYER_NAME];
                if(AFK[playerid] ==0)
                {
                return SendClientMessage(playerid,RED,"You're Not In AFK To Use This Command");
                }
                if(IsPlayerInAnyVehicle(playerid) == 1)
                {
                AFK[playerid] = 0;
                SetVehicleHealth(GetPlayerVehicleID(playerid),Health);
                TogglePlayerControllable(playerid,1);
                SendClientMessage(playerid,GREEN,"You're Back From AFK");
                GetPlayerName(playerid, PNAME, MAX_PLAYERS);
                format(string, sizeof(string), "%s Back From AFK", PNAME);
                SendClientMessageToAll(ORANGE,string);
                return 1;
                }
                AFK[playerid] = 0;
                SetPlayerHealth(playerid,Health);
                SendClientMessage(playerid,GREEN,"You're Back From AFK");
                GetPlayerName(playerid, PNAME, MAX_PLAYERS);
                format(string, sizeof(string), "%s Back From AFK", PNAME);
                SendClientMessageToAll(ORANGE,string);
                TogglePlayerControllable(playerid,1);
                return 1;
            }
Credits:
Misho:Script It
V_LOPE:Helped Me In Something

NEW:Bug Fixed

Sry For My Bad English
Reply


Messages In This Thread
Simple AFK System - by misho1 - 09.02.2012, 01:06
Re: Simple AFK System - by Gravity4501 - 09.02.2012, 01:36
Re: Simple AFK System - by misho1 - 09.02.2012, 01:37
Re: Simple AFK System - by V_LOPE - 09.02.2012, 05:33
Re: Simple AFK System - by suhrab_mujeeb - 09.02.2012, 06:15
Re: Simple AFK System - by V_LOPE - 09.02.2012, 07:01
Re: Simple AFK System - by suhrab_mujeeb - 09.02.2012, 07:24
Re: Simple AFK System - by misho1 - 09.02.2012, 13:43
Re: Simple AFK System - by ryan39 - 09.02.2012, 22:35
Re: Simple AFK System - by misho1 - 10.02.2012, 00:46
Re: Simple AFK System - by lakshikagayal - 10.02.2012, 03:01
Re: Simple AFK System - by misho1 - 10.02.2012, 03:09
Re: Simple AFK System - by Zarky - 12.02.2012, 13:53
Re: Simple AFK System - by misho1 - 13.02.2012, 12:51
Re: Simple AFK System - by Agent Smith - 16.02.2012, 18:49
Re: Simple AFK System - by misho1 - 16.02.2012, 19:24
Re: Simple AFK System - by Henry_Martinez - 17.02.2012, 00:38
Re: Simple AFK System - by misho1 - 17.02.2012, 09:59
Re: Simple AFK System - by misho1 - 11.06.2012, 01:42
Re: Simple AFK System - by MoonCalF - 07.08.2012, 11:06
Re: Simple AFK System - by Waw - 07.08.2012, 14:33
Re: Simple AFK System - by misho1 - 08.08.2012, 17:25

Forum Jump:


Users browsing this thread: 3 Guest(s)