'for' loop/'if' statement bugging?
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The error means that the array has size of 2 so the valid indexes are 0 and 1. Any other value will cause run time error 4.

It'd be helpful if you could post the whole code (that you use "i" as index in the array) and show the results of crashdetect with -d3 flag: https://github.com/Zeex/samp-plugin-...ith-debug-info
it will print the line caused it.
Yea well, I've been a fool, I did this;
pawn Код:
if(!sscanf(params, "ds[10]dd", vehicleid, setedit, type, var))
The params would be [VehicleID] [Copy] [FromVehicleID] [ID:1/2/3] (1 to copy 0, 2 to copy 1 and 3 to copy both, that's what's the loop is for.)

In the switch if you would've filled in 1 or 2 it would have this at the error'ing array;
Код:
(var-1)
If you would've filled in 3 '(var-1)' should've been replaced by 'i' from the loop but I forgot to replace it at 1 place, what resulted in doing "(3-1)" which is obviously 2.

So this topic can be deleted, was my own fault!

Best regards,
Jesse
Reply


Messages In This Thread
'for' loop/'if' statement bugging? - by jessejanssen - 17.06.2014, 17:27
Re: 'for' loop/'if' statement bugging? - by Konstantinos - 17.06.2014, 17:36
Re: 'for' loop/'if' statement bugging? - by Kimossab - 17.06.2014, 17:40
Re: 'for' loop/'if' statement bugging? - by jessejanssen - 17.06.2014, 17:49

Forum Jump:


Users browsing this thread: 1 Guest(s)