SA-MP Forums Archive
Help with a switch dialog - 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: Help with a switch dialog (/showthread.php?tid=384928)



Help with a switch dialog - arko123 - 13.10.2012

I want a arms dealer job whereby when you make 50 weapons you level up how could i do it so its saves as a jobskill thing here my code.

PHP код:
command(creategunplayeridparams[])
{
        if(
Jobs[Player[playerid][Job]][JobType] == 1)
        {
    if(
Player[playerid][PrisonDuration] >= || Player[playerid][Cuffed] >= || Player[playerid][Tazed] >= 1)
        {
            
SendClientMessage(playeridWHITE"You cannot do this right now.");
        }
        else
        {
                switch(
                {
                    case 
.. 49ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)","Select""Cancel");
                    case 
50 .. 99ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm pistol (250)","Select""Cancel");
                    case 
100 .. 149ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)","Select""Cancel");
                    case 
150 .. 199ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)","Select""Cancel");
                    case 
200 .. 249ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)","Select""Cancel");
                    case 
250 .. 299ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)","Select""Cancel");
                    case 
300 .. 349ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)","Select""Cancel");
                    case 
350 .. 399ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)","Select""Cancel");
                    case 
400 .. 449ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)\nM4A1 (2000)","Select""Cancel");
                    case 
450 .. 499ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)\nM4A1 (2000)\nSniper (2450)","Select""Cancel");
                    default: 
ShowPlayerDialog(playeridDIALOG_CREATEGUNDIALOG_STYLE_LIST"Weapon Selection""Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)\nM4A1 (2000)\nSniper (2450)\nSPAS12 (2550)\nKevlar Vest (1750)","Select""Cancel");
                }
            }
            else 
SendClientMessage(playeridCOLOR_GREY"You must wait your reload time (30 seconds).");
        }
        else 
SendClientMessage(playeridCOLOR_GREY"You can't do this while cuffed, tazed, or frozen.");
    }
    return 
1;




Re: Help with a switch dialog - _Shade. - 14.10.2012

Your switch statement is empty. Fill it with your variable and you'll be fine.


Re: Help with a switch dialog - arko123 - 14.10.2012

Quote:
Originally Posted by _Shade.
Посмотреть сообщение
Your switch statement is empty. Fill it with your variable and you'll be fine.
I know thats what i want help with


Re: Help with a switch dialog - cosbraa - 14.10.2012

What is the variable attached to the player for amount of guns made?

EG:
switch(Player[playerid][GunsMade])
{
case 0 .. 49: blah blah
case 50 .. 99: blah blah
etc..


Re: Help with a switch dialog - arko123 - 14.10.2012

Quote:
Originally Posted by cosbraa
Посмотреть сообщение
What is the variable attached to the player for amount of guns made?

EG:
switch(Player[playerid][GunsMade])
{
case 0 .. 49: blah blah
case 50 .. 99: blah blah
etc..
Not made it sorry i needed help with that to


Re: Help with a switch dialog - RedFusion - 14.10.2012

just show us the whole script lol


Re: Help with a switch dialog - arko123 - 14.10.2012

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
just show us the whole script lol
I got this from vortex 2 and added it to my script i just need a jobskill level thing so every 50 guns you get a new level


AW: Help with a switch dialog - Johndaonee - 14.10.2012

switch(WeaponSkill[playerid])

Then just increase it by 1 everytime he creates a gun, he would have to create 50 guns to reach level two then, do it how you like

WeaponSkill[playerid]++;


Re: AW: Help with a switch dialog - arko123 - 14.10.2012

Quote:
Originally Posted by Johndaonee
Посмотреть сообщение
switch(WeaponSkill[playerid])

Then just increase it by 1 everytime he creates a gun, he would have to create 50 guns to reach level two then, do it how you like

WeaponSkill[playerid]++;
Can you show me an example?