SA-MP Forums Archive
Textdraw problem. - 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: Textdraw problem. (/showthread.php?tid=600895)



Textdraw problem. - LSNKevin - 14.02.2016

Is there a way to hide the textdraws once a player has left the dynamic CP?

pawn Код:
for(new b = 0; b != MAX_BUSINESSES; b++) {
                    if(checkpointid == businessCP[b]) {
                        if(strfind(BusinessInfo[b][bOwner], "_") == -1) {
                            new content[100];
                            format(content, sizeof(content), "%i %s", BusinessInfo[b][bHousenumber], BusinessInfo[b][bStreet]);
                            PlayerTextDrawSetString(playerid, TD_AD_HousenumberStreet, content);
                            format(content, sizeof(content), "Los Angeles, SA %i", BusinessInfo[b][bBusinesszip]);
                            PlayerTextDrawSetString(playerid, TD_AD_CityZip, content);
                            format(content, sizeof(content), "$%i", BusinessInfo[b][bPrice]);
                            PlayerTextDrawSetString(playerid, TD_AD_PriceValue, content);
                            format(content, sizeof(content), "$%i/Payday", BusinessInfo[b][bTaxes]);
                            PlayerTextDrawSetString(playerid, TD_AD_TaxesValue, content);
                            PlayerTextDrawSetString(playerid, TD_AD_SellerValue, "Bank");
                            PlayerTextDrawSetString(playerid, TD_AD_Headline, "Business For Sale");
                            PlayerTextDrawSetString(playerid, TD_AD_Price, "Price:");
                            PlayerTextDrawSetString(playerid, TD_AD_Taxes, "Taxes:");

                            TextDrawShowForPlayer(playerid, TD_AD_HeadBox);
                            TextDrawShowForPlayer(playerid, TD_AD_BoxThree);
                            TextDrawShowForPlayer(playerid, TD_AD_Seller);
                            PlayerTextDrawShow(playerid, TD_AD_Price);
                            PlayerTextDrawShow(playerid, TD_AD_CityZip);
                            PlayerTextDrawShow(playerid, TD_AD_Headline);
                            PlayerTextDrawShow(playerid, TD_AD_Taxes);
                            PlayerTextDrawShow(playerid, TD_AD_PriceValue);
                            PlayerTextDrawShow(playerid, TD_AD_TaxesValue);
                            PlayerTextDrawShow(playerid, TD_AD_SellerValue);
                            PlayerTextDrawShow(playerid, TD_AD_HousenumberStreet);

                            PlayerTextDrawSetString(playerid, TD_Mid_Info, "~b~For Sale!~n~~w~Type ~g~/buybusiness ~w~to acquire~n~this business.");
                            PlayerTextDrawShow(playerid, TD_Mid_Info);
                        } else {
                            new content[100];
                            format(content, sizeof(content), "%i %s", BusinessInfo[b][bHousenumber], BusinessInfo[b][bStreet]);
                            PlayerTextDrawSetString(playerid, TD_AD_HousenumberStreet, content);
                            format(content, sizeof(content), "Los Angeles, SA %i", BusinessInfo[b][bBusinesszip]);
                            PlayerTextDrawSetString(playerid, TD_AD_CityZip, content);
                            PlayerTextDrawSetString(playerid, TD_AD_Headline, BusinessInfo[b][bName]);
                            PlayerTextDrawSetString(playerid, TD_AD_Price, "Status:");
                            PlayerTextDrawSetString(playerid, TD_AD_PriceValue, (BusinessInfo[b][bLocked] != 0) ? ("Closed") : ("Open"));

                            TextDrawShowForPlayer(playerid, TD_AD_HeadBox);
                            PlayerTextDrawShow(playerid, TD_AD_Price);
                            PlayerTextDrawShow(playerid, TD_AD_CityZip);
                            PlayerTextDrawShow(playerid, TD_AD_Headline);
                            PlayerTextDrawShow(playerid, TD_AD_PriceValue);
                            PlayerTextDrawShow(playerid, TD_AD_HousenumberStreet);

                            if(BusinessInfo[b][bFee] > 0) {
                                PlayerTextDrawSetString(playerid, TD_AD_Taxes, "Entrance Fee:");
                                format(content, sizeof(content), "$%i", BusinessInfo[b][bFee]);
                                PlayerTextDrawSetString(playerid, TD_AD_TaxesValue, content);
                                PlayerTextDrawShow(playerid, TD_AD_Taxes);
                                PlayerTextDrawShow(playerid, TD_AD_TaxesValue);
                                TextDrawShowForPlayer(playerid, TD_AD_BoxTwo);
                            } else {
                                TextDrawShowForPlayer(playerid, TD_AD_BoxOne);
                            }
                        }



Re: Textdraw problem. - Joron - 14.02.2016

Quote:

public OnPlayerExitDynamicCP(playerid, checkpointid)
{
if(checkpointid == businessCP[b])
{
Hide the textdraws

Here.


Re: Textdraw problem. - LSNKevin - 14.02.2016

I tried to C&P but it gave me a bunch of errors. Should I close it with return or am I doing anything wrong?


Re: Textdraw problem. - Joron - 14.02.2016

Quote:
Originally Posted by LSNKevin
Посмотреть сообщение
I tried to C&P but it gave me a bunch of errors. Should I close it with return or am I doing anything wrong?
Whats giving you a error your code or mine?


Re: Textdraw problem. - LSNKevin - 14.02.2016

The one you posted, I copy&pasted it, and I tried to close it with return 1; but still giving 26 errors.


Re: Textdraw problem. - LSNKevin - 14.02.2016

EDIT: I fixed it, but now the real issue. The checkpoint is being killed, so the script can't register the exiting of the checkpoint, any ideas, please?


Re: Textdraw problem. - Joron - 14.02.2016

Quote:
Originally Posted by LSNKevin
Посмотреть сообщение
EDIT: I fixed it, but now the real issue. The checkpoint is being killed, so the script can't register the exiting of the checkpoint, any ideas, please?
The checkpoint is being killed define that.. for me please


Re: Textdraw problem. - LovelySoomro - 14.02.2016

Quote:

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
return 1;
}

try this