SA-MP Forums Archive
samp cmd skins - 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: samp cmd skins (/showthread.php?tid=652869)



samp cmd dialog - Zeus666 - 20.04.2018

PHP код:
new PHONE_MODELS[] = {
    
18871, 18872, 18874, 18866
};
new 
PHONE_NAMES[][] = {
    
"iPhone", "Samsung", "Nokia", "Motorola"
};
new 
PHONE_IDS[] = {
    
"Iphone", "Samsung", "Nokia", "Motorola"
};
CMD:phones(playerid) {
    return 
ShowPreviewModelDialog(playerid, 0, "Phone Selection Dialog", PHONE_MODELS, PHONE_NAMES, "Select", "Cancel");
} 
Problem is that models are in their natural position, how can I set them to be vertically instead of horizontally?


Re: samp cmd skins - Sew_Sumi - 20.04.2018

Copy-Pasting only goes so far...


Re: samp cmd skins - Zeus666 - 20.04.2018

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Copy-Pasting only goes so far...
Well because solo I reached so far here,

PHP код:
new PHONE_MODELS[] = {
    
18871, 18872, 18874, 18866
};
new 
PHONE_NAMES[][] = {
    
"iPhone", "Samsung", "Nokia", "Motorola"
};
new 
PHONE_IDS[] = {
    
"Iphone", "Samsung", "Nokia", "Motorola"
};
CMD:phones(playerid) {
    return 
ShowPreviewModelDialog(playerid, 0, "Phone Selection Dialog", PHONE_MODELS, PHONE_NAMES, "Select", "Cancel");
} 

But it shows phones horizontally instead of vertically


Re: samp cmd skins - Sew_Sumi - 20.04.2018

Are you like intentionally screwing with your users or something? /skins to do phones, /phone to do skins?


Re: samp cmd dialog - Zeus666 - 20.04.2018

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Are you like intentionally screwing with your users or something? /skins to do phones, /phone to do skins?
Good ideea.


Re: samp cmd skins - Gammix - 20.04.2018

You don't need "PHONE_IDS", i made that for wepons dialog because weaponid and weapon model have different values.

Here is how you should do it:
PHP код:
new PHONE_MODELS[] = { 
    
18871, 18872, 18874, 18866 
}; 
new 
PHONE_NAMES[][] = { 
    
"iPhone", "Samsung", "Nokia", "Motorola" 
}; 
CMD:phones(playerid) { 
    
// for adjusting every model rotation
    
for (new i = 0; i < sizeof(PHONE_MODELS); i++) {
        
SetDialogPreviewRotation(playerid, i, rx, ry, rz, zoom); // put your values here
    
}
    return 
ShowPreviewModelDialog(playerid, 0, "Phone Selection Dialog", PHONE_MODELS, PHONE_NAMES, "Select", "Cancel"); 
}
public 
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    if (
dialogid == 0) {
        if (
response) {
            switch (
listitem) {
                case 
0: {} // iphone
                
case 1: {} // samsung
                // and so on....
            
}
        }
    }
    return 
1;
} 



Re: samp cmd skins - Zeus666 - 21.04.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
You don't need "PHONE_IDS", i made that for wepons dialog because weaponid and weapon model have different values.

Here is how you should do it:
PHP код:
new PHONE_MODELS[] = { 
    
18871, 18872, 18874, 18866 
}; 
new 
PHONE_NAMES[][] = { 
    
"iPhone", "Samsung", "Nokia", "Motorola" 
}; 
CMD:phones(playerid) { 
    
// for adjusting every model rotation
    
for (new i = 0; i < sizeof(PHONE_MODELS); i++) {
        
SetDialogPreviewRotation(playerid, i, rx, ry, rz, zoom); // put your values here
    
}
    return 
ShowPreviewModelDialog(playerid, 0, "Phone Selection Dialog", PHONE_MODELS, PHONE_NAMES, "Select", "Cancel"); 
}
public 
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    if (
dialogid == 0) {
        if (
response) {
            switch (
listitem) {
                case 
0: {} // iphone
                
case 1: {} // samsung
                // and so on....
            
}
        }
    }
    return 
1;
} 
Thank you.