SA-MP Forums Archive
Count Reset - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Count Reset (/showthread.php?tid=382476)



Count Reset - MechaTech - 03.10.2012

Hey guys, I have a qeustion. How to reset the wanted counter, this is what I have.

pawn Код:
Wanted++;
Wanted++;
new string24[24];
format(string24, sizeof(string24), "Your wanted level: %d", Wanted);
SendClientMessage(playerid, COLOR_ORANGE, string24);
And I want to reset it, when you died.


Re: Count Reset - gtakillerIV - 03.10.2012

Add this under OnPlayerDeath(If this is what you want).

Код:
Wanted=0;



Re: Count Reset - MechaTech - 03.10.2012

Yes, this will do it only for the playerid? because sometimes I need to use it for the victim.


Re: Count Reset - CmZxC - 03.10.2012

You need to make a variable like
pawn Код:
new Wanted[MAX_PLAYERS];
To add wanted to player, use
pawn Код:
Wanted[playerid]++;
To reset player's wanted level, use
pawn Код:
Wanted[playerid] = 0;
under OnPlayerDeath or wherever you like it.


Re: Count Reset - TheDeadlyDutchi - 03.10.2012

Quote:
Originally Posted by CmZxC
Посмотреть сообщение
You need to make a variable like
pawn Код:
new Wanted[MAX_PLAYERS];
To add wanted to player, use
pawn Код:
Wanted[playerid]++;
To reset player's wanted level, use
pawn Код:
Wanted[playerid] = 0;
under OnPlayerDeath or wherever you like it.
Don't forget you can use --(decrease by one) instead of ++(increment by one) too!