[AFK System] need help
#5

dont use strcmp its outdated! and try this and all you do is define a timer for afk members

Код:
new AFK[MAX_PLAYERS];

CMD:afk(playerid, params[])
{
new string[200];
if(AFK[playerid] == 0)
{
SetPlayerHealth(playerid, 999999);
format(string, sizeof(string), " **{00CCFF}[ AFK ] {2641FE} %s {FFFFFF}is now AFK Don't attack him!", PlayerName(playerid));
SendClientMessageToAll(COLOR_MODRA, string);
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, COLOR_WHITE,"You are now AFK");
AFK[playerid] = 1;
}
return 1;
}


CMD:back(playerid, params[])
{
new string[200];
if(AFK[playerid] == 1)
{
SetPlayerHealth(playerid, 60);
format(string, sizeof(string), " **{00CCFF}[ AFK ] {2641FE} %s {FFFFFF}is now Back!", PlayerName(playerid));
SendClientMessageToAll(COLOR_MODRA, string);
TogglePlayerControllable(playerid, true);
SendClientMessage(playerid, COLOR_WHITE,"Welcome Back! ");
AFK[playerid] = 0;
}
return 1;
}
if failing that then try putting this in with a afk system

Код:
new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[AFK]%s", name);
SetPlayerName(playerid, string);
Reply


Messages In This Thread
[AFK System] need help - by JeroenX - 08.04.2012, 15:10
Re: [AFK System] need help - by Plastic - 08.04.2012, 15:18
Re: [AFK System] need help - by .FuneraL. - 08.04.2012, 16:37
Re: [AFK System] need help - by JeroenX - 08.04.2012, 21:19
Re: [AFK System] need help - by [EuG]ZeRoGoD - 08.04.2012, 21:50
Re: [AFK System] need help - by [EuG]ZeRoGoD - 08.04.2012, 21:56

Forum Jump:


Users browsing this thread: 1 Guest(s)