CMD:afk(playerid,params[])
{
if(AFK[playerid] == 1)
{
return SendClientMessage(playerid,COLOR_RED,"You're Already In AFK");
}
new string[128];
new PNAME[MAX_PLAYER_NAME];
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AFK[playerid] = 1;
SetPlayerHealth(playerid,999999999);
SetVehicleHealth(vehicleid,9999999999);
GetPlayerHealth(playerid,OldHealth);
GetVehicleHealth(vehicleid,OldHealth);
SendClientMessage(playerid,GREEN,"You're Now In AFK");
GetPlayerName(playerid, PNAME, MAX_PLAYERS);
format(string, sizeof(string), "{ffff00}%s now away from keyboard", PNAME);
SendClientMessageToAll(COLOR_BLUE,string);
TogglePlayerControllable(playerid,0);
return 1;
}
CMD:afk(playerid,params[])
{
if(AFK[playerid] == 1)
{
return SendClientMessage(playerid,COLOR_RED,"You're Already In AFK");
}
new string[128],string2[128],Text3D:PlayerLabel[MAX_PLAYERS];
new PNAME[MAX_PLAYER_NAME];
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AFK[playerid] = 1;
SetPlayerHealth(playerid,999999999);
SetVehicleHealth(vehicleid,9999999999);
GetPlayerHealth(playerid,OldHealth);
GetVehicleHealth(vehicleid,OldHealth);
SendClientMessage(playerid,GREEN,"You're Now In AFK");
GetPlayerName(playerid, PNAME, MAX_PLAYERS);
format(string, sizeof(string), "{ffff00}%s now away from keyboard", PNAME);
format(string, sizeof(string2), "{ffff00}AFK %s", PNAME);
PlayerLabel[playerid] = Create3DTextLabel(string2, -1, 0.0, 0.0, 0.0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.3);
SendClientMessageToAll(COLOR_BLUE,string);
TogglePlayerControllable(playerid,0);
return 1;
}
PHP код:
|
CMD:afk(playerid,params[])
{
if(AFK[playerid] == 1)
{
return SendClientMessage(playerid,COLOR_RED,"You're Already In AFK");
}
new string[128],string2[128],Text3D:PlayerLabel[MAX_PLAYERS];
new PNAME[MAX_PLAYER_NAME];
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AFK[playerid] = 1;
SetPlayerHealth(playerid,999999999);
SetVehicleHealth(vehicleid,9999999999);
GetPlayerHealth(playerid,OldHealth);
GetVehicleHealth(vehicleid,OldHealth);
SendClientMessage(playerid,GREEN,"You're Now In AFK");
GetPlayerName(playerid, PNAME, MAX_PLAYERS);
format(string, sizeof(string), "{ffff00}%s now away from keyboard", PNAME);
format(string2, sizeof(string2), "{ffff00}AFK %s", PNAME);
PlayerLabel[playerid] = Create3DTextLabel(string2, -1, 0.0, 0.0, 0.0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.3);
SendClientMessageToAll(COLOR_BLUE,string);
TogglePlayerControllable(playerid,0);
return 1;
}
format(string, sizeof(string2), "{ffff00}AFK %s", PNAME); // string
PlayerLabel[playerid] = Create3DTextLabel(string2, -1, 0.0, 0.0, 0.0, 20.0, 0, 1);
format(string2, sizeof(string2), "{ffff00}AFK %s", PNAME);
PlayerLabel[playerid] = Create3DTextLabel(string2, -1, 0.0, 0.0, 0.0, 20.0, 0, 1);
CMD:back(playerid,params[])
{
if(AFK[playerid] == 0)
{
return SendClientMessage(playerid,COLOR_RED,"You're Not In AFK To Use This Command");
}
new string[128];
new PNAME[MAX_PLAYER_NAME];
AFK[playerid] = 0;
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
SetPlayerHealth(playerid,OldHealth);
SetVehicleHealth(vehicleid,OldHealth);
SendClientMessage(playerid,GREEN,"You're Back From AFK");
GetPlayerName(playerid, PNAME, MAX_PLAYERS);
format(string, sizeof(string), "{ffff00}%s now back to keyboard", PNAME);
SendClientMessageToAll(COLOR_ORANGE,string);
TogglePlayerControllable(playerid,1);
return 1;
}
new Text3D:PlayerLabel[MAX_PLAYERS];
CMD:afk(playerid,params[])
{
if(AFK[playerid] == 1)
{
return SendClientMessage(playerid,COLOR_RED,"You're Already In AFK");
}
new string[128],string2[128];
new PNAME[MAX_PLAYER_NAME];
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AFK[playerid] = 1;
SetPlayerHealth(playerid,999999999);
SetVehicleHealth(vehicleid,9999999999);
GetPlayerHealth(playerid,OldHealth);
GetVehicleHealth(vehicleid,OldHealth);
SendClientMessage(playerid,GREEN,"You're Now In AFK");
GetPlayerName(playerid, PNAME, MAX_PLAYERS);
format(string2, sizeof(string), "{ffff00}%s now away from keyboard", PNAME);
format(string2, sizeof(string2), "{ffff00}AFK %s", PNAME);
PlayerLabel[playerid] = Create3DTextLabel(string2, -1, 0.0, 0.0, 0.0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.3);
SendClientMessageToAll(COLOR_BLUE,string);
TogglePlayerControllable(playerid,0);
return 1;
}
CMD:back(playerid,params[])
{
if(AFK[playerid] == 0)
{
return SendClientMessage(playerid,COLOR_RED,"You're Not In AFK To Use This Command");
}
new string[128];
new PNAME[MAX_PLAYER_NAME];
AFK[playerid] = 0;
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
SetPlayerHealth(playerid,OldHealth);
SetVehicleHealth(vehicleid,OldHealth);
SendClientMessage(playerid,GREEN,"You're Back From AFK");
GetPlayerName(playerid, PNAME, MAX_PLAYERS);
format(string, sizeof(string), "{ffff00}%s now back to keyboard", PNAME);
SendClientMessageToAll(COLOR_ORANGE,string);
RemovePlayerAttachedObject(playerid, PlayerLabel[playerid]);
TogglePlayerControllable(playerid,1);
return 1;
}