SA-MP Forums Archive
How is this possible? - 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: How is this possible? (/showthread.php?tid=152333)



How is this possible? - Packadore - 03.06.2010

Hello,

Look at this:

pawn Код:
printf("[AMMO_31_svvar] %d",PlayerInfo[playerid][pSlot5Ammo]); // Returns 100 value.
printf("[AMMO_31_unsvar] %d",PlayerAmmo[playerid][5]); // Returns 0 value.

if(PlayerInfo[playerid][pSlot5Ammo] < PlayerAmmo[playerid][5]) { return 1; }
So it's clear that 100 is not smaller than 0, so why is this statement still returning true?

I checked my whole script and there's note a single piece of code that could interfer with those variables.

Please help, thanks.


Re: How is this possible? - FUNExtreme - 03.06.2010

Could you show us how you know it returns 1. Made you just looked wrong


Re: How is this possible? - DeathOnaStick - 03.06.2010

Quote:
Originally Posted by Packadore
Hello,

Look at this:

pawn Код:
printf("[AMMO_31_svvar] %d",PlayerInfo[playerid][pSlot5Ammo]); // Returns 100 value.
printf("[AMMO_31_unsvar] %d",PlayerAmmo[playerid][5]); // Returns 0 value.

if(PlayerInfo[playerid][pSlot5Ammo] < PlayerAmmo[playerid][5]) { return 1; }
So it's clear that 100 is not smaller than 0, so why is this statement still returning true?

I checked my whole script and there's note a single piece of code that could interfer with those variables.

Please help, thanks.
pawn Код:
if(PlayerInfo[playerid][pSlot5Ammo]<=PlayerAmmo[playerid][5])return 1;
Try this. I'm sortof sure that this wont change a thing, but it's worth a try.