Timer or OnPlayerUpdate?
#1

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

https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
Reply
#3

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

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

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();
Reply
#6

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

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

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)