Need help in /switchclass
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 999)
            {
                if(response)
                    {
                if(listitem == 0)
                    {
                    if(GetPlayerScore(playerid) >= 0)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Assault as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Assult Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, good in infantry attacks.\n\n{F81414}Weapons:\n\n{FFFFFF}Knife\n{FFFFFF}M4\n{FFFFFF}Spaz12\n{FFFFFF}Deagle", "OK","");
                        gPlayerClass[playerid] = ASSAULT;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 4, 1);
                        GivePlayerWeapon(playerid, 27, 500);
                        GivePlayerWeapon(playerid, 24, 500);
                        GivePlayerWeapon(playerid, 31, 700);
                        }
                    }

                if(listitem == 1)
                    {
                    if(GetPlayerScore(playerid) >= 250)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Sniper as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Sniper Class:", "{F81414}Abilities:\n{FFFFFF}A Locater class, Always invisible on map.\n\n{F81414}Weapons:\n\n{FFFFFF}Sniper Rifle\n{FFFFFF}Rifle\n{FFFFFF}Knife\n{FFFFFF}Shotgun", "OK","");
                        gPlayerClass[playerid] = SNIPER;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 4, 1);
                        GivePlayerWeapon(playerid, 34, 400);
                        GivePlayerWeapon(playerid, 25, 200);
                        GivePlayerWeapon(playerid, 33, 300);
                        }
                    else
            {
                SendClientMessage(playerid,COLOR_RED,"You need to be on Rank 2 to get this Class.");

                ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
                TogglePlayerControllable(playerid, 0);
                }
            }

                if(listitem == 2)
                    {
                    if(GetPlayerScore(playerid) >= 400)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Medic as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Medic Class:", "{F81414}Abilities:\n{FFFFFF}A Strong class. Very good on land\nCan heal themselve using /usekit cmd.\n\n{F81414}Weapons:\n\n{FFFFFF}AK47\n{FFFFFF}Silent Pistol\n{FFFFFF}RPG\n{FFFFFF}Desert Eagle", "OK","");
                        gPlayerClass[playerid] = MEDIC;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 30, 400);
                        GivePlayerWeapon(playerid, 23, 400);
                        GivePlayerWeapon(playerid, 35, 2);
                        GivePlayerWeapon(playerid, 24, 300);
                        }
                    else
            {
                SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 3 to get this Class.");

                ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
                TogglePlayerControllable(playerid, 0);
                }
            }
           
            if(listitem == 3)
                    {
                    if(GetPlayerScore(playerid) >= 600)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Engineer as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Engineer Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, can drice tanks.\n\n{F81414}Weapons:\n\n{FFFFFF}Tec-9\n{FFFFFF}Colt\n{FFFFFF}Knife\n{FFFFFF}Moltov", "OK","");
                        gPlayerClass[playerid] = ENGINEER;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 4, 1);
                        GivePlayerWeapon(playerid, 32, 1000);
                        GivePlayerWeapon(playerid, 22, 700);
                        GivePlayerWeapon(playerid, 18, 2);
                        }
                    else
            {
                SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 4 to get this Class.");

                ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
                TogglePlayerControllable(playerid, 0);
                }
            }

                if(listitem == 4)
                    {
                    if(GetPlayerScore(playerid) >= 800)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Mercenary as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Mercenary Class Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, can fly sea sparrow.\n\n{F81414}Weapons:\n\n{FFFFFF}Tec-9\n{FFFFFF}Colt\n{FFFFFF}Knife\n{FFFFFF}Moltov", "OK","");
                        gPlayerClass[playerid] = MERCENARY;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 4, 1);
                        GivePlayerWeapon(playerid, 32, 2000);
                        GivePlayerWeapon(playerid, 22, 700);
                        GivePlayerWeapon(playerid, 18, 2);
                        }
                    else
            {
                SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 5 to get this Class.");

                ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
                TogglePlayerControllable(playerid, 0);
                }
            }

                if(listitem == 5)
                    {
                    if(GetPlayerScore(playerid) >= 1500)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Jet Trooper as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Jet Trooper Class:", "{F81414}Abilities:\n{FFFFFF}A Airforce class, Very Good in Air. Can drive Hunter, Hydra & Sea Sparrow.\n\n{F81414}Weapons:\n\n{FFFFFF}Deagle\n{FFFFFF}Tear Gas\n{FFFFFF}Shotgun\n{FFFFFF}9mm", "OK","");
                        gPlayerClass[playerid] = JETTROOPER;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 22, 300);
                        GivePlayerWeapon(playerid, 24, 400);
                        GivePlayerWeapon(playerid, 17, 4);
                        GivePlayerWeapon(playerid, 25, 200);
                        }
                       
                        else
            {
                SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 7 to get this Class.");

                ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
                TogglePlayerControllable(playerid, 0);
                }
            }

                if(listitem == 6)
                    {
                    if(GetPlayerScore(playerid) >= 2000)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "Server News: You Chose the Pilot as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Pilot Class:", "{F81414}Abilities:\n{FFFFFF}A Airforce class, Very Good in Air. Can drive Hunter, Hydra & Sea Sparrow.\n\n{F81414}Weapons:\n\n{FFFFFF}Deagle\n{FFFFFF}Tear Gas\n{FFFFFF}Shotgun\n{FFFFFF}9mm", "OK","");
                        gPlayerClass[playerid] = PILOT;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 22, 300);
                        GivePlayerWeapon(playerid, 24, 400);
                        GivePlayerWeapon(playerid, 17, 4);
                        GivePlayerWeapon(playerid, 25, 200);
                        }

                        else
            {
                SendClientMessage(playerid,COLOR_DARKRED,"You need to be on Rank 8 to get this Class.");

                ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
                TogglePlayerControllable(playerid, 0);
                }
            }

                return 1;
        }
                return 1;
    }
And Here:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gPlayerFirstSpawn[playerid]==0)
    {
    gPlayerFirstSpawn[playerid] = 1;
   
    ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 2) \nMedic Class  (Need Rank 3)  \nEngineer Class  (Need Rank 4) \nMercenary Class  (Need Rank 5 )  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8) ", "Choose","");
    TogglePlayerControllable(playerid, 0);
    }
    else
    {
      ResetPlayerWeapons(playerid);
     
      switch(gPlayerClass[playerid])
        {

            case ASSAULT:
            {
                GivePlayerWeapon(playerid, 4, 1);
                GivePlayerWeapon(playerid, 27, 500);
                GivePlayerWeapon(playerid, 24, 500);
                GivePlayerWeapon(playerid, 31, 700);
            }
            case SNIPER:
            {
                GivePlayerWeapon(playerid, 4, 1);
                GivePlayerWeapon(playerid, 34, 400);
                GivePlayerWeapon(playerid, 25, 200);
                GivePlayerWeapon(playerid, 33, 300);
            }
            case MEDIC:
            {
                GivePlayerWeapon(playerid, 27, 400);
                GivePlayerWeapon(playerid, 23, 400);
                GivePlayerWeapon(playerid, 35, 2);
                GivePlayerWeapon(playerid, 24, 300);
            }
            case ENGINEER:
            {
                GivePlayerWeapon(playerid, 4, 1);
                GivePlayerWeapon(playerid, 32, 1000);
                GivePlayerWeapon(playerid, 22, 700);
                GivePlayerWeapon(playerid, 18, 2);
            }
            case MERCENARY:
            {
                GivePlayerWeapon(playerid, 4, 1);
                GivePlayerWeapon(playerid, 32, 2000);
                GivePlayerWeapon(playerid, 22, 700);
                GivePlayerWeapon(playerid, 18, 2);
            }
            case JETTROOPER:
            {
                GivePlayerWeapon(playerid, 22, 300);
                GivePlayerWeapon(playerid, 24, 400);
                GivePlayerWeapon(playerid, 17, 4);
                GivePlayerWeapon(playerid, 32, 3000);
            }
            case PILOT:
            {
                GivePlayerWeapon(playerid, 22, 300);
                GivePlayerWeapon(playerid, 24, 400);
                GivePlayerWeapon(playerid, 17, 4);
                GivePlayerWeapon(playerid, 25, 200);

            }
        }
    }
    SetPlayerVirtualWorld(playerid, 0);
   
    SetPlayerHealth(playerid,99999);
    SetTimerEx("SpawnKill",10000,0,"i",playerid);
   
    return 1;
}
Now what messed up??
Reply


Messages In This Thread
Need help in /switchclass - by iOmar - 16.08.2012, 20:19
Re: Need help in /switchclass - by Sandiel - 16.08.2012, 20:28
Re: Need help in /switchclass - by iOmar - 16.08.2012, 23:13
Re: Need help in /switchclass - by CROSS_Hunter - 16.08.2012, 23:58
Re: Need help in /switchclass - by iOmar - 17.08.2012, 01:15
Re: Need help in /switchclass - by CROSS_Hunter - 17.08.2012, 01:28
Re: Need help in /switchclass - by iOmar - 17.08.2012, 07:15
Re: Need help in /switchclass - by iOmar - 17.08.2012, 07:25
Re: Need help in /switchclass - by Dan. - 17.08.2012, 08:50
Re: Need help in /switchclass - by iOmar - 17.08.2012, 09:58

Forum Jump:


Users browsing this thread: 2 Guest(s)