Textdraw problem.
#1

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);
                            }
                        }
Reply
#2

Quote:

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

Here.
Reply
#3

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?
Reply
#4

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?
Reply
#5

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

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?
Reply
#7

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
Reply
#8

Quote:

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

try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)