Wantedlevel question
#1

Hi All :P, first sorry for my bad english. Iam new with using forum.

I have a question.

I wanna script as follow:
- If a Player is shooting, he becomes wanted level 3.

I used onplayerammochange (YUP) for that, so if he looses ammu, his wanted level will set to 3. Now my problem.

Its working fine but: The player gets wanted level 3 too, when he just buys a weapon and that i dont want.
what i have to change in the script, that i can fix that?
I just started scripting for some weeks but i read all introductions wiki forum etc. But i dont know how to do this. Please help me, so that i can understand. Thanks


part of the script:

public OnPlayerAmmoChange(playerid, oldammo, newammo)
{
if (oldammo >= newammo)
{
SetPlayerWantedLevel(playerid, 3);
}
return 1;
}
Reply
#2

hmm is there nobody who can help Me
Reply
#3

do a check, if the old ammo is 0 and the new ammo is more than 0 then just return 1;

if the ammo goes down then SetPlayerWantedLevel
Reply
#4

Or, remove the custom callback and use something to check the players' state, if they're shooting use SetPlayerWantedLevel().
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)