PHP код:
CMD:health(playerid)
{
new Float:health,
str[50];
GetPlayerHealth(playerid, health);
if(health >= 99.0) return 1;
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)return SendClientMessage(playerid, COLOR_RED, "Вы уже лежите в больнице!");
{
if(PlayerToPoint(3.0, playerid, 905.75378, -1290.82129, 998.25958))//1
{
if(HospitalBed[0] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 1 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 1 койку!");
HospitalBed[0] = playerid;
PlayerInfo[playerid][pBerth1] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,893.6427,-1274.9749,999.9067,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 910.14984, -1279.21716, 998.26111))//2
{
if(HospitalBed[1] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 2 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 2 койку!");
HospitalBed[1] = playerid;
PlayerInfo[playerid][pBerth2] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,893.9003,-1278.1630,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 916.04840, -1279.21313, 998.26190))//3
{
if(HospitalBed[2] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 3 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 3 койку!");
HospitalBed[2] = playerid;
PlayerInfo[playerid][pBerth1] = 3;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,892.9685,-1282.5905,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 913.19598, -1279.21716, 998.26123))//4
{
if(HospitalBed[3] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 4 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 4 койку!");
HospitalBed[3] = playerid;
PlayerInfo[playerid][pBerth1] = 4;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,895.8279,-1282.6334,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 916.28546, -1280.23486, 998.26123))//5
{
if(HospitalBed[4] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 5 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 5 койку!");
HospitalBed[4] = playerid;
PlayerInfo[playerid][pBerth5] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,898.8099,-1282.6639,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 910.37219, -1280.23486, 998.26123))//6
{
if(HospitalBed[5] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 6 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 6 койку!");
HospitalBed[5] = playerid;
PlayerInfo[playerid][pBerth6] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,916.6170,-1276.9943,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 913.16748, -1280.23486, 998.26123))//7
{
if(HospitalBed[6] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 7 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 7 койку!");
HospitalBed[6] = playerid;
PlayerInfo[playerid][pBerth7] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,913.4777,-1277.0863,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 899.11810, -1280.20752, 998.25922))//8
{
if(HospitalBed[7] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 8 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 8 койку!");
HospitalBed[7] = playerid;
PlayerInfo[playerid][pBerth8] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,910.2390,-1277.1738,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 893.27924, -1280.20605, 998.25922))//9
{
if(HospitalBed[8] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 9 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 9 койку!");
HospitalBed[8] = playerid;
PlayerInfo[playerid][pBerth9] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,910.1337,-1283.0668,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 896.21667, -1280.20752, 998.25922))//10
{
if(HospitalBed[9] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 10 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 10 койку!");
HospitalBed[9] = playerid;
PlayerInfo[playerid][pBerth10] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,913.0986,-1282.2367,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 896.04327, -1275.12598, 998.25922))//11
{
if(HospitalBed[10] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 11 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 11 койку!");
HospitalBed[10] = playerid;
PlayerInfo[playerid][pBerth11] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,916.0704,-1282.5214,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
else if(PlayerToPoint(3.0, playerid, 896.04327, -1278.15625, 998.25922))//12
{
if(HospitalBed[11] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Койка под номером 12 уже занята!");
SendClientMessage(playerid, COLOR_GREY, "Поздравляем вы заняли 12 койку!");
HospitalBed[11] = playerid;
PlayerInfo[playerid][pBerth12] = 1;
TogglePlayerControllable(playerid, 0);
format(str, sizeof(str), "Последний пациент: %s", PlayerInfo[playerid][pNames]);
Create3DTextLabel(str,COLOR_RED,907.7652,-1290.8945,999.2600,15.0, 0, 1);
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
return 1;
}
}
return 1;
}
Помогите срочно прошу помощи.К примеру лёг на койке 2, а создался на другой койке 3дтекст.