Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta >
- #include < hamsandwich >
- #define PLUGIN "VIP PENTRU CATALIN"
- #define VERSION "0.1.0"
- #define AUTHOR "Sorinel"
- #define VIP_FLAG ADMIN_LEVEL_H
- #define HS_HP 14
- #define KILL_HP 7
- #define FRAG_HP_LIMIT 100
- #define HEALTH 50
- #define ARMOR 50
- new const vip_model_t[] = "vip_model_t"
- new const vip_model_ct[] = "vip_model_ct"
- public plugin_init( ) {
- register_plugin( PLUGIN, VERSION, AUTHOR)
- register_event("DeathMsg", "death_msg", "a", "1>0")
- RegisterHam( Ham_Spawn, "player", "PlayerSpawn", 1 )
- }
- public plugin_precache() {
- new ModelOrSoundPath[128]
- formatex( ModelOrSoundPath, sizeof ( ModelOrSoundPath ) -1, "models/player/%s/%s.mdl", vip_model_t, vip_model_t)
- //engfunc( EngFunc_PrecacheModel, ModelOrSoundPath)
- formatex( ModelOrSoundPath, sizeof ( ModelOrSoundPath ) -1, "models/player/%s/%s.mdl", vip_model_ct, vip_model_ct)
- //engfunc( EngFunc_PrecacheModel, ModelOrSoundPath)
- }
- public PlayerSpawn( id ) {
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG ) {
- fm_set_user_health( id, get_user_health( id ) + HEALTH )
- fm_set_user_armor( id, get_user_armor( id ) + ARMOR )
- switch( cs_get_user_team( id ) )
- {
- case CS_TEAM_T: cs_set_user_model( id, vip_model_t)
- case CS_TEAM_CT: cs_set_user_model( id, vip_model_ct)
- }
- }
- }
- bonus_health(id, health)
- {
- if( is_user_bot(id) )
- return PLUGIN_HANDLED
- static limit
- limit = FRAG_HP_LIMIT
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG )
- {
- limit = FRAG_HP_LIMIT
- }
- fm_set_user_health(id, clamp((get_user_health(id) + health), 1, limit))
- return PLUGIN_HANDLED
- }
- public death_msg()
- {
- new killer = read_data(1)
- new victim = read_data(2)
- new headshot = read_data(3)
- if(killer == victim || !is_user_connected(victim) || !is_user_alive(killer))
- return PLUGIN_HANDLED
- if (headshot)
- {
- bonus_health(killer, HS_HP)
- if(is_user_alive(killer) && get_user_flags(killer) & VIP_FLAG)
- {
- fm_set_user_health(killer, get_user_health(killer) + HS_HP )
- }
- }
- else
- {
- bonus_health(killer, KILL_HP)
- if(is_user_alive(killer) && get_user_flags(killer) & VIP_FLAG)
- {
- fm_set_user_health(killer, get_user_health(killer) + KILL_HP )
- }
- }
- return PLUGIN_CONTINUE
- }
- /* Stock-uri */
- stock fm_set_user_health(id, health)
- {
- (health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id)
- return 1
- }
- stock fm_set_user_armor(index, armor) {
- set_pev(index, pev_armorvalue, float(armor))
- return 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement