[Include] OnPlayerUseVending.inc
#2

Quote:
Originally Posted by im
Посмотреть сообщение
What is this?
This include calls the function OnPlayerUseVending when a player uses a vending machine (Sprunk or other).
When a player presses F, this a timer gets started. If the player has the vending animation (1660) applied, he must be using a vend machine.
This is my first include, so it might not be the best optimized include.

Use
This include can be used for creating a health anticheat. Eg:
Код:
#include <OnPlayerUseVending>

[...]

OnPlayerUseVending(playerid){
    realHealth[playerid] += 35;
    if(realHealth[playerid]>100) realHealth[playerid] = 100;
}
It's highly unlikely that a hacker will press F, apply the vending animation and then update his health to +35.

Download
Pastebin - http://pastebin.com/EsvA7miL
SolidFiles - http://www.solidfiles.com/d/a6a3170d62/

Changelog
0.1 - first version

Next
- I will be adding the positions of all the vending machines so OnPlayerUseVending will only be called if the player is near a vending machine. I have a list of all the vending machines, but some are missing. I will try to find out the positions of all the vending machines and then update the include.


Bugs
None found. Report if you find any bugs.
You should make it check if he's near a vending machine...
Because what if I applyanimation to the player, and he presses that button?
Reply


Messages In This Thread
OnPlayerUseVending.inc - by im - 11.08.2012, 09:53
Re: OnPlayerUseVending.inc - by FireCat - 11.08.2012, 10:16
Re: OnPlayerUseVending.inc - by im - 11.08.2012, 10:17
Re: OnPlayerUseVending.inc - by FireCat - 11.08.2012, 11:29
Re: OnPlayerUseVending.inc - by SuperViper - 11.08.2012, 15:57
Re: OnPlayerUseVending.inc - by im - 11.08.2012, 20:42
Re: OnPlayerUseVending.inc - by DartakousLien - 12.08.2012, 00:03
Re: OnPlayerUseVending.inc - by Emily_Miku - 16.08.2012, 02:05
Re: OnPlayerUseVending.inc - by changeME - 14.01.2013, 01:32

Forum Jump:


Users browsing this thread: 2 Guest(s)