Syntax
function onPickupExited( player, pickup )
Example
function onPickupExited( player, pickup )
{
if ( pickup.Model == 408 )
{
MessagePlayer( "You exited from pickup with model 408", player );
}
}
Source Code
function onScriptLoad()
{
LastPickup <- array(GetMaxPlayers(),null)
}
function onPlayerJoin( player )
{
LastPickup[player.ID] = null;
}
function onPickupPickedUp( player, pickup )
{
LastPickup[player.ID] = pickup;
}
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if (LastPickup[player.ID] != null)
{
local LP = LastPickup[player.ID];
local DistanceFromLastPickup = DistanceFromPoint( newX, newY, LP.Pos.x, LP.Pos.y).tointeger();
if (DistanceFromLastPickup > 0.5)
{
onPickupExited(player,LP)
LastPickup[player.ID] = null;
}
}
}
function onPickupExited( player,pickup )
{
MessagePlayer("Wow, new function!. It works...",player);
}
Isn't onPickupClaimPicked(player, pickup) the function when a player exists the pickup?
I think this is more useful for when pickup doesn't dissappear after you pick it up.
This way sonmez did makes pickup act like some sort of sphere/checkpoint
Quote from: Sebastian on Jan 07, 2021, 01:36 PMI think this is more useful for when pickup doesn't dissappear after you pick it up.
This way sonmez did makes pickup act like some sort of sphere/checkpoint
Exactly!
Quote from: SHy^ on Jan 07, 2021, 10:04 AMIsn't onPickupClaimPicked(player, pickup) the function when a player exists the pickup?
when you teleport the player with a checkpoint, that function won't work.
I did a lot of tests before
@Sonmez gj mate
We are getting closer step by step. Time to see revolution my partner. This event will help new coders.
Quote from: |ADMIN|Yankee on Jan 08, 2021, 11:54 AMWe are getting closer step by step. Time to see revolution my partner. This event will help new coders.
lmao what? By the way - where you got your profile pic? (lmao this is getting too off-topic)
Quote from: Athanatos on Jan 08, 2021, 06:02 PMQuote from: |ADMIN|Yankee on Jan 08, 2021, 11:54 AMWe are getting closer step by step. Time to see revolution my partner. This event will help new coders.
lmao what? By the way - where you got your profile pic? (lmao this is getting too off-topic)
This is a private question :D Send me a message.
Good work.