SA-MP Forums Archive
Array causes compiler to crash - 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: Array causes compiler to crash (/showthread.php?tid=527461)



Array causes compiler to crash - Jacksta21 - 22.07.2014

Hey guys..
I have this random skin array. and whenever I uncomment it, it forces my compiler to crash when i compile.
I can't see the error here, maybe a second opinion will help
pawn Код:
new RandomSkin[43][1] = {
{1},{2},{3},{4},{5},{6},{7},{17},{18},{19},{20},{21},{22},{23},{24},{25},{29},
{44},{45},{47},{51},{52},{66},{67},{82},{83},{84},{102},{103},{104},{105},
{106},{107},{108},{109},{110},{114},{115},{116},{121},{122},{154},{186} //43
};



Re: Array causes compiler to crash - SilentSoul - 22.07.2014

You don't need to create an array for random skin you can simply use:
pawn Код:
SetPlayerSkin(playerid,random(186)+1); // it will return with a random number from 1 - 186



Re: Array causes compiler to crash - Jacksta21 - 22.07.2014

I don't want certain skins, hence I came up with this...
Do you see anything wrong with the array?


Re: Array causes compiler to crash - driftpower - 22.07.2014

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
You don't need to create an array for random skin you can simply use:
pawn Код:
SetPlayerSkin(playerid,random(186)+1); // it will return with a random number from 1 - 186
there is 299 skins btw.


Re: Array causes compiler to crash - Jacksta21 - 22.07.2014

Can someone actually read my question please? :/


Re: Array causes compiler to crash - DarkPower - 22.07.2014

Just use normal array

new RandomSkin[43] = {
1,2,3...
};


Re: Array causes compiler to crash - Jacksta21 - 22.07.2014

even with
pawn Код:
new RandomSkin[43] = {
    1,2,3,
    4,5,6,
    7,17,18,
    19,20,21,
    22,23,24,
    25,29,44,
    45,47,51,
    52,66,67,
    82,83,84,
    102,103,104,
    105,106,107,
    108,109,110,
    114,115,116,
    121,122,154,
    186 //43
};
Compiler still crashes
If I comment it out it compiles fine..


Re: Array causes compiler to crash - Mauzen - 22.07.2014

Could be a define that involves RandomSkin in some kind. Looping defines are a great way to crash the compiler with apart from that correct code.
Thats the best guess I can make without deeper knowledge of the code.


Re: Array causes compiler to crash - Jacksta21 - 22.07.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
That array by itself is not the problem. There must be something in where it is located or being used.
Ah..
That solved the issue, thanks!
The issue lied where it was being used, so I changed and use it now in a more sensible place, thanks again.