05.06.2013, 18:16
Hey dudes.
Here is a dialog (for car license). I explain the problem: when i type the command, the dialog opens, ok.
But when a double click on a listitem, nothing happens. Why ?
Here is the code:
Here is a dialog (for car license). I explain the problem: when i type the command, the dialog opens, ok.
But when a double click on a listitem, nothing happens. Why ?
Here is the code:
pawn Код:
if(dialogid==83) // Boite а l'autoEcole
{
if(!response) return 1;
switch(listitem)
{
case 0:
{
new ActDialog=pTest_actualDialog[playerid];
if(ActDialog==-1)
{ // Boite par default
pTest_actualDialog[playerid]=0;
pTest_actualTest[playerid]=0;
//----------------------
if(PlayerInfo[playerid][pCarLic]!=0)
{SendClientMessage(playerid, COLOR_STATS, "[Permis] Vous avez dйja le permis de conduire."); return 1;}
if(PlayerInfo[playerid][pCash]<mairie[permis_car])
{
new string[MAX_STRING_MSG];
format(string,sizeof(string),"[Permis] Le passage du permis coute %d$, vous n'avez pas assez.",mairie[permis_car]);
SendClientMessage(playerid, COLOR_STATS, string);
return 1;
}
pay_tempPrice[playerid] = mairie[permis_car];
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 1;
pay_showDialog(playerid, mairie[permis_car]);
//------------------------------------------
}
else if(ActDialog>0 && ActDialog<10) // Affichage des diffйrents cours, tout est gerй par une fonction !
{
test_tutoGestionDialog(playerid,pTest_actualTest[playerid]);
}
else if(ActDialog>=10 && ActDialog<16) // Questions
{
if(ActDialog==10)
{
test_showQuestion(playerid,1,pTest_actualTest[playerid]);
}
else
{
test_responseQuestion(playerid,ActDialog-10,listitem,pTest_actualTest[playerid]);
}
}
}
case 1:
{ // Vol
new ActDialog=pTest_actualDialog[playerid];
if(ActDialog==-1)
{ // Boite par default
pTest_actualDialog[playerid]=0;
pTest_actualTest[playerid]=0;
//----------------------
if(PlayerInfo[playerid][pFlyLic]!=0)
{SendClientMessage(playerid, COLOR_STATS, "[Permis] Vous avez dйja votre licence de vol."); return 1;}
if(PlayerInfo[playerid][pCash]<mairie[permis_fly])
{
new string[MAX_STRING_MSG];
format(string,sizeof(string),"[Permis] L'obtention de la licence de vol coute %d$, vous n'avez pas assez.",mairie[permis_fly]);
SendClientMessage(playerid, COLOR_STATS, string);
return 1;
}
pay_tempPrice[playerid] = mairie[permis_fly];
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 2;
pay_showDialog(playerid, mairie[permis_fly]);
//------------------------------------------
}
else if(ActDialog>0 && ActDialog<10) // Affichage des diffйrents cours, tout est gerй par une fonction !
{
test_tutoGestionDialog(playerid,pTest_actualTest[playerid]);
}
else if(ActDialog>=10 && ActDialog<16) // Questions
{
if(ActDialog==10)
{
test_showQuestion(playerid,1,pTest_actualTest[playerid]);
}
else
{
test_responseQuestion(playerid,ActDialog-10,listitem,pTest_actualTest[playerid]);
}
}
}
case 2:
{ // Rattrapage
new ActDialog=pTest_actualDialog[playerid];
if(ActDialog==-1)
{ // Boite par default
pTest_actualDialog[playerid]=0;
pTest_actualTest[playerid]=0;
//----------------------
if(PlayerInfo[playerid][pCarLic]==0)
{SendClientMessage(playerid, COLOR_STATS, "[Permis] Vous n'avez pas le permis de conduire."); return 1;}
if(PlayerInfo[playerid][pLicencePoint]+NBR_PTPERMIS>LICENCE_MAX_POINTS)
{SendClientMessage(playerid, COLOR_STATS, "[Permis] Vous avez dйja suffisament de points."); return 1;}
new priceTotal=PRIX_PTPERMIS*NBR_PTPERMIS;
pay_tempPrice[playerid] = priceTotal;
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 3;
pay_showDialog(playerid, priceTotal);
//------------------------------------------
}
else if(ActDialog>0 && ActDialog<10) // Affichage des diffйrents cours, tout est gerй par une fonction !
{
test_tutoGestionDialog(playerid,pTest_actualTest[playerid]);
}
else if(ActDialog>=10 && ActDialog<16) // Questions
{
if(ActDialog==10)
{
test_showQuestion(playerid,1,pTest_actualTest[playerid]);
}
else
{
test_responseQuestion(playerid,ActDialog-10,listitem,pTest_actualTest[playerid]);
}
}
}
}
return 1;
}