Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //U Txt fajl upises ovako
- /*
- #if defined _heal_user_included
- #endinput
- #endif
- #define _heal_user_included
- native uzmi_hp(index)
- native setuj_hp(index, kolicina)
- */
- //I sacuvas kao heal_user.inc
- #include <amxmodx>
- #include <fakemeta>
- #define is_user_valid(%1) (1 <= %1 <= g_maxplayers)
- new g_maxplayers
- public plugin_init() {
- register_plugin("","","")
- register_library("heal_user")
- g_maxplayers = get_maxplayers()
- // Add your code here...
- }
- public plugin_natives()
- {
- register_native("uzmi_hp","native_uzmi_hp_igracu", 1)
- register_native("setuj_hp","native_setuj_hp_igracu", 1)
- }
- public native_uzmi_hp(id) //Ovo se poziva kada se ucitavaju korisniku HP
- {
- if (!is_user_valid(id)) // Ovo je da se proveri jel vazeci igrac
- {
- log_error(AMX_ERR_NATIVE, "Error (%d)", id)
- return -1;
- }
- return pev(id, pev_health);
- }
- public native_setuj_hp(id, Float:kolicina) // funkcija koja ce da obavlja odredjen posao(setovanje HP-a) kada se pozove
- {
- if (!is_user_valid(id))
- {
- log_error(AMX_ERR_NATIVE, "Error (%d)", id)
- return false;
- }
- set_pev(id, pev_health, kolicina);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment