new Float:SaveHealth[MAX_PLAYERS];
new MordidaT[MAX_PLAYERS] = 0;
new Morda;
forward TimmerMordidas();
forward healtx();
///////////////////////////////////////////////////////
Morda = SetTimer("TimmerMordidas", 3000, 1);
///////////////////////////////////////////////////////
public TimmerMordidas()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
MordidaT[playerid] = 0;
}
}
}
///////////////////////////////////////////////////////
public healtx()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
SetPlayerHealth(playerid, SaveHealth[playerid]);
}
}
}
///////////////////////////////////////////////////////
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
if(PlayerInfo[playerid][pJeZombi] == 1)
{
if(PlayerInfo[playerid][pZombiSkill] == 4 || PlayerInfo[playerid][pZombiSkill] >= 7)
{
if(MordidaT[playerid] == 0)
{
MordidaT[playerid] = 1;
GetPlayerHealth(playerid, SaveHealth[playerid]);
new Float:x, Float:y, Float:z;
SetTimer("healtx",2000,0);
GetPlayerVelocity(playerid, x, y, z);
SetPlayerVelocity(playerid, x ,y ,z+0.5);
}
}
else
{
ClearAnimations(playerid);
}
}
}
///////////////////////////////////////////////////////
public OnGameModeExit()
{
foreach(Player, i)
{
KillTimer(Morda);
}
}
///////////////////////////////////////////////////////
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { if(IsPlayerConnected(playerid)) { SetPlayerHealth(playerid, SaveHealth[playerid]); } }
Morda = SetTimer("TimmerMordidas", 3000, 1); To: Morda = SetTimerEx("TimmerMordidas",3000,1,"i",playerid); SetTimerEx("healtx",2000,0); To: SetTimerEx("healtx",2000,0,"i",playerid); |
forward healtx(playerid); public healtx(playerid) { SetPlayerHealth(playerid, SaveHealth[playerid]); }