SA-MP Forums Archive
Timer or OnPlayerUpdate? - 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: Timer or OnPlayerUpdate? (/showthread.php?tid=369271)



Timer or OnPlayerUpdate? - Kyra - 16.08.2012

Hello, i want optimize my script

I did a system for pick pickup when players are on a vehicle, i used IsPlayerInRangeOfPoint but i want know if i use a timer 500 ms or i use OnPlayerUpdate for detect when a player is near a pickup. One timer at 500 ms is good for detect this?


Re: Timer or OnPlayerUpdate? - leonardo1434 - 16.08.2012

https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup


Re : Timer or OnPlayerUpdate? - Kyra - 16.08.2012

No i used Pickup Pickupable when in a vehicle, PickupTypes 14 is dosnt good


Re: Timer or OnPlayerUpdate? - leonardo1434 - 16.08.2012

then i would recommend you start using a settimer instead of callback onplayerupdate.


Re: Timer or OnPlayerUpdate? - [MM]RoXoR[FS] - 16.08.2012

Use streamer
pawn Код:
native CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamicPickup(pickupid);
native IsValidDynamicPickup(pickupid);
native DestroyAllDynamicPickups();
native CountDynamicPickups();



Re: Timer or OnPlayerUpdate? - Kyle - 16.08.2012

Use pickup ID 1, create a rectangle around the x,y,z and then when they leave the rectangle with a radius of 1 that's when they leave the pickup.


Re: Timer or OnPlayerUpdate? - MP2 - 16.08.2012

Just use pickups like they're meant to be used. Use the 'pickupable from vehicles' type.


Re : Timer or OnPlayerUpdate? - Kyra - 16.08.2012

My problem is if i used 'pickupable from vehicles' type he destroy pickup when i take the pickup, maybe it would recreate the pickup when i take a pickup with a vehicle? And Other 'pickupable from vehicles' Dosent detect when i take a pickup whith a vehicle