09.02.2012, 01:06
(
Last edited by misho1; 08/08/2012 at 05:19 PM.
Reason: Forgot Something
)
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:
Credits:
Misho:Script It
V_LOPE:Helped Me In Something
NEW:Bug Fixed
Sry For My Bad English
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;
}
Misho:Script It
V_LOPE:Helped Me In Something
NEW:Bug Fixed
Sry For My Bad English