SA-MP Forums Archive
How To Edit Money soft drink - 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: How To Edit Money soft drink (/showthread.php?tid=656985)



How To Edit Money soft drink - sonn51280 - 29.07.2018

how to Edit Money soft drink ?


https://upanhtocdo.com/image/FAJlvS


Re: How To Edit Money soft drink - Rufio - 29.07.2018

Detect if the player is close to a vending machine, detect if the player's pressing the key to use a vending machine and then finally detect if the player's doing the vending machine animation and then you can give the money they spend back to them and charge them how much ever you want. Just note that vending machines are client-side, therefore your money won't be decreased server-side if you are using a variable like pInfo[playerid][Money]


Re: How To Edit Money soft drink - d1git - 29.07.2018

What you could do is detect if the player is pressing 'F' and check if the animation index is equal to 1660, which should be the "insert money into vending machine" animation and then lower their money based on that.

EDIT: Rufio beat me too it


Re: How To Edit Money soft drink - sonn51280 - 29.07.2018

me is a new people that you can be specified for me please code


Re: How To Edit Money soft drink - Rufio - 29.07.2018

Use this to detect keys;
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Use this to find out what the key for 'F' is;
https://sampwiki.blast.hk/wiki/Keys

Use this to find out a player's animation index;
https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex

Use this to find out if the player is in range of a point;
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

Use an enum that holds info of all the vending machines;
https://sampforum.blast.hk/showthread.php?tid=318307 This is a good tutorial about enums.

Use this to get the player's money;
https://sampwiki.blast.hk/wiki/GetPlayerMoney

Use this to set the player's money;
https://sampwiki.blast.hk/wiki/GivePlayerMoney


Re: How To Edit Money soft drink - sonn51280 - 29.07.2018

thanks you