SA-MP Forums Archive
Dialog's Cant do [+REP] - 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: Dialog's Cant do [+REP] (/showthread.php?tid=522007)



Dialog's Cant do [+REP] - arlindi - 25.06.2014

Hello i create my dialog response but i cant create something.

I do this

PHP код:
        case DIALOG_CLASS_2:
        {
            if(
response)
            {
                if(
pInfo[playerid][SkinChanges] >= 1)
                {
                    switch(
listitem)
                    {
                        case 
0: if(pInfo[playerid][pXP] >= 0pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = CIVILIAN,setClass(playerid); else { SendXPError(playerid,0); }
                        case 
1: if(pInfo[playerid][pXP] >= 500pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = POLICEMAN,setClass(playerid); else { SendXPError(playerid,500); }
                        case 
2: if(pInfo[playerid][pXP] >= 1000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = MEDIC,setClass(playerid); else { SendXPError(playerid,1000); }
                        case 
3: if(pInfo[playerid][pXP] >= 1500pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SCOUT,setClass(playerid); else { SendXPError(playerid,1500); }
                        case 
4: if(pInfo[playerid][pXP] >= 5000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = HEAVYMEDIC,setClass(playerid); else { SendXPError(playerid,5000); }
                        case 
5: if(pInfo[playerid][pXP] >= 6000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = FARMER,setClass(playerid); else { SendXPError(playerid,6000); }
                        case 
6: if(pInfo[playerid][pXP] >= 6500pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SOLDIER,setClass(playerid); else { SendXPError(playerid,6500); }
                        case 
7: if(pInfo[playerid][pXP] >= 7500pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = ENGINEER,setClass(playerid); else { SendXPError(playerid,7500); }
                        case 
8: if(pInfo[playerid][pXP] >= 15000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SWAT,setClass(playerid); else { SendXPError(playerid,10000); }
                        case 
9: if(pInfo[playerid][pXP] >= 20000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = HEAVYSHOTGUN,setClass(playerid); else { SendXPError(playerid,20000); }
                        case 
10: if(pInfo[playerid][pXP] >= 25000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = ADVANCEDMEDIC,setClass(playerid); else { SendXPError(playerid,25000); }
                        case 
11: if(pInfo[playerid][pXP] >= 30000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = ADVANCEDENGINEER,setClass(playerid); else { SendXPError(playerid,30000); }
                        case 
12: if(pInfo[playerid][pXP] >= 35000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = E_ENGINEER,setClass(playerid); else { SendXPError(playerid,35000); }
                        case 
13: if(pInfo[playerid][pXP] >= 50000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = FEDERALAGENT,setClass(playerid); else { SendXPError(playerid,50000); }
                        case 
14: if(pInfo[playerid][pXP] >= 100000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = ADVANCEDSCOUT,setClass(playerid); else { SendXPError(playerid,100000); }
                        case 
15: if(pInfo[playerid][pXP] >= 400000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = KICKBACK,setClass(playerid); else { SendXPError(playerid,400000); }
                        case 
16: if(pInfo[playerid][pRank] >= 22pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = DOCTOR,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 22+ to use this"); }
                        case 
17: if(pInfo[playerid][pXP] >= 15000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = PIMP,setClass(playerid); else { SendXPError(playerid,15000); }
                        case 
18: if(pInfo[playerid][pXP] >= 75000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = WEAPONSDEALER,setClass(playerid); else { SendXPError(playerid,75000); }
                        case 
19: if(pInfo[playerid][pXP] >= 300000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = ASSASSIN,setClass(playerid); else { SendXPError(playerid,300000); }
                        case 
20: if(pInfo[playerid][pXP] >= 250000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = COWBOY,setClass(playerid); else { SendXPError(playerid,250000); }
                        case 
21: if(pInfo[playerid][pXP] >= 200000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = TRAPMASTER,setClass(playerid); else { SendXPError(playerid,200000); }
                        case 
22: if(pInfo[playerid][pXP] >= 200000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = FBI,setClass(playerid); else { SendXPError(playerid,200000); }
                        case 
23: if(pInfo[playerid][pXP] >= 300000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SCIENTIST,setClass(playerid); else { SendXPError(playerid,300000); }
                        case 
24: if(pInfo[playerid][pXP] >= 450000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SHOTGUNSPECIAL,setClass(playerid); else { SendXPError(playerid,450000); }
                        case 
25: if(pInfo[playerid][pXP] >= 1000000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = EXPERIENCEDSCOUT,setClass(playerid); else { SendXPError(playerid,1000000); }
                        case 
26: if(pInfo[playerid][pRank] >= 30pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SMOKEUP,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 30+ to use this"); }
                        case 
27: if(pInfo[playerid][pRank] >= 31pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BOXER,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 31+ to use this"); }
                        case 
28: if(pInfo[playerid][pXP] >= 450000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BOMBER,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 450000 xp to use this class!"); }
                        case 
29: if(pInfo[playerid][pXP] >= 500000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = MASTER,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 500000 xp to use this class!"); }
                        case 
30: if(pInfo[playerid][pXP] >= 600000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = GHOST,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 600000 xp to use this class!"); }
                        case 
31: if(pInfo[playerid][pXP] >= 150000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BUDDY,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 150000 xp to use this class!"); }
                        case 
32: if(pInfo[playerid][pXP] >= 800000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = AKICK,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 800000 xp to use this class!"); }
                        case 
33: if(pInfo[playerid][pXP] >= 900000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = TECG,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 900000 xp to use this class!"); }
                        case 
34: if(pInfo[playerid][pRank] >= 27pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BULL,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 27+ to use this class!"); }
                    }
                }
                
//else return SendClientMessage(playerid,-1,""chat""COL_RED" You ran out of skin changes mate! What do you think you are? Shape Shifter?");
            
}
        }
        case 
DIALOG_CLASS_2_2:
        {
            if(
response)
            {
                if(
pInfo[playerid][SkinChanges] >= 1)
                {
                    switch(
listitem)
                    {
                        case 
0: if(pInfo[playerid][pXP] >= 15000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = PIMP,setClass(playerid); else { SendXPError(playerid,15000); }
                        case 
1: if(pInfo[playerid][pXP] >= 75000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = WEAPONSDEALER,setClass(playerid); else { SendXPError(playerid,75000); }
                        case 
2: if(pInfo[playerid][pXP] >= 300000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = ASSASSIN,setClass(playerid); else { SendXPError(playerid,300000); }
                        case 
3: if(pInfo[playerid][pXP] >= 250000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = COWBOY,setClass(playerid); else { SendXPError(playerid,250000); }
                        case 
4: if(pInfo[playerid][pXP] >= 200000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = TRAPMASTER,setClass(playerid); else { SendXPError(playerid,200000); }
                        case 
5: if(pInfo[playerid][pXP] >= 200000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = FBI,setClass(playerid); else { SendXPError(playerid,200000); }
                        case 
6: if(pInfo[playerid][pXP] >= 300000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SCIENTIST,setClass(playerid); else { SendXPError(playerid,300000); }
                        case 
7: if(pInfo[playerid][pXP] >= 450000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SHOTGUNSPECIAL,setClass(playerid); else { SendXPError(playerid,450000); }
                        case 
8: if(pInfo[playerid][pXP] >= 1000000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = EXPERIENCEDSCOUT,setClass(playerid); else { SendXPError(playerid,1000000); }
                        case 
9: if(pInfo[playerid][pRank] >= 30pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = SMOKEUP,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 30+ to use this"); }
                        case 
10: if(pInfo[playerid][pRank] >= 31pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BOXER,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 31+ to use this"); }
                        case 
11: if(pInfo[playerid][pXP] >= 450000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BOMBER,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 450000 xp to use this class!"); }
                        case 
12: if(pInfo[playerid][pXP] >= 500000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = MASTER,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 500000 xp to use this class!"); }
                        case 
13: if(pInfo[playerid][pXP] >= 600000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = GHOST,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 600000 xp to use this class!"); }
                        case 
14: if(pInfo[playerid][pXP] >= 150000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BUDDY,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 150000 xp to use this class!"); }
                        case 
15: if(pInfo[playerid][pXP] >= 800000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = AKICK,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 800000 xp to use this class!"); }
                        case 
16: if(pInfo[playerid][pXP] >= 900000pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = TECG,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need 900000 xp to use this class!"); }
                        case 
17: if(pInfo[playerid][pRank] >= 27pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 1,pInfo[playerid][pHumanClass] = BULL,setClass(playerid); else { SendClientMessage(playerid,-1,""chat""COL_PINK" You need to be rank 27+ to use this class!"); }
                        }
                } 
BUT i want to create to show dialog. with names Skin 1 Skin 2 Skin 3 Skin 4
And i want to show dialog.

Help mee please


Re: Dialog's Cant do [+REP] - Dziugsas - 25.06.2014

Код:
ShowPlayerDialog(playerid, DIALOG_CLASS_2, DIALOG_STYLE_LIST, "Skins", "Skin1\nSkin2\nSkin3\etc", "Choose", "Close");



Respuesta: Dialog's Cant do [+REP] - SickAttack - 25.06.2014

ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
Source: https://sampwiki.blast.hk/wiki/ShowPlayerDialog

Example:
pawn Код:
new string[128], string2[128];
format(string, sizeof(string), "01) Skin 1\n"); strcat(string2, string);
format(string, sizeof(string), "02) Skin 2\n"); strcat(string2, string);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select a skin from the list below", string2, "Choose", "Close");



Re: Dialog's Cant do [+REP] - arlindi - 25.06.2014

Thnx But if i want with Name example

Skin 1: Fattie - Shootgun + pistol
Skin 2 : Etc etc


Respuesta: Re: Dialog's Cant do [+REP] - SickAttack - 25.06.2014

Quote:
Originally Posted by arlindi
Посмотреть сообщение
Thnx But if i want with Name example

Skin 1: Fattie - Shootgun + pistol
Skin 2 : Etc etc
It will be done the same way:

pawn Код:
new string[128], string2[128];
format(string, sizeof(string), "Skin 1: Fattie - Shootgun + Pistol\n"); strcat(string2, string);
format(string, sizeof(string), "Skin 2: Fattest - Deagle + Night Stick\n"); strcat(string2, string);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select a skin from the list below", string2, "Choose", "Close");



Re: Dialog's Cant do [+REP] - Dziugsas - 25.06.2014

Yeah and dont forget to raise the string number if you'll add more description.


Re: Respuesta: Re: Dialog's Cant do [+REP] - arlindi - 25.06.2014

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
It will be done the same way:

pawn Код:
new string[128], string2[128];
format(string, sizeof(string), "Skin 1: Fattie - Shootgun + Pistol\n"); strcat(string2, string);
format(string, sizeof(string), "Skin 2: Fattest - Deagle + Night Stick\n"); strcat(string2, string);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select a skin from the list below", string2, "Choose", "Close");
But why you are using string2 ?


Re: Respuesta: Re: Dialog's Cant do [+REP] - RenovanZ - 25.06.2014

Quote:
Originally Posted by arlindi
Посмотреть сообщение
But why you are using string2 ?
Because he combined (strcat) this string:
pawn Код:
format(string, sizeof(string), "Skin 1: Fattie - Shootgun + Pistol\n"); strcat(string2, string);
with this:
pawn Код:
format(string, sizeof(string), "Skin 2: Fattest - Deagle + Night Stick\n"); strcat(string2, string);
to string2


Re: Dialog's Cant do [+REP] - arlindi - 25.06.2014

But i use verry skins but when i login he show mee just the 2-nd.

Look

PHP код:
        if(team[playerid] == TEAM_HUMAN)
    {
    new 
string[128], string2[128];
    
format(stringsizeof(string), "Skin 1: Fattie - Shootgun + Pistol\n"); strcat(string2string);
    
format(stringsizeof(string), "Skin 2: Fattest - Deagle + Night Stick\n"); strcat(string2string);
    
format(stringsizeof(string), "Skin 3: Fattest - Deagle + Night Stick\n"); strcat(string2string);
    
format(stringsizeof(string), "Skin 4: Fattest - Deagle + Night Stick\n"); strcat(string2string);
    
format(stringsizeof(string), "Skin 5: Fattest - Deagle + Night Stick\n"); strcat(string2string);
    
format(stringsizeof(string), "Skin 6: Fattest - Deagle + Night Stick\n"); strcat(string2string); 
But he show mee just the 2-nd skin dont shoow meee all


Re: Dialog's Cant do [+REP] - arlindi - 25.06.2014

Plis help