PHP код:
new walkHP[MAX_PLAYERS][2];
public OnPlayerUpdate(playerid)
{
if(walkHP[playerid][0] != 1)
{
if(IsPlayerInRangeOfPoint(playerid, 100, -2657.7336,630.0181,14.4531)) //SF hospital
{
walkHP[playerid][0] = 1;
walkHP[playerid][1] = 0;
}
}else if(!IsPlayerInRangeOfPoint(playerid, 100, -2657.7336,630.0181,14.4531)) //SF hospital
{
walkHP[playerid][0] = 0;
}
if(walkHP[playerid][0] != 1)
{
if(IsPlayerInRangeOfPoint(playerid, 50, -316.8019,1055.4281,19.7422)) //FC hospital
{
walkHP[playerid][1] = 1;
walkHP[playerid][0] = 0;
}
}else if(!IsPlayerInRangeOfPoint(playerid, 50, -316.8019,1055.4281,19.7422)) //FC hospital
{
walkHP[playerid][1] = 0;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SpawnToHospital(playerid);
return 1;
}
SpawnToHospital(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 100, -2657.7336,630.0181,14.4531)) //SF Hospital
{
new ligonine = random(6);
switch(ligonine)
{
case 0: SetPlayerPos(playerid,2485.4375,-4534.1465,1001.9906), SetPlayerFacingAngle(playerid, 175.3011);
case 1: SetPlayerPos(playerid,2490.5200,-4534.7285,1001.9906), SetPlayerFacingAngle(playerid,181.2008);
case 2: SetPlayerPos(playerid,2495.6191,-4533.9224,1001.9906), SetPlayerFacingAngle(playerid,174.2484);
case 3: SetPlayerPos(playerid,2498.6262,-4542.7705,1001.9906), SetPlayerFacingAngle(playerid,353.4029);
case 4: SetPlayerPos(playerid,2493.0801,-4542.7397,1001.9906), SetPlayerFacingAngle(playerid,10.6898);
case 5: SetPlayerPos(playerid,2485.8608,-4543.0127,1001.9906), SetPlayerFacingAngle(playerid,2.7979);
}
TogglePlayerControllable(playerid, false);
ApplyAnimation(playerid, "BEACH", "SitnWait_loop_W", 4.000000, 1, 0, 0, 0, 0);
SetTimerEx("ToggleHP", 3000, false, "d", playerid);
SetPlayerInterior(playerid, 2);
ResetPlayerWeaponsEx(playerid);
AntiCheatSystem[playerid][pNoCheckAirbreak] = 5;
zInfo[playerid][Mires] = 0;
KillTimer(GrobimasEx[playerid]);
KillTimer(TaisoMasinaEx[playerid]);
KillTimer(KraunaMasinaEx[playerid]);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 50, -316.8019,1055.4281,19.7422)) //FC Hospital
{
new ligonine = random(3);
switch(ligonine)
{
case 0: SetPlayerPos(playerid,342.9870,-1501.7476,524.7386), SetPlayerFacingAngle(playerid, 180.9297);
case 1: SetPlayerPos(playerid,343.1917,-1503.4216,524.7386), SetPlayerFacingAngle(playerid, 185.3358);
case 2: SetPlayerPos(playerid,343.1035,-1504.9077,524.7386), SetPlayerFacingAngle(playerid, 177.3499);
}
SetPlayerInterior(playerid, 2);
ResetPlayerWeaponsEx(playerid);
AntiCheatSystem[playerid][pNoCheckAirbreak] = 5;
zInfo[playerid][Mires] = 0;
KillTimer(GrobimasEx[playerid]);
KillTimer(TaisoMasinaEx[playerid]);
KillTimer(KraunaMasinaEx[playerid]);
return 1;
}
return 1;
}