01.05.2012, 09:56
Okay, I am trying to make a dialog list which if the player click on one of the weapons he should start a training;
To make it with this;
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;
}
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;
}