Count Reset
#1

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.
Reply
#2

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

Код:
Wanted=0;
Reply
#3

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

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.
Reply
#5

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)