01.02.2008, 16:00
UC - Useful Callbacks
I don't want to talk too much :PI 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