Help?!? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help?!? (
/showthread.php?tid=560258)
Help?!? -
Mark_Samp - 27.01.2015
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");
}
}
}
Re: Help?!? -
Sledgehammer - 27.01.2015
Код:
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.
Re: Help?!? -
PowerPC603 - 27.01.2015
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).