new Float: hp; GetPlayerHealth(playerid, hp); SetPlayerHealth(playerid, hp-5);
|
Completely irrelevant to his goal.
Make your own repeating timer which will decrease your health every x amount of time you will define. |
|
This?
Код:
new Float: hp; GetPlayerHealth(playerid, hp); SetPlayerHealth(playerid, hp-5); |
public healthy(playerid)
{
if(PlayerInfo[playerid][pOthers] == 0)
{
if(IsPlayerInRangeOfPoint(playerid,20.0,1658.5326,-3886.6897,60.7104))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,20.0,1656.0800,-3867.5583,52.9705))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,20.0,1653.4971,-3840.3416,37.3747))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,20.0,1641.8463,-3819.9185,31.1975))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,20.0,1622.8149,-3802.0142,29.7752))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,20.0,1610.4227,-3780.5847,32.2803))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,20.0,1609.8184,-3750.0193,45.0269))
{
GameTextForPlayer(playerid, "~g~You hear a ringing noice & your health is dropping!",3500,5);
new Float: hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-5);
SetTimerEx("healthy", 4000, false, "i", playerid);
}
}
return 1;
}
SetTimerEx("healthy", 4000, false, "i", playerid);
new bool:IsInArea[MAX_PLAYERS];
new HealthTimer[MAX_PLAYERS];
forward areacheck();
forward health(playerid);
public OnGameModeInit()
{
SetTimer("areacheck", 200, 1);
}
public areacheck()
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (IsPlayerInRangeOfPoint(put things here) && IsInArea[i]==false)
{
HealthTimer[i]=SetTimerEx("health", 400, 1, "i", i);
IsInArea[i]=true;
}
else
{
if (IsInArea[i]==true)
{
IsInArea[i]=false;
KillTimer(HealthTimer[i]);
}
}
}
}
}
public health(playerid)
{
new Float:h;
GetPlayerHealth(playerid, h);
SetPlayerHealth(playerid, h-5)
}
|
pawn Код:
|