14.02.2015, 15:47
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;
}