IsPlayerLookingAtPickup
#1

Hello guys,

is there any way to checki if player is looking at pickup or even if he is close to the pickup?

Thanks.

Note: I think there is a way like you create a pickup and if player near pickup do what I want?
Reply
#2

There's some function's that can help you, just work it with and you'll be able to do what you want.

IsPlayerInRangeOfPoint
OnPlayerPickUpPickup
GetPlayerCameraFrontVector
Reply
#3

If you need GetPickupPos for this, use https://sampforum.blast.hk/showthread.php?tid=348044.
Reply
#4

Okay thanks guys I will try it

Edit: is there any way to set pickup pos?
Reply
#5

Yes, make a command to store the pickup into a variable, Then destroy it while the command is actived and re-create it.
Reply
#6

Okay I did something like this

pawn Код:
stock SetPickupPos(pickupid, model, type, Float:X, Float:Y, Float:Z, Virtualworld)
{
    DestroyPickup(pickupid);
    pickupid = CreatePickup(model, type, X, Y, Z, Virtualworld);
}
Reply
#7

the pickupid, should be a global var instead a local in a stock. just do that. it may work.

pawn Код:
new pick; // a global.
pick = pickupid; // declaring this global var is equal to this local.

// it gonna looks like...

new pick;
stock SetPickupPos(pickupid, model, type, Float:X, Float:Y, Float:Z, Virtualworld)
{
    pick = pickupid;
    DestroyPickup(pick);
    pick = CreatePickup(model, type, X, Y, Z, Virtualworld);
}
Reply
#8

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
the pickupid, should be a global var instead a local in a stock. just do that. it may work.

pawn Код:
new pick; // a global.
pick = pickupid; // declaring this global var is equal to this local.

// it gonna looks like...

new pick;
stock SetPickupPos(pickupid, model, type, Float:X, Float:Y, Float:Z, Virtualworld)
{
    pick = pickupid;
    DestroyPickup(pick);
    pick = CreatePickup(model, type, X, Y, Z, Virtualworld);
}
Thanks, it alredy works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)