Jump to page content
English English  Polish Polish  Dutch Dutch  Russian Russian  German German  Hungarian Hungarian  Norwegian Norwegian  Swedish Swedish  Finnish Finnish  Romanian Romanian  Spanish Spanish  Portuguese Portuguese  Latvian Latvian 


rssVending Machines (vending)

Rate:You need to be logged in to vote
Rating:3.8 (50 Votes)
This resource adds vending machine functionality, just like in single player

forum thread: http://forum.multitheftauto.com/viewtopic.php?f=108&t=25554

- buying of food/drink from all possible vending machine types
- different sounds for different foods
- different animations for each vending machine

Vending machines can be used with the enter/exit key as normal. You must have enough money and less than full health to be able to buy from a vending machine

Some vending machines may have been missed and therefore not work, if you find one please post the rough coordinates (and interior if necessary) so it can be added (you can also add it to the map file yourself)

Exported functions (for full explanations see the meta file):
- plotMachine(machine)
- plotMachineServer(player,machine)
- disableMachine(machine)
- disableMachineServer(player,machine)
- useVendingMachine(machine)
- useVendingMachineServer(player,machine)
- stopVendingMachineAnimation(local player)
- stopVendingMachineAnimationServer(player)
- isPlayerInFrontOfVendingMachine()
- isPlayerUsingVendingMachine()

Using these functions you are given full control over the vending machines in the game. You can enable or disable them as you please, enable or disable them for only specific people and create your own. All vending machine objects created by the server will, by default, be added as a working vending machine. You can set the element data "dont_plot_machine" on the object to prevent them being automatically included

Events (clientside):
- onClientPlayerUseVendingMachine() - called before the player begins using the machine, can be cancelled to stop the machine being used (source is the player using the machine)
- onClientPlayerUsedVendingMachine() - called once the player has finished using the vending machine (source is the player who used the machine)

Known issues:
- the first time the animation is used it may result in the animation becoming "stuck", this can be fixed by simply forcing an animation change (eg: jumping,shooting)
- the fast food stands can be destroyed, but this is not synced by mta, leaving a working marker without a stand. The stand will reappear when you restream the area


Download latest version | Report

Version history

Version Publish Date Changes
1.0.2 2009-10-14 14:17:08 compressed audio files (originals available online if required, see forum thread) Download
1.0.1 2009-10-13 22:39:54 Download
1.0.0 2009-10-13 22:28:39 First public release Download