Help needed
#1

Okay, I am trying to make a dialog list which if the player click on one of the weapons he should start a training;
pawn Код:
if(strcmp(cmd, "/weapontraining", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,5,300.5705,-134.0464,1004.0625))
        {
            ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Weapon Training","Desert Eagle\nPump Shotgun\nSawn Off\nCombat Shotgun\nUzi\nMP5\nAK-47\nM4A1\n","Buy!", "Exit");
        }
        return 1;
    }
To make it with this;
pawn Код:
if(dialogid == 0) // Ammunation
        {
            if(response)
            {
                if(listitem == 1)
                {
                    if(GetPlayerMoney(playerid) > 49)
                    {
                        if(PlayerInfo[playerid][pPistSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Pistol Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainPistol", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 2)
                {
                    if(GetPlayerMoney(playerid) > 75)
                    {
                        if(PlayerInfo[playerid][pSilenSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Silenced Pistol Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainSilenced", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 3)
                {
                    if(GetPlayerMoney(playerid) > 150)
                    {
                        if(PlayerInfo[playerid][pDesertSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Deagle Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainDeagle", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 4)
                {
                    if(GetPlayerMoney(playerid) > 125)
                    {
                        if(PlayerInfo[playerid][pShotgSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Shotgun Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainShotgun", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 5)
                {
                    if(GetPlayerMoney(playerid) > 100)
                    {
                        if(PlayerInfo[playerid][pSawnSkill] < 800)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Sawn-Off Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainSawn", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 6)
                {
                    if(GetPlayerMoney(playerid) > 200)
                    {
                        if(PlayerInfo[playerid][pCombSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Combat Shotgun Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainCombat", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 7)
                {
                    if(GetPlayerMoney(playerid) > 125)
                    {
                        if(PlayerInfo[playerid][pUziSkill] < 800)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the Micro Sub Machine Gun Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainUzi", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 8)
                {
                    if(GetPlayerMoney(playerid) > 155)
                    {
                        if(PlayerInfo[playerid][pSmgSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the MP5 Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainSmg", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 9)
                {
                    if(GetPlayerMoney(playerid) > 140)
                    {
                        if(PlayerInfo[playerid][pAkSkill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the AK-47 Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainAk47", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
                else if(listitem == 10)
                {
                    if(GetPlayerMoney(playerid) > 140)
                    {
                        if(PlayerInfo[playerid][pM4Skill] < 1000)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: We are going to Start the M4 Training in a few Seconds");
                            TrainTimer[playerid] = SetTimerEx("TrainM4", 2500, false, "i", playerid);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "TRAINER: You are already an Expert with this weapon!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "TRAINER: You don't have enough money!");
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "You selected Cancel");
            }
            return 1;
        }
Reply


Messages In This Thread
Help needed - by HighPitchedVoice - 01.05.2012, 09:56
[No subject] - by HighPitchedVoice - 01.05.2012, 10:02
Re: Help needed - by HighPitchedVoice - 01.05.2012, 10:21
Re: Help needed - by MP2 - 01.05.2012, 12:42
Re: Help needed - by HighPitchedVoice - 01.05.2012, 12:47
Re: Help needed - by MP2 - 01.05.2012, 12:51
Re: Help needed - by HighPitchedVoice - 01.05.2012, 13:05
Re: Help needed - by MP2 - 01.05.2012, 13:11

Forum Jump:


Users browsing this thread: 3 Guest(s)