Sorry if this has been answered before but in the latest version what does "listitem" return? The modelid or the actual listitem? The testing I've done basically returns fuck all, just "0".
I'm trying to pull the listitem so I can use it with an array.
PHP Code:
enum attachmentData {
attach_model,
attach_name [ 32 ]
} ;
// This is their primary attachment slot, but it is not absolute.
new Attachments [ ] [ attachmentData ] = {
{ 19528, "Witch Hat" } ,
{ 19520, "Police Cap 1" } ,
{ 19521, "Police Cap 2" }
} ;
CMD:test(playerid) {
new sQuery [ 2048 ], temp [ 36 ] ;
inline ToyStoreList(pid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused inputtext, dialogid, pid, listitem, response
if ( response ) {
printf("listitem: %d, modelid: %d", listitem, Attachments [ listitem ] [ attach_model ] ) ;
SetPlayerAttachedObject ( playerid, 0, Attachments [ listitem ] [ attach_model ], 1 ) ;
EditAttachedObject ( playerid, 0 ) ;
}
}
sQuery [ 0 ] = EOS ;
for ( new i; i < sizeof ( Attachments ); i ++ ) {
strcat(temp, Attachments [ i ] [ attach_name ], 36 ) ;
if ( strlen ( Attachments [ i ] [ attach_name ] ) > 12 ) {
strins(temp, "~n~", 12, 3) ;
}
format ( sQuery, sizeof ( sQuery ), "%s%i\t%s\n", sQuery, Attachments [ i ] [ attach_model ], Attachments [ i ] [ attach_name ]) ;
Dialog_SetListitemPreviewRot(playerid, i, -30.0, 0.0, 25.0, 1.0, 0xFFFFFFFF, 0xFFFFFFFF );
}
Dialog_ShowCallback(playerid, using inline ToyStoreList, DIALOG_STYLE_PREVMODEL, "Attachments Store", sQuery, "Select", "Cancel");
return true ;
}
Always returns 0.