21.12.2012, 22:03
Hello everybody !
I've a little problem with a BoatLicence i tried to made.
When the player is at the school to get it : the dialog box don't show up, and I don't know why.
Here is the full code of the dialog id n°83 :
Thanks in advance !
I've a little problem with a BoatLicence i tried to made.
When the player is at the school to get it : the dialog box don't show up, and I don't know why.
Here is the full code of the dialog id n°83 :
pawn Код:
if(dialogid==83)
{
new ActDialog=pTest_actualDialog[playerid];
if(ActDialog==-1)
{ // Boite par default
pTest_actualDialog[playerid]=0;
pTest_actualTest[playerid]=0;
if(!response)
{return 1;}
new SelectedTest=listitem+1;
if(SelectedTest==TEST_CARLIC)
{ // Vehicule
if(PlayerInfo[playerid][pCarLic]!=0)
{SendClientMessage(playerid, COLOR_STATS, "[Licence] You already have your driver licence."); return 1;}
new permiscar;
if(PlayerInfo[playerid][pOrigin] == 1)
{
permiscar = mairie[permis_car_sf];
}
else if(PlayerInfo[playerid][pOrigin] == 2)
{
permiscar = mairie[permiscar_ls];
}
else if(PlayerInfo[playerid][pOrigin] == 3)
{
permiscar = mairie[permis_car_lv];
}
else if(PlayerInfo[playerid][pOrigin] == 4)
{
permiscar = mairie[permis_car_fc];
}
else if(PlayerInfo[playerid][pOrigin] == 5)
{
permiscar = mairie[permis_car_bs];
}
if(PlayerInfo[playerid][pCash]<permiscar)
{
new string[MAX_STRING_MSG];
format(string,sizeof(string),"[Licence] The driver licence cost %d$, you don't have enough money.",permiscar);
SendClientMessage(playerid, COLOR_STATS, string);
return 1;
}
disableCheckpoint(playerid);
pay_tempPrice[playerid] = permiscar;
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 1;
pay_showDialog(playerid,permiscar);
}
else if(SelectedTest==TEST_PTCARLIC)
{ // Rattrapage
if(PlayerInfo[playerid][pCarLic]==0)
{SendClientMessage(playerid, COLOR_STATS, "[Licence] You don't have the driver licence."); return 1;}
if(PlayerInfo[playerid][pLicencePoint]+NBR_PTPERMIS>LICENCE_MAX_POINTS)
{SendClientMessage(playerid, COLOR_STATS, "[Licence] You have enough points."); return 1;}
new priceTotal=PRIX_PTPERMIS*NBR_PTPERMIS;
pay_tempPrice[playerid] = priceTotal;
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 4;
pay_showDialog(playerid, priceTotal);
}
else if(SelectedTest==TEST_FLYLIC)
{ // Vol
if(PlayerInfo[playerid][pFlyLic]!=0)
{SendClientMessage(playerid, COLOR_STATS, "[Licence] You already have your fly licence."); return 1;}
new pricepermis;
if(PlayerInfo[playerid][pOrigin] == 1)
{
pricepermis = mairie[permis_fly_sf];
}
else if(PlayerInfo[playerid][pOrigin] == 2)
{
pricepermis = mairie[permis_fly_ls];
}
else if(PlayerInfo[playerid][pOrigin] == 3)
{
pricepermis = mairie[permis_fly_lv];
}
else if(PlayerInfo[playerid][pOrigin] == 4)
{
pricepermis = mairie[permis_fly_fc];
}
else if(PlayerInfo[playerid][pOrigin] == 5)
{
pricepermis = mairie[permis_fly_bs];
}
if(PlayerInfo[playerid][pCash]<pricepermis)
{
new string[MAX_STRING_MSG];
format(string,sizeof(string),"[Licence] The fly licence cost %d$, you don't have enough money.",pricepermis);
SendClientMessage(playerid, COLOR_STATS, string);
return 1;
}
pay_tempPrice[playerid] = pricepermis;
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 2;
pay_showDialog(playerid, pricepermis);
}
// HERE START THE BOAT LICENCE
// HERE START THE BOAT LICENCE
// HERE START THE BOAT LICENCE
else if(SelectedTest==TEST_BOATLIC)
{ // Bateau
if(PlayerInfo[playerid][pBoatLic]!=0)
{SendClientMessage(playerid, COLOR_STATS, "[Licence] You already have your Boat Licence."); return 1;}
new pricepermis;
if(PlayerInfo[playerid][pOrigin] == 1)
{
pricepermis = mairie[permis_boat_sf];
}
else if(PlayerInfo[playerid][pOrigin] == 2)
{
pricepermis = mairie[permis_boat_ls];
}
else if(PlayerInfo[playerid][pOrigin] == 3)
{
pricepermis = mairie[permis_boat_lv];
}
else if(PlayerInfo[playerid][pOrigin] == 4)
{
pricepermis = mairie[permis_boat_fc];
}
else if(PlayerInfo[playerid][pOrigin] == 5)
{
pricepermis = mairie[permis_boat_bs];
}
if(PlayerInfo[playerid][pCash]<pricepermis)
{
new string[MAX_STRING_MSG];
format(string,sizeof(string),"[Licence] The Boat licence cost %d$, you don't have enough money.",pricepermis);
SendClientMessage(playerid, COLOR_STATS, string);
return 1;
}
pay_tempPrice[playerid] = pricepermis;
pay_tempType[playerid] = 10;
pay_tempArticle[playerid] = 3;
pay_showDialog(playerid, pricepermis);
}
return 1;
// IT ENDS HERE
// IT ENDS HERE
// IT ENDS HERE
}
else if(ActDialog>0 && ActDialog<10)
{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]);}
}
}
Thanks in advance !