Help?!?
#1

So i have an issue that it won't remove the TextDraw for me, I have a confirm think where it says "Are yousure you want to buy this vehicle" If i press that i want to buy it the TextDraw Dissipears, but if i click "No" the textdraw will still be there?

Код:
	if(dialogid == DIALOG_CARS)
	{
 		if(response)
		{
				if (GetPlayerCash(playerid) >= 10000)
				{
					GivePlayerCash(playerid, -10000);
					new playervehicleid = GetPlayerFreeVehicleId(playerid);
					CreatePlayerVehicle(playerid, playervehicleid, 405, 2172.1597,1391.7802,10.8203, 90.0000, 0, 0, 0);
					SendClientMessage(playerid, COLOR_GRAD1, "You have bought a Sentinel");
					VehicleSpawned[playerid] = 1;
					TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
					return 1;
				}
				else
				{
					TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
					ShowPlayerDialogEx(playerid, 6774, DIALOG_STYLE_LIST, "Choose a car you would like to buy","Bravura\nSentinel","Buy/Preview", "Cancel");
				}
		}
	}
Reply
#2

Код:
	if(dialogid == DIALOG_CARS)
	{
 		if(response)
		{
				if (GetPlayerCash(playerid) >= 10000)
				{
					GivePlayerCash(playerid, -10000);
					new playervehicleid = GetPlayerFreeVehicleId(playerid);
					CreatePlayerVehicle(playerid, playervehicleid, 405, 2172.1597,1391.7802,10.8203, 90.0000, 0, 0, 0);
					SendClientMessage(playerid, COLOR_GRAD1, "You have bought a Sentinel");
					VehicleSpawned[playerid] = 1;
					TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
					return 1;
				}
				else
				{
					TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
					ShowPlayerDialogEx(playerid, 6774, DIALOG_STYLE_LIST, "Choose a car you would like to buy","Bravura\nSentinel","Buy/Preview", "Cancel");
				}
		}
	}
Remove that line I highlighted in bold. Since you have TextDrawHideForPlayer there, it will hide the textdraw.
Reply
#3

pawn Код:
if(dialogid == DIALOG_CARS)
    {
        if(response)
        {
                if (GetPlayerCash(playerid) >= 10000)
                {
                    GivePlayerCash(playerid, -10000);
                    new playervehicleid = GetPlayerFreeVehicleId(playerid);
                    CreatePlayerVehicle(playerid, playervehicleid, 405, 2172.1597,1391.7802,10.8203, 90.0000, 0, 0, 0);
                    SendClientMessage(playerid, COLOR_GRAD1, "You have bought a Sentinel");
                    VehicleSpawned[playerid] = 1;
                    TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
                    return 1;
                }
                else
                {
                    TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
                    ShowPlayerDialogEx(playerid, 6774, DIALOG_STYLE_LIST, "Choose a car you would like to buy","Bravura\nSentinel","Buy/Preview", "Cancel");
                }
        }
        else
            TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
    }
You forgot to hide the textdraw when the player clicks "No" (response = 0).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)