11.10.2014, 05:45
(
Последний раз редактировалось YanLanger; 11.10.2014 в 09:39.
)
FIXED
bool:IsPlayerAFK[MAX_PLAYERS];
CMD:back(playerid,params[])
{
if(IsPlayerAfk[playerid] == false) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]{ffffff}:You are not AFK");
if(IsPlayerAfk[playerid] == true) TogglePlayerControllable(playerid,1);
IsPlayerAFK[playerid] = false;
return 1;
}
CMD:back(playerid,params[])
{
if(IsPlayerAfk[playerid] == 0) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]{ffffff}:You are not AFK");
else
{
TogglePlayerControllable(playerid, 1);
IsPlayerAfk[playerid] == 0;
}
return 1;
}
CMD:afk(playerid, params[])
{
if(IsPlayerAfk[playerid] == 0)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~g~AFK",5000,3);
IsPlayerAfk[playerid] = 1;
}
else
{
SendClientMessage(playerid, -1, "You are already AFK");
}
return 1;
}
if(IsPlayerAfk[playerid] == true) return SendClientMessage(playerid, -1, "You are already AFK.");
if(IsPlayerAfk[playerid] == false) TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~g~AFK",5000,3);
CMD:afk(playerid, params[])
{
if(IsPlayerAfk[playerid] == 0){
IsPlayerAfk[playerid] = 1;
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~g~AFK",5000,3);
}
return 1;
}
CMD:back(playerid,params[])
{
if(IsPlayerAfk[playerid] == 0) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]{ffffff}:You are not AFK");
if(IsPlayerAfk[playerid] == 1)
{
IsPlayerAfk[playerid] = 0;
TogglePlayerControllable(playerid,1);
}
return 1;
}
CMD:afk(playerid, params)
{
if(IsPlayerAfk[playerid] == true) return SendClientMessage(playerid, -1, "You are already AFK.");
if(IsPlayerAfk[playerid] == false) TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~g~AFK",5000,3);
return 1;
}
CMD:back(playerid,params[])
{
if(IsPlayerAfk[playerid] == false) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]{ffffff}:You are not AFK");
if(IsPlayerAfk[playerid] == true) TogglePlayerControllable(playerid,1);
IsPlayerAfk[playerid] = false;
return 1;
public OnPlayerDisconnect(playerid)
{
IsPlayerAfk[playerid] = false;
return 1;
}
public OnPlayerConnect(playerid)
{
IsPlayerAfk[playerid] = false;
return;
}
Make sure to set IsPlayerAfk[playerid] to 0 under OnPlayerDisconnect or OnPlayerConnect, or it will bug. |