05.03.2019, 08:34
I made so when i type /afk i cant move, i get unlimited health.
How can i make it so when i type afk i cant use commands like for teleport. I mean the command /back will be available but the goto commands will be not. If there is a way.
And how can i make when you type /back it gets you the health you had before you typed /afk.
For now i have this:
Also i have tag mismatch on this:
please help.
How can i make it so when i type afk i cant use commands like for teleport. I mean the command /back will be available but the goto commands will be not. If there is a way.
And how can i make when you type /back it gets you the health you had before you typed /afk.
For now i have this:
Код:
new isAFK[MAX_PLAYERS];
new oldhealth;
CMD:afk(playerid, params[])
{
if(isAFK[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Вече сте AFK!");
SendClientMessage(playerid, 0xFAFAFAFF, "Вече сте AFK. За да се върнете напишете /back");
TogglePlayerControllable(playerid, 0);
GetPlayerHealth(playerid, oldhealth);
SetPlayerHealth(playerid, Float:0x7F800000);
isAFK[playerid] = 1;
return 1;
}
CMD:back(playerid, params[])
{
if(isAFK[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "Вие не сте AFK!");
SendClientMessage(playerid, 0xFAFAFAFF, "Вече не сте AFK.");
TogglePlayerControllable(playerid, 1);
SetPlayerHealth(playerid, oldhealth);
isAFK[playerid] = 1;
return 1;
}
Код:
GetPlayerHealth(playerid, oldhealth);


