How to avoid this bug?
#1

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(playeridresponseextraidmodelid)
{
    switch(
extraid)
    {
        case 
MODEL_SELECTION_UNIQUE:
        {
            new 
index;
            for(new 
0sizeof(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(playeriddealership_ColorMenu[3], 0x000000FF);
            
PlayerTextDrawColor(playeriddealership_ColorMenu[4], 0x000000FF);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[0]);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[1]);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[2]);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[3]);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[4]);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[5]);
            
PlayerTextDrawShow(playeriddealership_ColorMenu[6]);
            
SelectTextDraw(playeridCOLOR_LIGHTGREEN);
        }
    }
    return 
1;
}
public 
OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == Text:INVALID_TEXT_DRAW)
    {
        else if(
GetPVarType(playerid"d_VehicleModelConfirmed"))
        {
            
SelectTextDraw(playeridCOLOR_LIGHTGREEN);
            print(
"dfafdafsd"); // It prints "dfafdafsd" in the console
            
DeletePVar(playerid"d_VehicleModelConfirmed");
            
DeletePVar(playerid"d_VehiclePriceConfirmed");
            
DeletePVar(playerid"Color1Index");
            
DeletePVar(playerid"Color2Index");
            
PlayerTextDrawHide(playeriddealership_ColorMenu[0]);
            
PlayerTextDrawHide(playeriddealership_ColorMenu[1]);
            
PlayerTextDrawHide(playeriddealership_ColorMenu[2]);
            
PlayerTextDrawHide(playeriddealership_ColorMenu[3]);
            
PlayerTextDrawHide(playeriddealership_ColorMenu[4]);
            
PlayerTextDrawHide(playeriddealership_ColorMenu[5]);
            
PlayerTextDrawHide(playeriddealership_ColorMenu[6]);
        }
    }        
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)