[HELP]Bite[Who can to fix it ?]
#1

hey guys for me this script dont work guys some one know how to fix it i want to do that when ([player]zombie) press Right mouse Button he the player will do this anim : but only when he close to human and when he did right mouse button close to human the human will lose -15 hp how to do it ? i have this but that dont work :

forward LooseHealth();

public OnGameModeInit()
{
SetTimer("LooseHealth",1000*30,1);
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_ACTION)
{
if(Zombie[playerid])
{
new Floatos[3];
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
for(new p;p<MAX_PLAYERS&&IsPlayerConnected(p);p++)
{
if(IsPlayerInRangeOfPoint(p,5,pos[0],pos[1],pos[2]))
{
if(!Zombie[p])
{
SetPVarInt(p,"Infiziert",1);
}
}
}
}
}
return 1;
}

public LooseHealth()
{
for(new p;p<MAX_PLAYERS&&IsPlayerConnected(p);p++)
{
if(!Zombie[p])
{
if(GetPVarInt(p,"Infiziert")==1)
{
new Float:Health;
GetPlayerHealth(p,Health);
SetPlayerHealth(p,Health-5);
}
}
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)