How to disable vending machine - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to disable vending machine (
/showthread.php?tid=273231)
How to disable vending machine -
billy4601 - 31.07.2011
as title.
I want to know what function or callback can do this.
thanks for help
Re: How to disable vending machine -
billy4601 - 31.07.2011
well, i find a old post about this question. the answer is no.
can i make player use higher price to use vending machine ?
Re: How to disable vending machine -
iggy1 - 31.07.2011
Quote:
Originally Posted by billy4601
well, i find a old post about this question. the answer is no.
can i make player use higher price to use vending machine ?
|
Nope they can't be manipulated like that, the best you can do is block them with an object
EDIT: You could make your own system that checks if a certain button (enter i think but i'm not sure) is pressed near a vending machine and deduct x amount of money, but it can't be done natively.
Re: How to disable vending machine -
Macluawn - 31.07.2011
There isn't a function or a callback for that, but you can disable them.
Re: How to disable vending machine -
iggy1 - 31.07.2011
Quote:
Originally Posted by Macluawn
There isn't a function or a callback for that, but you can disable them.
|
How? i could use that myself, is there a function i missed?
Re: How to disable vending machine -
billy4601 - 31.07.2011
Quote:
Originally Posted by Macluawn
There isn't a function or a callback for that, but you can disable them.
|
How to do that?
Re: How to disable vending machine -
Famalamalam - 31.07.2011
Get all positions of Sprunk Machines in San Andreas. Put them into an array. Use OnPlayerKeyStateChange to check if KEY_EXIT (or whatever it's called) is pressed and if it is pressed use IsPLayerInRangeOfPoint to scan through the array of Sprunk Machine positions, if they are near a Sprunk machine, deduct some money. However, this could be buggy, you'd have to use a very small radius in IsPlayerInRangeOFPoint.
Re: How to disable vending machine -
=WoR=Varth - 01.08.2011
For the easy way, you can use OnPlayerKeyStateChange and check if player applying sprunk animation after pressing F (With timer) then you can set their health back (With PVar,or decrease player's health by 30) or stop the anomation (IDK this method work or not).