SA-MP Forums Archive
OnPlayerPickupDynamicPickup 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: OnPlayerPickupDynamicPickup help (/showthread.php?tid=396703)



OnPlayerPickupDynamicPickup help - Bu$ter - 01.12.2012

Hello all

Umm i got lil problem. So far i have this code which works (opens the textdraw when i reach the pdenter pickup)

pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    if(pickupid == pdenter)
    {
        TextDrawShowForPlayer(playerid, Textdraw0);
    }
  }
However, i would like to close the textdraw automatically when player leaves far enough from the pickup. I guess this should be done somehow with IsPlayerInRangeOfPoint & TextDrawHideForPlayer? Tried already some ways to fix, however the textdraw keeps staying on the window.


Re: OnPlayerPickupDynamicPickup help - XtremeR - 01.12.2012

You need a thing like OnPlayerLeaveDynamicPickup, so you Goto your on OnPlayerPickUpDynamicPickup set a repetitive timer for and check if(!IsPlayerInRangeOfPoint(playerid)).


Re: OnPlayerPickupDynamicPickup help - Bu$ter - 01.12.2012

Thanks alot for your help m8, got it working now , Rep+