slight problem.. can anyone help?
#1

I have a killstreak system in my server where the killer gets rewarded with health and Armour with every succession of a kill, but whats happening is that the health and Armour stays at 10, and doesnt increase what so ever..
Код:
	new Float: PHealth;
	new Float: PArmour;
	SetPlayerArmour(killerid,GetPlayerArmour(killerid, PArmour) + 10);
	SetPlayerHealth(killerid,GetPlayerHealth(killerid, PHealth) + 10);
Am i missing something out? as to why it wont work how i want it to?
Reply
#2

GetPlayerAmour/Health doesn't "return" the value but stores it to a variable. So you need to do it like that

pawn Код:
new Float: PHealth;
new Float: PArmour;

GetPlayerHealth(killerid, PHealth);
GetPlayerArmour(killerid, PArmour);

SetPlayerHealth(killerid, PHealth + 10);
SetPlayerArmour(killerid, PArmour + 10);
Make sure you do some checks so the health/armour does't go over 100(unless you don't care)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)