Multiple problems [y_iter + ColAndreas] - 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)
+--- Thread: Multiple problems [y_iter + ColAndreas] (
/showthread.php?tid=636572)
Multiple problems [y_iter + ColAndreas] -
Dayrion - 30.06.2017
Hello, I've 2 problems:
1) Isn't impossible to use CA_ContactTest from Colandreas with this
object? It's returning 0 everytime (when the object in under/top/on the ground).
2) I've a problem with y_iterate. I can't add an element for a specific value. Only for the factionid 1, it's working.
PHP код:
Iter_Add(f_OwnedWeapons<factionid>, weaponid);
printf("Iter_Add - Weaponid : %i added", weaponid);
if(!Iter_Contains(f_OwnedWeapons<factionid>, weaponid))
printf("Iter_Contains - Weaponid : %i doesn't added!!", weaponid);
else
printf("All is good for weapon %i", weaponid);
Код:
[12:13:21] Iter_Add - Weaponid : 43 added
[12:13:21] Iter_Contains - Weaponid : 43 doesn't added!!
[12:13:21] INFO [core/faction/save] : [42] Weapon Camera (43) with 5 ammos for faction United States Army (5)
[12:13:24] Iter_Add - Weaponid : 45 added
[12:13:24] All is good for weapon 45
[12:13:24] INFO [core/faction/save] : [43] Weapon Infrared (45) with 5 ammos for faction United States Army (5)
Re: Multiple problems [y_iter + ColAndreas] -
Vince - 30.06.2017
1) ColAndreas works with collision boxes. Hence the "col" in the name. This particular object has no collision box (it even says so on the page you linked to) which means ColAndreas cannot detect it.
2) Is it even possible to use 2D-arrays with foreach/y_iterate?
Re: Multiple problems [y_iter + ColAndreas] -
Dayrion - 30.06.2017
1) I see. Thanks for your answer
2) Yes is it ! This is first I time I see that problem.
Edit: I've no other way to solve the problem?

Edit2: Of course, it's normal if multiple faction have the same weapon. That's why eh