SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/09/2019, 02:15 PM   #1
Hassan1
Little Clucker
 
Hassan1's Avatar
 
Join Date: Feb 2016
Location: Cyprus
Posts: 12
Reputation: 0
Exclamation /clothing cmd dosn't showes any thing help !

n my game there /clothing system
that allowd players to add some toys on their bodys
it was working before
but not the cmd work don't show anyerror message in the server or while we use it
and it dosn't shows
the list
any sugg ?
<3
__________________
Ahsan K.
Hassan1 is offline   Reply With Quote
Old 17/09/2019, 05:08 PM   #2
Jonny
Huge Clucker
 
Jonny's Avatar
 
Join Date: Nov 2009
Location: Italy
Posts: 280
Reputation: 38
Default Re: /clothing cmd dosn't showes any thing help !

Code:
CMD:clothing(playerid, params[])
{
    SendClientMessage(playerid,-1,"We can't do anything without a code, there's not suggestions, you probably messed up something in that");
    return 1;
}
__________________
Jonny is offline   Reply With Quote
Old 17/09/2019, 06:47 PM   #3
Hassan1
Little Clucker
 
Hassan1's Avatar
 
Join Date: Feb 2016
Location: Cyprus
Posts: 12
Reputation: 0
Default Re: /clothing cmd dosn't showes any thing help !

CMD:clothing(playerid, params[])
{
new string[MAX_PLAYER_CLOTHING * 64];

for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++)
{
if(ClothingInfo[playerid][i][cExists])
{
if(ClothingInfo[playerid][i][cAttached]) {
format(string, sizeof(string), "%s\n{C8C8C8}%i) {00AA00}%s {FFD700}(Attached)", string, i + 1, ClothingInfo[playerid][i][cName]);
} else {
format(string, sizeof(string), "%s\n{C8C8C8}%i) {00AA00}%s{FFFFFF}", string, i + 1, ClothingInfo[playerid][i][cName]);
}
}
else
{
format(string, sizeof(string), "%s\n{C8C8C8}%i) {AFAFAF}Empty Slot{FFFFFF}", string, i + 1);
}
}

ShowPlayerDialog(playerid, DIALOG_CLOTHING, DIALOG_STYLE_LIST, "My clothing items", string, "Select", "Cancel");
return 1;
}
__________________
Ahsan K.
Hassan1 is offline   Reply With Quote
Old 17/09/2019, 07:30 PM   #4
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 27
Default Re: /clothing cmd dosn't showes any thing help !

Please use
[ CODE ]
//Your code
[ /CODE ]
in the future (without space).
Makes reading it a lot easier.

You are using an empty string in format as argument, which doesn't work or gives weird results.
Easiest workaround is to use TABLIST_HEADERS and initialize string with headers:
Code:
new string[MAX_PLAYER_CLOTHING * 64] = "id\tname";
Or set string to be the first item, before using it in the loop.
But whatever you do, string mustn't be empty.
Plastikmensch is offline   Reply With Quote
Old 17/09/2019, 09:56 PM   #5
Hassan1
Little Clucker
 
Hassan1's Avatar
 
Join Date: Feb 2016
Location: Cyprus
Posts: 12
Reputation: 0
Question Re: /clothing cmd dosn't showes any thing help !

like this ?

CMD:clothing(playerid, params[])
{
new string[MAX_PLAYER_CLOTHING * 64] = "id\tname";

for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++)
{
if(ClothingInfo[playerid][i][cExists])
{
if(ClothingInfo[playerid][i][cAttached]) {
format(string, sizeof(string), "%s\n{C8C8C8}%i) {00AA00}%s {FFD700}(Attached)", string, i + 1, ClothingInfo[playerid][i][cName]);
} else {
format(string, sizeof(string), "%s\n{C8C8C8}%i) {00AA00}%s{FFFFFF}", string, i + 1, ClothingInfo[playerid][i][cName]);
}
}
else
{
format(string, sizeof(string), "%s\n{C8C8C8}%i) {AFAFAF}Empty Slot{FFFFFF}", string, i + 1);
}
}

ShowPlayerDialog(playerid, DIALOG_CLOTHING, DIALOG_STYLE_LIST, "My clothing items", string, "Select", "Cancel");
return 1;
}
____
__________________
Ahsan K.
Hassan1 is offline   Reply With Quote
Old 18/09/2019, 08:34 AM   #6
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 27
Default Re: /clothing cmd dosn't showes any thing help !

As I said, it should be DIALOG_STYLE_TABLIST_HEADERS when using headers.
If you want to keep it as a simple list, set string to be the first slot before the loop and start loop at 1.
Plastikmensch 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
why my SA-MP dosn't open in win 8.1 amirtiva Client Support 0 21/12/2015 03:52 PM
Cmd Dosn't working CrazyChoco Scripting Help 5 18/09/2012 11:26 AM
NPC Dosn't Connect Passout Scripting Help 1 03/12/2011 08:02 AM
Map Script dosn't work.. Negrosoo Help Archive 3 25/06/2009 07:05 PM
Why dosn't this work? FreddeN Help Archive 3 23/05/2009 04:49 PM


All times are GMT. The time now is 09:02 AM.


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