SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/05/2017, 02:16 PM   #1
DemME
Huge Clucker
 
Join Date: Oct 2013
Location: forum.sa-mp.com Money: 1,982,120
Posts: 295
Reputation: 13
Default mSelection doesn't show all skins? +rep

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?
DemME is offline   Reply With Quote
Old 22/05/2017, 02:56 PM   #2
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Location: 🇩🇪
Posts: 1,656
Reputation: 559
Default Re: mSelection doesn't show all skins? +rep

You shouldn't initialize count with -1, but with zero.

Then, switch these two lines:
pawn Code:
count++;
Skin[count] = i;

Otherwise count will always be 1 less than there are Skins in the Array.

Also replace
pawn Code:
if(count != -1)
with
pawn Code:
if(count != 0)

However that only causes the last Skin to be skipped, not 11 pages. But I didn't notice anything else..
NaS is offline   Reply With Quote
Old 22/05/2017, 05:05 PM   #3
DemME
Huge Clucker
 
Join Date: Oct 2013
Location: forum.sa-mp.com Money: 1,982,120
Posts: 295
Reputation: 13
Default Re: mSelection doesn't show all skins? +rep

Quote:
Originally Posted by NaS View Post
You shouldn't initialize count with -1, but with zero.

Then, switch these two lines:
pawn Code:
count++;
Skin[count] = i;

Otherwise count will always be 1 less than there are Skins in the Array.

Also replace
pawn Code:
if(count != -1)
with
pawn Code:
if(count != 0)

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?,
DemME is offline   Reply With Quote
Old 23/05/2017, 02:26 PM   #4
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Location: 🇩🇪
Posts: 1,656
Reputation: 559
Default Re: mSelection doesn't show all skins? +rep

Quote:
Originally Posted by DemME View Post
switch this
count++;
Skin[count] = i;
with what?,
I meant switch the order of those two lines, or make it

pawn Code:
Skin[count ++] = i;

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).
NaS is offline   Reply With Quote
Old 24/05/2017, 10:35 PM   #5
DemME
Huge Clucker
 
Join Date: Oct 2013
Location: forum.sa-mp.com Money: 1,982,120
Posts: 295
Reputation: 13
Default Re: mSelection doesn't show all skins? +rep

Quote:
Originally Posted by NaS View Post
I meant switch the order of those two lines, or make it

pawn Code:
Skin[count ++] = i;

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.
DemME is offline   Reply With Quote
Old 25/05/2017, 12:09 AM   #6
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 783
Reputation: 47
Default Re: mSelection doesn't show all skins? +rep

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..
__________________
JasonRiggs is offline   Reply With Quote
Old 25/05/2017, 11:45 AM   #7
DemME
Huge Clucker
 
Join Date: Oct 2013
Location: forum.sa-mp.com Money: 1,982,120
Posts: 295
Reputation: 13
Default Re: mSelection doesn't show all skins? +rep

Quote:
Originally Posted by JasonRiggs View Post
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.
DemME is offline   Reply With Quote
Old 25/05/2017, 12:34 PM   #8
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 783
Reputation: 47
Default Re: mSelection doesn't show all skins? +rep

Have u tried adding the line which I've gave you? and You got the same errors?
__________________
JasonRiggs is offline   Reply With Quote
Old 25/05/2017, 01:10 PM   #9
DemME
Huge Clucker
 
Join Date: Oct 2013
Location: forum.sa-mp.com Money: 1,982,120
Posts: 295
Reputation: 13
Default Re: mSelection doesn't show all skins? +rep

Quote:
Originally Posted by JasonRiggs View Post
Have u tried adding the line which I've gave you? and You got the same errors?
Indeed
DemME is offline   Reply With Quote
Old 26/05/2017, 12:55 AM   #10
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 783
Reputation: 47
Default Re: mSelection doesn't show all skins? +rep

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..
__________________
JasonRiggs is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/makefleader command doesn't show anything on a player's screen, and doesn't work in general. Gorgeousmaniac Scripting Help 2 05/10/2016 02:43 AM
[Pedido] mSelection Skins.txt MineiriinHo Português/Portuguese 1 01/05/2016 04:38 AM
mSelection show just 1/1 page arlindi Scripting Help 11 11/01/2015 09:24 AM
Textdraw doesn't show on spawn sometimes it even doesn't show Immortal_LTU Scripting Help 10 24/10/2013 08:52 AM
My SAMP doesn't work. Browser doesn't show up servers. KidBuu*** Client Support 5 23/05/2010 01:50 PM


All times are GMT. The time now is 05:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.