24.08.2017, 15:26
Hi guys, I use include mSelection to make a vehicle list but this bug appears. When I click a model, the textdraws of mSelection disappears and I show my color menu textdraw for the player but somehow, it hides my color menu too.
PHP код:
public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
switch(extraid)
{
case MODEL_SELECTION_UNIQUE:
{
new index;
for(new i = 0; i < sizeof(a_Unique); i++)
{
if(a_Unique[i][Model] == modelid)
{
index = i;
break;
}
}
SetPVarInt(playerid, "d_VehicleModelConfirmed", modelid);
SetPVarInt(playerid, "d_VehiclePriceConfirmed", a_Unique[index][Price]);
process_showing_colormenu:
PlayerTextDrawColor(playerid, dealership_ColorMenu[3], 0x000000FF);
PlayerTextDrawColor(playerid, dealership_ColorMenu[4], 0x000000FF);
PlayerTextDrawShow(playerid, dealership_ColorMenu[0]);
PlayerTextDrawShow(playerid, dealership_ColorMenu[1]);
PlayerTextDrawShow(playerid, dealership_ColorMenu[2]);
PlayerTextDrawShow(playerid, dealership_ColorMenu[3]);
PlayerTextDrawShow(playerid, dealership_ColorMenu[4]);
PlayerTextDrawShow(playerid, dealership_ColorMenu[5]);
PlayerTextDrawShow(playerid, dealership_ColorMenu[6]);
SelectTextDraw(playerid, COLOR_LIGHTGREEN);
}
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW)
{
else if(GetPVarType(playerid, "d_VehicleModelConfirmed"))
{
SelectTextDraw(playerid, COLOR_LIGHTGREEN);
print("dfafdafsd"); // It prints "dfafdafsd" in the console
DeletePVar(playerid, "d_VehicleModelConfirmed");
DeletePVar(playerid, "d_VehiclePriceConfirmed");
DeletePVar(playerid, "Color1Index");
DeletePVar(playerid, "Color2Index");
PlayerTextDrawHide(playerid, dealership_ColorMenu[0]);
PlayerTextDrawHide(playerid, dealership_ColorMenu[1]);
PlayerTextDrawHide(playerid, dealership_ColorMenu[2]);
PlayerTextDrawHide(playerid, dealership_ColorMenu[3]);
PlayerTextDrawHide(playerid, dealership_ColorMenu[4]);
PlayerTextDrawHide(playerid, dealership_ColorMenu[5]);
PlayerTextDrawHide(playerid, dealership_ColorMenu[6]);
}
}
return 1;
}