PHP код:
publics: HPheck(playerid)
{
if(PlayerInfo[playerid][pBerth1] == 1 ||
PlayerInfo[playerid][pBerth2] == 1 ||
PlayerInfo[playerid][pBerth3] == 1 ||
PlayerInfo[playerid][pBerth4] == 1 ||
PlayerInfo[playerid][pBerth5] == 1 ||
PlayerInfo[playerid][pBerth6] == 1 ||
PlayerInfo[playerid][pBerth7] == 1 ||
PlayerInfo[playerid][pBerth8] == 1 ||
PlayerInfo[playerid][pBerth9] == 1 ||
PlayerInfo[playerid][pBerth10] == 1 ||
PlayerInfo[playerid][pBerth11] == 1 ||
PlayerInfo[playerid][pBerth12] == 1)
{
new Float:health;
printf("%d", health);
GetPlayerHealth(playerid, health);
if(health <= 96.0)SetPlayerHealthAC(playerid, health + 5.0);
else
{
if(PlayerInfo[playerid][pBerth1] == 1)Update3DTextLabelText(hospital_text[0],COLOR_RED,"{00FF00}Койка свободна №1\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth2] == 1)Update3DTextLabelText(hospital_text[1],COLOR_RED,"{00FF00}Койка свободна №2\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth3] == 1)Update3DTextLabelText(hospital_text[2],COLOR_RED,"{00FF00}Койка свободна №3\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth4] == 1)Update3DTextLabelText(hospital_text[3],COLOR_RED,"{00FF00}Койка свободна №4\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth5] == 1)Update3DTextLabelText(hospital_text[4],COLOR_RED,"{00FF00}Койка свободна №5\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth6] == 1)Update3DTextLabelText(hospital_text[5],COLOR_RED,"{00FF00}Койка свободна №6\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth7] == 1)Update3DTextLabelText(hospital_text[6],COLOR_RED,"{00FF00}Койка свободна №7\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth8] == 1)Update3DTextLabelText(hospital_text[7],COLOR_RED,"{00FF00}Койка свободна №8\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth9] == 1)Update3DTextLabelText(hospital_text[8],COLOR_RED,"{00FF00}Койка свободна №9\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth10] == 1)Update3DTextLabelText(hospital_text[9],COLOR_RED,"{00FF00}Койка свободна №10\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth11] == 1)Update3DTextLabelText(hospital_text[10],COLOR_RED,"{00FF00}Койка свободна №11\n{FF0000}Чтобы занять койку, используй /health!");
else if(PlayerInfo[playerid][pBerth12] == 1)Update3DTextLabelText(hospital_text[11],COLOR_RED,"{00FF00}Койка свободна №12\n{FF0000}Чтобы занять койку, используй /health!");
SendClientMessage(playerid, COLOR_YELLOW, "Курс лечения завершён!");
TogglePlayerControllable(playerid, 1);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1, 1,0,1000,1);
PlayerInfo[playerid][pBerth1] =
PlayerInfo[playerid][pBerth2] =
PlayerInfo[playerid][pBerth3] =
PlayerInfo[playerid][pBerth4] =
PlayerInfo[playerid][pBerth5] =
PlayerInfo[playerid][pBerth6] =
PlayerInfo[playerid][pBerth7] =
PlayerInfo[playerid][pBerth8] =
PlayerInfo[playerid][pBerth9] =
PlayerInfo[playerid][pBerth10] =
PlayerInfo[playerid][pBerth11] =
PlayerInfo[playerid][pBerth12] =
PlayerInfo[playerid][pHospital] = 0;
for(new i = sizeof(HospitalBed); i-- != 0;)
{
if HospitalBed[i] != playerid *then
continue;
HospitalBed[i] = INVALID_PLAYER_ID;
break;
}
}
}
return 1;
}