mSelection doesn't show all skins? +rep -
DemME - 22.05.2017
Quote:
if(listitem == 1)
{
new Skin[312], count = -1;
for(new i = 1; i < sizeof(Skin); i++)
{
if(i != 0 && i != 300 && i != 74 && (i < 274 || i > 28 && (i < 264 || i >267) && i != 149 &&
i != 311 && i != 310 && i != 309 && i != 308 && i != 307 && i != 306 && i != 302 && i != 301 &&
i != 300)
{
count++;
Skin[count] = i;
}
}
if(count != -1) ShowModelSelectionMenuEx(playerid, Skin, count, "Skin Selection", 5, 0.0, 0.0, 0.0);
|
It does show only one page out of I think 12 that exists in samp, why?
Re: mSelection doesn't show all skins? +rep -
NaS - 22.05.2017
You shouldn't initialize count with -1, but with zero.
Then, switch these two lines:
Otherwise count will always be 1 less than there are Skins in the Array.
Also replace
with
However that only causes the last Skin to be skipped, not 11 pages. But I didn't notice anything else..
Re: mSelection doesn't show all skins? +rep -
DemME - 22.05.2017
Quote:
Originally Posted by NaS
You shouldn't initialize count with -1, but with zero.
Then, switch these two lines:
Otherwise count will always be 1 less than there are Skins in the Array.
Also replace with
However that only causes the last Skin to be skipped, not 11 pages. But I didn't notice anything else..
|
switch this
count++;
Skin[count] = i;
with what?,
Re: mSelection doesn't show all skins? +rep -
NaS - 23.05.2017
Quote:
Originally Posted by DemME
switch this
count++;
Skin[count] = i;
with what?,
|
I meant switch the order of those two lines, or make it
Otherwise "count" will not contain the actual number of elements in the Array, but one less (after the loop).
This shouldn't be the reason for so many entries missing though (I don't see anything else wrong).
Re: mSelection doesn't show all skins? +rep -
DemME - 24.05.2017
Quote:
Originally Posted by NaS
I meant switch the order of those two lines, or make it
Otherwise "count" will not contain the actual number of elements in the Array, but one less (after the loop).
This shouldn't be the reason for so many entries missing though (I don't see anything else wrong).
|
still not working , supposdly it doesnt show the menu at all.
Re: mSelection doesn't show all skins? +rep -
JasonRiggs - 24.05.2017
What I can see in your code is that you are limiting the skins to be either equal to 0 or 300 or 74 or less than 274 or greater than 28 or less than 264 or greater than 267 or equal to 149 or
equal to 311 or 310 or 309 or 308 or 307 or 306 or 302 or 301 or 300, why don't you remove all of that and make it be either greater than 1 or smaller than 312
Code:
if(listitem == 1)
{
new Skin[312], count = -1;
for(new i = 1; i < sizeof(Skin); i++)
{
if(i>=1 && i=<312);
{
count++;
Skin[count] = i;
}
}
if(count != -1) ShowModelSelectionMenuEx(playerid, Skin, count, "Skin Selection", 5, 0.0, 0.0, 0.0);
This is the code which I guess will make it work..
Re: mSelection doesn't show all skins? +rep -
DemME - 25.05.2017
Quote:
Originally Posted by JasonRiggs
What I can see in your code is that you are limiting the skins to be either equal to 0 or 300 or 74 or less than 274 or greater than 28 or less than 264 or greater than 267 or equal to 149 or
equal to 311 or 310 or 309 or 308 or 307 or 306 or 302 or 301 or 300, why don't you remove all of that and make it be either greater than 1 or smaller than 312
Code:
if(listitem == 1)
{
new Skin[312], count = -1;
for(new i = 1; i < sizeof(Skin); i++)
{
if(i>=1 && i=<312);
{
count++;
Skin[count] = i;
}
}
if(count != -1) ShowModelSelectionMenuEx(playerid, Skin, count, "Skin Selection", 5, 0.0, 0.0, 0.0);
This is the code which I guess will make it work..
|
I have noticed that you changed if it's equal or greater, the problem is these errors/warnings:
Quote:
../gamemodes/core.pwn(5234) : warning 211: possibly unintended assignment
../gamemodes/core.pwn(5234) : error 022: must be lvalue (non-constant)
../gamemodes/core.pwn(5234) : error 029: invalid expression, assumed zero
../gamemodes/core.pwn(5234) : warning 215: expression has no effect
../gamemodes/core.pwn(5234) : error 001: expected token: ";", but found ")"
../gamemodes/core.pwn(5234) : fatal error 107: too many error messages on one line
|
5234 line that one code you have changed.
Re: mSelection doesn't show all skins? +rep -
JasonRiggs - 25.05.2017
Have u tried adding the line which I've gave you? and You got the same errors?
Re: mSelection doesn't show all skins? +rep -
DemME - 25.05.2017
Quote:
Originally Posted by JasonRiggs
Have u tried adding the line which I've gave you? and You got the same errors?
|
Indeed
Re: mSelection doesn't show all skins? +rep -
JasonRiggs - 25.05.2017
Ahh, But i see in the previous line you already made the same which I've done in the line i gave you, I believe removing the line which I've given you will make it work..