03.09.2011, 00:57
Hey all! i made the most basic afk system ever :P
I was wondering if anyone can help me with, if they enter /afk, that they get an announce message ( if that is how it's called ). saying that they went afk.
Also, when a player uses /back, his hp gets restored to 100. How do i make this he get's the hp he had before he entered afk mode? thanks!
EDIT: lol i forgot to post the script:
I was wondering if anyone can help me with, if they enter /afk, that they get an announce message ( if that is how it's called ). saying that they went afk.
Also, when a player uses /back, his hp gets restored to 100. How do i make this he get's the hp he had before he entered afk mode? thanks!
EDIT: lol i forgot to post the script:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/afk", true) == 0)
{
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string, sizeof(string), "--) %s Has entered AFK mode.", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
TogglePlayerControllable(playerid, 0);
SetPlayerHealth(playerid, 99999999999.99);
return 1;
}
if )strcmp(cmdtext, "/back", true) == 0)
{
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string, sizeof(string), "--) %s Is now back.", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
TogglePlayerControllable(playerid, 1);
SetPlayerHealth(playerid, 100.00);
return 1;
}
return 0;
}