Skill Selection
#1

So i made a skill selection all of the skills are working fine except the Engineer and Sniper but i dont know why after i try to pick it, it returns me to the dialog when i have my score set can anyone help me

pawn Код:
if(dialogid == DIALOG_SKILL)
    {
       if(response)
       {
          if(listitem == 0)
          {
             GivePlayerWeapon(playerid,4,0);
             GivePlayerWeapon(playerid,16,2);
             GivePlayerWeapon(playerid,23,400);
             GivePlayerWeapon(playerid,31,700);
             GivePlayerWeapon(playerid,46,1);
             SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Assault kit");
          }  
          if(listitem == 1)
          {
             if(GetPlayerScore(playerid) != 150) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             {           
                GivePlayerWeapon(playerid,4,0);
                GivePlayerWeapon(playerid,24,500);
                GivePlayerWeapon(playerid,27,300);
                GivePlayerWeapon(playerid,34,500);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Sniper kit");
             }
          }
          if(listitem == 2)
          {
             if(GetPlayerScore(playerid) != 300) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             {
                GivePlayerWeapon(playerid,24,500);
                GivePlayerWeapon(playerid,27,400);
                GivePlayerWeapon(playerid,28,600);
                GivePlayerWeapon(playerid,30,400);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Engineer kit");
                Engineer[playerid] =1;
             }
             
          }
          if(listitem == 3)
          {
             if(GetPlayerScore(playerid) == 550) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             {
                GivePlayerWeapon(playerid,24,600);
                GivePlayerWeapon(playerid,26,280);
                GivePlayerWeapon(playerid,36,10);
                GivePlayerWeapon(playerid,31,500);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Pilot kit");
                Pilot[playerid] =1;
             }
          }
          if(listitem == 4)
          {
             if(GetPlayerScore(playerid) == 700) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             {
                GivePlayerWeapon(playerid,38,200);
                GivePlayerWeapon(playerid,26,500);
                GivePlayerWeapon(playerid,31,800);
                GivePlayerWeapon(playerid,36,30);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Gunner kit");
             }
          }          
          if(listitem == 5)
          {
             ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
          }
        }
    }
Reply
#2

EDITED: i think you have forgot this:
pawn Код:
if(dialogid == DIALOG_SKILL)
    {
       if(response)
       {
          if(listitem == 0)
          {
             GivePlayerWeapon(playerid,4,0);
             GivePlayerWeapon(playerid,16,2);
             GivePlayerWeapon(playerid,23,400);
             GivePlayerWeapon(playerid,31,700);
             GivePlayerWeapon(playerid,46,1);
             SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Assault kit");
          }
          if(listitem == 1)
          {
             if(GetPlayerScore(playerid) != 150)
             {
                GivePlayerWeapon(playerid,4,0);
                GivePlayerWeapon(playerid,24,500);
                GivePlayerWeapon(playerid,27,300);
                GivePlayerWeapon(playerid,34,500);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Sniper kit");
             }
          }
          if(listitem == 2)
          {
             if(GetPlayerScore(playerid) != 300)
             {
                GivePlayerWeapon(playerid,24,500);
                GivePlayerWeapon(playerid,27,400);
                GivePlayerWeapon(playerid,28,600);
                GivePlayerWeapon(playerid,30,400);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Engineer kit");
                Engineer[playerid] =1;
             }

          }
          if(listitem == 3)
          {
             if(GetPlayerScore(playerid) == 550)
             {
                GivePlayerWeapon(playerid,24,600);
                GivePlayerWeapon(playerid,26,280);
                GivePlayerWeapon(playerid,36,10);
                GivePlayerWeapon(playerid,31,500);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Pilot kit");
                Pilot[playerid] =1;
             }
          }
          if(listitem == 4)
          {
             if(GetPlayerScore(playerid) == 700)
             {
                GivePlayerWeapon(playerid,38,200);
                GivePlayerWeapon(playerid,26,500);
                GivePlayerWeapon(playerid,31,800);
                GivePlayerWeapon(playerid,36,30);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Gunner kit");
             }
          }
          if(listitem == 5)
          {
          ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
          }
        }
    }
Reply
#3

But the whole point of it to return the player to the dialog if he dosent have the score that is required
Reply
#4

like this?
pawn Код:
if(dialogid == DIALOG_SKILL)
    {
       if(response)
       {
          if(listitem == 0)
          {
             GivePlayerWeapon(playerid,4,0);
             GivePlayerWeapon(playerid,16,2);
             GivePlayerWeapon(playerid,23,400);
             GivePlayerWeapon(playerid,31,700);
             GivePlayerWeapon(playerid,46,1);
             SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Assault kit");
          }
          if(listitem == 1)
          {

             if(GetPlayerScore(playerid) < 150) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             else if(GetPlayerScore(playerid) >= 150)
             {
                GivePlayerWeapon(playerid,4,0);
                GivePlayerWeapon(playerid,24,500);
                GivePlayerWeapon(playerid,27,300);
                GivePlayerWeapon(playerid,34,500);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Sniper kit");
             }
          }
          if(listitem == 2)
          {
             if(GetPlayerScore(playerid) < 300) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             else if(GetPlayerScore(playerid) >= 300)
             {
                GivePlayerWeapon(playerid,24,500);
                GivePlayerWeapon(playerid,27,400);
                GivePlayerWeapon(playerid,28,600);
                GivePlayerWeapon(playerid,30,400);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Engineer kit");
                Engineer[playerid] =1;
             }

          }
          if(listitem == 3)
          {
             if(GetPlayerScore(playerid) < 550) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             else if(GetPlayerScore(playerid) >= 550)
             {
                GivePlayerWeapon(playerid,24,600);
                GivePlayerWeapon(playerid,26,280);
                GivePlayerWeapon(playerid,36,10);
                GivePlayerWeapon(playerid,31,500);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Pilot kit");
                Pilot[playerid] =1;
             }
          }
          if(listitem == 4)
          {
             if(GetPlayerScore(playerid) < 700) return ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
             else if(GetPlayerScore(playerid) >= 700)
             {
                GivePlayerWeapon(playerid,38,200);
                GivePlayerWeapon(playerid,26,500);
                GivePlayerWeapon(playerid,31,800);
                GivePlayerWeapon(playerid,36,30);
                SendClientMessage(playerid,COLOR_ORANGE,"You have successfully chosen Gunner kit");
             }
          }
          if(listitem == 5)
          {
          ShowPlayerDialog(playerid,DIALOG_SKILL,DIALOG_STYLE_LIST,"Select your skill","Assault - Free\nSniper - 150 score\nEngineer - 300 score\nPilot - 550 score\nGunner - 700 score","Ok","");
          }
        }
    }
Reply
#5

Thank you very much +REPED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)