Need help Bro Pro.
#1

Код:
I am using this under OnPlayerTakeDamage.
					    new Float:HP,Float:A;
						GetPlayerHealth(playerid, HP);
						GetPlayerArmour(playerid,A);
						if(A >  0.0)
						{
							switch(weaponid)
							{
							case 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,42: SetPlayerArmour(playerid, A-amount);
							}
						}
						if(A <= 0.0)
						{
						    switch(weaponid)
							{
						    case 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,42: SetPlayerHealthEx (playerid, HP-amount);
							}
						}
The problem which i am getting is it refill armour or health rather than decreasing it.. Also player getting damage in Health before Armour..... why ?

Код:
SetPlayerHealthEx(playerid,Float:NewHealth)
{
	new Float:A;
	GetPlayerArmour(playerid,A);
	if(NewHealth > 99 && A <= 0.0 && JustSpawned[playerid] == 0 && onduty[playerid] == 0 && pInfo[playerid][GodMode] == 0 ) NewHealth = 99;
	if(NewHealth <= 0.0) NewHealth = 0.0;
	return SetPlayerHealth(playerid,NewHealth);
}
The armour is decrease then increase same with health .

Kindly Help me to fix that Thanks.
Reply
#2

PHP код:
SetPlayerHealthEx(playerid,Float:NewHealth)
{
    new 
Float:A;
    
GetPlayerArmour(playerid,A);
    if((
NewHealth 99 && <= 0.0) && JustSpawned[playerid] == && onduty[playerid] == && pInfo[playerid][GodMode] == NewHealth 99;
    if(
NewHealth <= 0.0NewHealth 0.0;
    return 
SetPlayerHealth(playerid,NewHealth);

Invalid range in if

Example:
(a > 0 && a < 99 && b == 5) //invalid
((a > 0 && a < 99) && b == 5) //valid
Reply
#3

The problem what i getting when some budy shoot some one he fist lose armour ammount then he get that amount..
I dont want he get that ammount...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)