Help with a switch dialog
#1

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;

Reply
#2

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

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
Reply
#4

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..
Reply
#5

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
Reply
#6

just show us the whole script lol
Reply
#7

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
Reply
#8

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]++;
Reply
#9

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?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)