Pvar wont increase.
#1

Hello,
Basically I am trying to increase Pvar "TimesShot" when ever someone is shot.
Here is my code

Код:
doWepDamage(damagedid, Float:amount, wepid) {
	new Float:health;
	new Float:armour;
	GetPlayerHealth(damagedid, health);
	GetPlayerArmour(damagedid, armour);
	if(armour > 1 && armour <= MAX_ARMOUR) {
		SetPlayerArmourEx(damagedid, armour-amount);
	} else {
		SetPlayerArmourEx(damagedid, 0);
		SetPlayerHealthEx(damagedid, health-amount);
	}
	tryToApplyHurt(damagedid, health);
	dropPlayerFromBike(damagedid, wepid);
	new beenshot = 1;
	new shotamount = GetPVarInt(damagedid, "TimesShot");
	new gotshot = SetPVarInt(damagedid, "TimesShot", ++beenshot);
	if(shotamount < 10) {
		gotshot++;
		SendClientMessage(damagedid, X11_TOMATO_2, "You have been shot!");
	} else {
        }
	wobbleScreenForPlayer(damagedid, 500, 64000); //clientid, time in ms, drunkLevelamount
	return 1;
}
When they spawn I have their pvar set to 0

So it should read

GetPVarInt(damagedid "TimesShot") This Var = 0
So after my if statement.... It should ADD +1 to the pvar, So example

If Pvar = 0 - After the if statement it = 1
And just keeps going until it reaches 10.

Any help would be nice.
Reply
#2

pawn Код:
#define PVarInt(%1,%2)++; SetPVarInt(%1,%2,GetPVarInt(%1,%2) + 1);
pawn Код:
PVarInt(playerid,"variable")++;
Credit to : cessil

Next time use search...I found it in 1 second.
Reply
#3

Thanks,
Sry I did use ******, But It came up with no results that worked.

I'll give this a shot an then edit post
Reply
#4

Edit: Got it working, But now my fricking Wounded state dont trigger...
God pawno hates me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)