Textdraw clickable problem
#1

Ok guys, i made a menu with clickable textdraws where it shows some categories of the shop. (Vehicles, Weapons, Vip Vehicles etc).

The problem is, if i click on the "Vehicles", the category textdraws doesn't hide. Even if i click "Weapons" or "Vip Vehicles".

This is an example code:

pawn Код:
if(clickedid == ShopMenu2) //Vehicles
            {
            RespPlayerMenuHide(playerid);
            VipVehMenuHide(playerid);
            RespPlayerWepMenuHide(playerid);
            WeaponsMenuHide(playerid);
            VipWepMenuHide(playerid);
            CancelSelectTextDraw(playerid);
            TextDrawShowForPlayer(playerid, VehiclesTxd0);
            TextDrawShowForPlayer(playerid, VehiclesTxd1);
            TextDrawShowForPlayer(playerid, VehiclesTxd2);
            TextDrawShowForPlayer(playerid, VehiclesTxd3);
            TextDrawShowForPlayer(playerid, VehiclesTxd4);
            TextDrawShowForPlayer(playerid, VehiclesTxd5);
            TextDrawShowForPlayer(playerid, VehiclesTxd6);
            TextDrawShowForPlayer(playerid, VehiclesTxd7);
            TextDrawShowForPlayer(playerid, VehiclesTxd8);
            TextDrawShowForPlayer(playerid, VehiclesTxd9);
            TextDrawShowForPlayer(playerid, VehiclesTxd10);
            TextDrawShowForPlayer(playerid, VehiclesTxd11);
            TextDrawShowForPlayer(playerid, VehiclesTxd12);
            SelectTextDraw(playerid, -1);
            }
I clicked the category "Vehicles", from the menu, im hiding the menu textdraws and showing vehicles textdraw (with the names of vehicles to buy). The problem is not hiding the MENU textdraws.

Stocks:

pawn Код:
stock RespPlayerMenuHide(playerid)
{
            TextDrawHideForPlayer(playerid, RespPlayerVeh0);
            TextDrawHideForPlayer(playerid, RespPlayerVeh1);
            TextDrawHideForPlayer(playerid, RespPlayerVeh2);
            TextDrawHideForPlayer(playerid, RespPlayerVeh3);
            TextDrawHideForPlayer(playerid, RespPlayerVeh4);
            TextDrawHideForPlayer(playerid, RespPlayerVeh5);
            TextDrawHideForPlayer(playerid, RespPlayerVeh6);
            return 1;
}

stock VipVehMenuHide(playerid)
{
            TextDrawHideForPlayer(playerid, VipVeh0);
            TextDrawHideForPlayer(playerid, VipVeh1);
            TextDrawHideForPlayer(playerid, VipVeh2);
            TextDrawHideForPlayer(playerid, VipVeh3);
            TextDrawHideForPlayer(playerid, VipVeh4);
            TextDrawHideForPlayer(playerid, VipVeh5);
            TextDrawHideForPlayer(playerid, VipVeh6);
            TextDrawHideForPlayer(playerid, VipVeh7);
            TextDrawHideForPlayer(playerid, VipVeh8);
            return 1;
}

stock RespPlayerWepMenuHide(playerid)
{
            TextDrawHideForPlayer(playerid, RespPlayerWep0);
            TextDrawHideForPlayer(playerid, RespPlayerWep1);
            TextDrawHideForPlayer(playerid, RespPlayerWep2);
            TextDrawHideForPlayer(playerid, RespPlayerWep3);
            TextDrawHideForPlayer(playerid, RespPlayerWep4);
            TextDrawHideForPlayer(playerid, RespPlayerWep5);
            return 1;
}

stock VehiclesMenuHide(playerid)
{
            TextDrawHideForPlayer(playerid, VehiclesTxd0);
            TextDrawHideForPlayer(playerid, VehiclesTxd1);
            TextDrawHideForPlayer(playerid, VehiclesTxd2);
            TextDrawHideForPlayer(playerid, VehiclesTxd3);
            TextDrawHideForPlayer(playerid, VehiclesTxd4);
            TextDrawHideForPlayer(playerid, VehiclesTxd5);
            TextDrawHideForPlayer(playerid, VehiclesTxd6);
            TextDrawHideForPlayer(playerid, VehiclesTxd7);
            TextDrawHideForPlayer(playerid, VehiclesTxd8);
            TextDrawHideForPlayer(playerid, VehiclesTxd9);
            TextDrawHideForPlayer(playerid, VehiclesTxd10);
            TextDrawHideForPlayer(playerid, VehiclesTxd11);
            TextDrawHideForPlayer(playerid, VehiclesTxd12);
            return 1;
}

stock WeaponsMenuHide(playerid)
{
            TextDrawHideForPlayer(playerid, WeaponsTxd0);
            TextDrawHideForPlayer(playerid, WeaponsTxd1);
            TextDrawHideForPlayer(playerid, WeaponsTxd2);
            TextDrawHideForPlayer(playerid, WeaponsTxd3);
            TextDrawHideForPlayer(playerid, WeaponsTxd4);
            TextDrawHideForPlayer(playerid, WeaponsTxd5);
            TextDrawHideForPlayer(playerid, WeaponsTxd6);
            TextDrawHideForPlayer(playerid, WeaponsTxd7);
            TextDrawHideForPlayer(playerid, WeaponsTxd8);
            TextDrawHideForPlayer(playerid, WeaponsTxd9);
            TextDrawHideForPlayer(playerid, WeaponsTxd10);
            TextDrawHideForPlayer(playerid, WeaponsTxd11);
            TextDrawHideForPlayer(playerid, WeaponsTxd12);
            TextDrawHideForPlayer(playerid, WeaponsTxd13);
            return 1;
}

stock VipWepMenuHide(playerid)
{
            TextDrawHideForPlayer(playerid, VipWep0);
            TextDrawHideForPlayer(playerid, VipWep1);
            TextDrawHideForPlayer(playerid, VipWep2);
            TextDrawHideForPlayer(playerid, VipWep3);
            TextDrawHideForPlayer(playerid, VipWep4);
            TextDrawHideForPlayer(playerid, VipWep5);
            return 1;
}
Reply
#2

Bump.
Reply
#3

so you mean 2 menus are showing in the same time, General buy stuff menu and the other clicked menu stuff?
Reply
#4

Yes.
Reply
#5

Try without stocks.. it will be messy but let's try..
Reply
#6

Emh maybe you don't got what im saying.

I have menu textdraws, which list (example):

Weapons
Vip Vehicles
Vip Weapons

If i click on "Weapons", i wanna hide this menu, and show the weapons list, which is what i already do, but for some reason the menu textdraw doesn't hide.
Reply
#7

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(_:clickedid != INVALID_TEXT_DRAW) // If the player clicked a valid textdraw, continue with the coding. (_:var removes the Text: tag, to avoid tag mismatch)
    {
        if(clickedid == A)
        {
            // Do something
        }
        else if(clickedid == B)
        {
            // Do something
        }
        TextDrawHideForPlayer(playerid, A);
        TextDrawHideForPlayer(playerid, B);
        CancelSelectTextDraw(playerid); // This will indeed call OnPlayerClickTextDraw again, but with an ID of 65535. The code above stops it from resulting in an eternal loop.
    }
    return 1;
}
Reply
#8

Doesn't work. It doesn't hide the textdraws menu.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)