Variable returning wrong number
#9

Quote:
Originally Posted by Admigo
Посмотреть сообщение
Thanks for the info. I also tried:
Код:
new BailInfoPlayerID[MAX_BAILS]=INVALID_PLAYER_ID;
But thats returning 0 also.
So its not working like that either?

EDIT: LastVehicle[playerid] is returning 65535 when i use
Код:
new LastVehicle[MAX_PLAYERS]=INVALID_PLAYER_ID;
But when i tried that with
Код:
new BailInfoPlayerID[MAX_BAILS]=INVALID_PLAYER_ID;
Its returning 0.
You got an explanation for that?
Yes I have an explanation for that. Because we mention the condition as < MAX_BAILS. That excludes the last one. To fix this, You should use <=

PHP код:
for (new 0<= MAX_BAILSi++) {
    
BailInfo[i][PlayerID] = INVALID_PLAYER_ID;
    
BailInfo[i][PlayerArrestID] = INVALID_PLAYER_ID;

But remember if MAX_BAILS is set to 500, You will have 501 items because 0 is counted as one. So it's better to just leave it at < MAX_BAILS

To clear your doubts about ENUMS, Refer to the thread I posted. It should help You!
Reply


Messages In This Thread
Variable returning wrong number - by Admigo - 12.04.2017, 18:27
Re: Variable returning wrong number - by DarkSkull - 12.04.2017, 18:38
Re: Variable returning wrong number - by Vince - 12.04.2017, 18:38
Re: Variable returning wrong number - by Admigo - 12.04.2017, 18:58
Re: Variable returning wrong number - by BroZeus - 12.04.2017, 19:10
Re: Variable returning wrong number - by Celmir - 12.04.2017, 19:19
Re: Variable returning wrong number - by Admigo - 12.04.2017, 19:29
Re: Variable returning wrong number - by Celmir - 12.04.2017, 19:34
Re: Variable returning wrong number - by DarkSkull - 12.04.2017, 19:38
Re: Variable returning wrong number - by Admigo - 12.04.2017, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)