Pickup Teleports (Too fast!)
#1

I've been having a tinker around again, to find myself with a problem. I'm trying to make pickups to teleport players between exterior/interior. That in itself is relatively simple. The issue I'm having is that they transport from the exterior, onto the interior pickup. Getting thrown instantly back outside again.

The most simple cure, would be to move the interior pickup. But I'm confident there must be a way around this, much more efficiently. I tried creating a timer to throw them outside, but my public function must of been defective as it didn't recognize the pickupid. I used SendClientMessage to see how far the process was going as a form of tracking. Either way, there must be a more efficient way than OnPlayerPickUpPickup firing off several timers waiting for a hit?

Perhaps the solution involves GetPlayerPos & a timer. I'm not sure. I need to slow it down so players don't get thrown back outside.

Any suggestions would be highly appreciated & I thank you in advance.
Reply
#2

I'm not quite sure what you're saying, but I assume you mean that you're wanting a pickup to go from an interior to an exterior but are encountering a sort of issue.

If so, you should check out this function:

https://sampwiki.blast.hk/wiki/Function:SetPlayerInterior
Reply
#3

The easiest thing would be to teleport the player in front of the pickup, like the yellow markers in singleplayer

Otherwise you could use an variable which disables the next pickup which is most likely the teleport back
If you use the pickup type 23 (maybe 19, too) the pickup is pickupable but doesnt disappear
The variable would disable the first call and it should be possible after few seconds to pickup it up again
Reply
#4

Thank you for your assistance, I shall try changing the pickup type in just a second. Playing with NPC's for the first time right now.

Edit: Ok, I see what you mean now. It does indeed seem like the best solution is just to move the pickup locations. Positives means it'll be more reliable, negatives means I'll have a lot of co-ordinates to retake! Maybe I will try the variable!
Reply
#5

You can make a variable EnterTime[MAX_PLAYERS]; then do the following when entering or exiting....

#define ENTER_EXIT_DELAY 3000

EnterTime[playerid] = GetTickCount();

now simply do a check....

if(GetTickCount() - EnterTime[playerid] > ENTER_EXIT_DELAY)
{
// Valid activation
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)