OnPlayerKeyStateChange problem and Key Fire
#1

Hi all
My problem is with the Key Fire !
Actualy what i'm looking for is to make , when the playerid click on Fire Key next to a target ! if the target has 0 hp it will return 1; but it's not working! this is not the hole code but the most importan things
ANY suggestions ? ti fix this
Код:
if(newkeys & KEY_FIRE)//tank
{
		new target = GetClosestPlayer(playerid);// this is alrady defined and work perfectly
		new Float:hp, Float:a;
		GetPlayerHealth(target,hp);
		if(hp <= 0) return 1;
		else if(hp > 0) {//blabla codes}
                return 1;
}
Reply
#2

If you want it to execute when someone fires then use KEY_ACTION.
Reply
#3

so what i want .
i'll try to give more detailes
When the player is using fire_key next to an other player ( i didn't put all the codes cause it's about 30 lines) the target will lose HP and when the target hp is < 10 , the codes set the target hp to 0 and send a msg to all the players , now the problem is when the player kill the target buy the codes , and stand next to the dead target using key_fire , the server spam that msg ... so what i've done it to detect the target hp before the server reach the other codes in order to stop the function if when the target hp is = 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)