[Include] [INC] Useful Callbacks [V.1.1]
#1

UC - Useful Callbacks
I don't want to talk too much :P
I made some callbacks with which you can check some things based on the "normal" samp functions.

Callbacks:
OnPlayerGetHealth(playerid, health)
This callback checks if one player gets health.
OnPlayerLoseHealth(playerid, health)
This callback checks if one player loses health.
OnPlayerGetArmour(playerid, armour)
This callback checks if one player gets armour.
OnPlayerLoseArmour(playerid, armour)
This callback checks if one player loses armour.
OnPlayerGetMoney(playerid, money)
This callback checks if one player gets money.
OnPlayerLoseMoney(playerid, money)
This callback checks if one player loses money.
OnPlayerGetScore(playerid, score)
This callback checks if one player gets score.
OnPlayerLoseScore(playerid, score)
This callback checks if one player loses score.
OnPlayerGetWantedLevel(playerid, wantedlevel)
This callback checks if one player gets wantedlevel.
OnPlayerLoseWantedLevelplayerid, wantedlevel)
This callback checks if one player loses wantedlevel.
OnPlayerChangeToVehicle(playerid, vehicleid, driver)
This callback checks if one player changes his state. It checks the driver and passenger state (driver / !driver).
OnPlayerChangeToFoot(playerid)
This callback checks if one player changes his state. It checks the onfoot state.
OnPlayerSwitchWeapon(playerid, oldweapon, newweapon)
This callback checks if one player switchs his weapons. You can check the new and the old weapon.
OnPlayerPressKey(playerid, key)
This callback checks if one player presses a key.
OnPlayerPressMoveKey(playerid, key)
This callback checks if one player presses a move key (up, down, left, right).

How to install:
Add #include <UC> at the top of your script
Add AddCallbacks(); in OnGameModeInIt()
Add RemoveCallbackStats(playerid); in OnPlayerConnect or OnPlayerDisconnect

If you get this error: error 004: function "OnPlayerGetHealth" is not implemented you forgot this callback into your script.

Rapidshare
Pastebin
Reply
#2

Hey nice job, this will be usefull for all servers.

And a small typo:
Quote:

OnPlayerChangeToVehicle(playerid, vehicleid, driver)

Kowalski
Reply
#3

Looks good. I'll check back in a few days.
Reply
#4

Quite useful for detecting cheats.
Reply
#5

nice I will use it

R@f
Reply
#6

Hey this is nice for removing the text draw speedo when a player doesn't manually exit a vehicle, but i cant download from rapidshit so can you please add it to pastebin.COM

Thank You,
Allan(MoNeYPiMp)
Reply
#7

Quote:
Originally Posted by [SAS
MoNeYPiMp ]
Hey this is nice for removing the text draw speedo when a player doesn't manually exit a vehicle, but i cant download from rapidshit so can you please add it to pastebin.COM

Thank You,
Allan(MoNeYPiMp)
Sure
Reply
#8

Thanks
Reply
#9

Freaking awsome callbacks, I really like them, very usfull for alot of things including detection of cheaters! Want a mirror ?
Reply
#10

Nice, is this done using timer(s)?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)