sprunk/candy machine check
#1

how can i check if player is using sprunk or candy machine? would checking the players animation in OnPlayerUpdate work?
Reply
#2

Hello!

You have two options to go on.

First option:
You can check the position of the player if he / she is in near of a sprunk or candy machine.

Second and last option:
You can check the animation. ( https://sampwiki.blast.hk/wiki/GetAnimationName )
Reply
#3

Well I'm not sure but you had to press 'F' to use them, maybe (not sure) you can check their pos when they press F, OPU for such small stuff seems an overkill to me when I can simply remove default ones, place ones that can behave as I wish !
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=367838
Reply
#5

Quote:
Originally Posted by StreetRP
Посмотреть сообщение
That include is an awful example. What if the server is playing the animation(perhaps for something else)? What if the player is simply applying the animation themselves without even being near a vending machine?

You should consider using (kind-of like what other suggested) Larceny's vending include which recreates them and has some more unique vending functions.

https://sampforum.blast.hk/showthread.php?tid=553952
Reply
#6

Agree with Abagail that include sucks balls also going to point out the include he provided also sucks.

1.) pvars personally I never use any code with pvars
2.) It uses a loop with IsPlayerInRangeOfPoint() yet uses the streamer plugin should be dynamic areas
Reply
#7

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Agree with Abagail that include sucks balls also going to point out the include he provided also sucks.

1.) pvars personally I never use any code with pvars
2.) It uses a loop with IsPlayerInRangeOfPoint() yet uses the streamer plugin should be dynamic areas
I have updated the include to use standard variables along with (assuming the streamer is included) dynamic areas.
https://github.com/Abagail/vending
Reply
#8

Well I took a look if you are using dynamic areas you can completely eliminate the need for any looping because all you need to is save the dynamic area id. Then simply check if the player is still in that area when a key is pressed then you have loop free dynamic area checking good right ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)