sprunk/candy machine check - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sprunk/candy machine check (
/showthread.php?tid=593700)
sprunk/candy machine check -
lucamsx - 08.11.2015
how can i check if player is using sprunk or candy machine? would checking the players animation in OnPlayerUpdate work?
Re: sprunk/candy machine check -
Mencent - 08.11.2015
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 )
Re: sprunk/candy machine check -
PrO.GameR - 08.11.2015
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 !
Re : sprunk/candy machine check -
StreetRP - 08.11.2015
https://sampforum.blast.hk/showthread.php?tid=367838
Re: Re : sprunk/candy machine check -
Abagail - 08.11.2015
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
Re: sprunk/candy machine check -
Pottus - 08.11.2015
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
Re: sprunk/candy machine check -
Abagail - 08.11.2015
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
Re: sprunk/candy machine check -
Pottus - 08.11.2015
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 ?