Wantedlevel question - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Wantedlevel question (
/showthread.php?tid=95077)
Wantedlevel question -
DJ-CJ89 - 02.09.2009
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;
}
Re: Wantedlevel question -
DJ-CJ89 - 02.09.2009
hmm is there nobody who can help Me
Re: Wantedlevel question -
Yuryfury - 03.09.2009
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
Re: Wantedlevel question -
Calgon - 03.09.2009
Or, remove the custom callback and use something to check the players' state, if they're shooting use SetPlayerWantedLevel().