How need make player around me losing hp
#5

Quote:
Originally Posted by Troydere
Посмотреть сообщение
I'd create a function with the hp loss with a player timer of 1 second under OnPlayerEnterDynamicArea.

If you're doing it this way, remember to kill the timer in OnPlayerLeaveDynamicArea and OnPlayerDisconnect, as when someone disconnects inside a Dynamic Area, it does not count as if they left.

PHP код:
new badtimer[MAX_PLAYERS];
new 
dainameecErea
public OnGameModeInit
{
    
dainameecErea CreateDynamicSphere(0,0,0,10);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    if(
check if its youAttachDynamicAreaToPlayer(dainameecEreaplayeridFloat:offsetx 0.0Float:offsety 0.0Float:offsetz 0.0);
    return 
1;
}
public 
OnPlayerEnterDynamicArea(playerid,STREAMER_TAG_AREA areaid)
{
    
badtimer[playerid] = SetTimerEx("SuckMyBlood",1000,true,"i",playerid);
    return 
1;
}
SuckMyBlood(playerid)
{
    new 
Float:healtu;
    
GetPlayerHealth(playerid,healtu);
    
SetPlayerHealth(playerid,healtu 15.0);
    return 
1;
}
public 
OnPlayerDisconnect // kill the timer
public OnPlayerLeaveDynamicArea // kill the timer 
Ok thanks i will test it.
Reply


Messages In This Thread
How need make player around me losing hp - by henkas - 09.03.2017, 21:42
Re: How need make player around me losing hp - by Toroi - 09.03.2017, 22:22
Re: How need make player around me losing hp - by henkas - 09.03.2017, 22:25
Re: How need make player around me losing hp - by Toroi - 09.03.2017, 22:26
Re: How need make player around me losing hp - by henkas - 10.03.2017, 08:20
Re: How need make player around me losing hp - by henkas - 10.03.2017, 08:27
Re: How need make player around me losing hp - by Toroi - 10.03.2017, 08:30
Re: How need make player around me losing hp - by henkas - 10.03.2017, 08:37
Re: How need make player around me losing hp - by henkas - 10.03.2017, 09:54
Re: How need make player around me losing hp - by Toroi - 10.03.2017, 09:57

Forum Jump:


Users browsing this thread: 2 Guest(s)