Raised This Month: $ Target: $400
 0% 

Plz someone see whats wrong with this mod?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jamaiz
Junior Member
Join Date: Nov 2013
Old 11-17-2013 , 01:18   Plz someone see whats wrong with this mod?
Reply With Quote #1

I replaced 5 with 15 in " health_add = register_cvar("hp", "15") "
and replaced 10 with 30 in " health_hs_add = register_cvar("hp_hs", "30") "
Now the mod doesn't work. Any help?

Quote:
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max

public plugin_init()
{
register_plugin("kill_healed", "2.0", "Dev!l")
health_add = register_cvar("hp", "15")
health_hs_add = register_cvar("hp_hs", "30")
health_max = register_cvar("max_hp", "100")
}
public hook_death()
{
// Killer id
nKiller = read_data(1)

if ( (read_data(3) == 1) && (read_data(5) == 0) )
{
nHp_add = get_pcvar_num (health_hs_add)
}
else
nHp_add = get_pcvar_num (health_add)
nHp_max = get_pcvar_num (health_max)
// Updating Killer HP
if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
return;

nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add
// Maximum HP check
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
// Hud message "Healed +15/+30 hp"
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
// Screen fading
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(200)
write_byte(75)
message_end()

}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1054\\ f0\\ fs16 \n\\ par }
*/
jamaiz is offline
LordOfNothing
BANNED
Join Date: Jul 2013
Old 11-17-2013 , 01:53   Re: Plz someone see whats wrong with this mod?
Reply With Quote #2

is working compile but i will rewrite .. wait a moment !

------------------------------

LOL .. i just see you dont register_Event the deathMsg =))

-------------------------------


try this ::

PHP Code:
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max

public plugin_init()
{
    
register_plugin("kill_healed""2.0""Dev!l")
    
health_add register_cvar("hp""15")
    
health_hs_add register_cvar("hp_hs""30")
    
health_max register_cvar("max_hp""100")
    
register_event("DeathMsg","hook_death","a"
}
public 
hook_death()
{
    
// Killer id
    
nKiller read_data(1)
    
    if ( (
read_data(3) == 1) && (read_data(5) == 0) )
    {
        
nHp_add get_pcvar_num (health_hs_add)
    }
    else
        
nHp_add get_pcvar_num (health_add)
    
nHp_max get_pcvar_num (health_max)
    
// Updating Killer HP
    
if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
        return;
    
    
nKiller_hp get_user_health(nKiller)
    
nKiller_hp += nHp_add
    
// Maximum HP check
    
if (nKiller_hp nHp_maxnKiller_hp nHp_max
    set_user_health
(nKillernKiller_hp)
    
// Hud message "Healed +15/+30 hp"
    
set_hudmessage(02550, -1.00.1501.01.00.10.1, -1)
    
show_hudmessage(nKiller"Healed +%d hp"nHp_add)
    
// Screen fading
    
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, nKiller)
    
write_short(1<<10)
    
write_short(1<<10)
    
write_short(0x0000)
    
write_byte(0)
    
write_byte(0)
    
write_byte(200)
    
write_byte(75)
    
message_end()
    
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1054\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by LordOfNothing; 11-17-2013 at 01:57.
LordOfNothing is offline
jamaiz
Junior Member
Join Date: Nov 2013
Old 11-17-2013 , 01:57   Re: Plz someone see whats wrong with this mod?
Reply With Quote #3

Thnx dude!

Last edited by jamaiz; 11-17-2013 at 02:13.
jamaiz is offline
jamaiz
Junior Member
Join Date: Nov 2013
Old 11-22-2013 , 11:11   Re: Plz someone see whats wrong with this mod?
Reply With Quote #4

Ummmmm it's gone wrong again
It was working till some time then it stopped working. here's the script:
PHP Code:
#define DAMAGE_RECIEVED 
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fun> 

new health_add 
new health_hs_add 
new health_max 
new nKiller 
new nKiller_hp 
new nHp_add 
new nHp_max 

public plugin_init() 

    
register_plugin("kill_healed""2.0""Dev!l"
    
health_add register_cvar("hp""15"
    
health_hs_add register_cvar("hp_hs""30"
    
health_max register_cvar("max_hp""100"
    
register_event("DeathMsg","hook_death","a")  

public 
hook_death() 

    
// Killer id 
    
nKiller read_data(1
     
    if ( (
read_data(3) == 1) && (read_data(5) == 0) ) 
    { 
        
nHp_add get_pcvar_num (health_hs_add
    } 
    else 
        
nHp_add get_pcvar_num (health_add
    
nHp_max get_pcvar_num (health_max
    
// Updating Killer HP 
    
if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H)) 
        return; 
     
    
nKiller_hp get_user_health(nKiller
    
nKiller_hp += nHp_add 
    
// Maximum HP check 
    
if (nKiller_hp nHp_maxnKiller_hp nHp_max 
    set_user_health
(nKillernKiller_hp
    
// Hud message "Healed +15/+30 hp" 
    
set_hudmessage(02550, -1.00.1501.01.00.10.1, -1
    
show_hudmessage(nKiller"Healed +%d hp"nHp_add
    
// Screen fading 
    
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, nKiller
    
write_short(1<<10
    
write_short(1<<10
    
write_short(0x0000
    
write_byte(0
    
write_byte(0
    
write_byte(200
    
write_byte(75
    
message_end() 
     



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1054\\ f0\\ fs16 \n\\ par } 
*/ 
jamaiz is offline
LordOfNothing
BANNED
Join Date: Jul 2013
Old 11-22-2013 , 11:24   Re: Plz someone see whats wrong with this mod?
Reply With Quote #5

work some time then stop ? wth this is not posbile , i think you instal new plugins who interactive with this plugin , check plugins.ini and delete new plugins ;)
LordOfNothing is offline
jamaiz
Junior Member
Join Date: Nov 2013
Old 11-26-2013 , 06:54   Re: Plz someone see whats wrong with this mod?
Reply With Quote #6

Actually never mind, I got a better plugin for this, Anyway can u help me with this one? It's like the adrenaline mods in CTF servers, but the Invisibility does not work. Can you check it out?
PHP Code:
#define VERSION    "2.0"
#include <amxmodx>
#include <amxmisc>
#include <fun>

new adrenaline_multiplier
new adrenaline_max
new adrenaline_toggle
new adrenaline_speed
new adrenaline_sound1
new adrenaline_sound2

new maxspeed_pcvar

new bool:playsound1
new bool:playsound2

new sound1[64] = "adrenaline_booster.wav"
new sound2[64] = "adrenaline_full.wav"
new sound1b[64] = "sound/adrenaline_booster.wav"
new sound2b[64] = "sound/adrenaline_full.wav"

new adrenaline[33]
new 
ability[33]
new 
alpha[33]

new 
bool:restarting
new bool:freezetime

public plugin_init()
{
    
register_plugin("Adrenaline Mod",VERSION,"GHW_Chronic")

    
adrenaline_multiplier register_cvar("adrenaline_amount","20")
    
adrenaline_max register_cvar("adrenaline_max","100")
    
adrenaline_toggle register_cvar("adrenaline_toggle","1")
    
adrenaline_speed register_cvar("adrenaline_speed","650.0")
    
maxspeed_pcvar get_cvar_pointer("sv_maxspeed")

    
register_clcmd("say /booster","menu_cmd")

    
register_event("CurWeapon","CurWeapon","be")
    
register_event("DeathMsg","DeathMsg","a")

    new 
name[32]
    
get_modname(name,31)
    if(
equali(name,"cstrike") || equali(name,"czero"))
    {
        
register_logevent("game_restart2",2,"1=Round_Start")
        
register_logevent("game_end",2,"1=Round_End")
    }
    
register_event("TextMsg","game_restart1","a","2=#Game_will_restart_in")
    
register_event("TextMsg","game_restart1","a","2=#Game_Commencing")

    
register_menu("adrenaline_menu",(1<<0)|(1<<1)|(1<<2)|(1<<9),"menu_press")

    
register_dictionary("GHW_Adrenaline_Mod.txt")
}

public 
game_end()
{
    new 
players[32], num
    get_players
(players,num,"h")
    for(new 
i=0;i<num;i++)
    {
        
ability[players[i]]=0
        set_user_rendering
(players[i])
    }
    
freezetime=true
}

public 
game_restart1()
{
    
restarting true
    
new players[32], num
    get_players
(players,num,"h")
    for(new 
i=0;i<num;i++)
    {
        
adrenaline[players[i]]=0
        ability
[players[i]]=0
        set_user_rendering
(players[i])
    }
}

public 
game_restart2()
{
    if(
restarting && get_pcvar_num(adrenaline_toggle))
    {
        
restarting=false
        
new players[32], num
        get_players
(players,num,"h")
        for(new 
i=0;i<num;i++)
        {
            
adrenaline[players[i]]=0
            ability
[players[i]]=0
            set_user_rendering
(players[i])
        }
    }
    
freezetime=false
}

public 
plugin_precache()
{
    
adrenaline_sound1 register_cvar("adrenaline_sound1","1")
    
adrenaline_sound2 register_cvar("adrenaline_sound2","1")
    if(
get_pcvar_num(adrenaline_sound1) && file_exists(sound1b))
    {
        
playsound1=true
        precache_sound
(sound1)
    }
    if(
get_pcvar_num(adrenaline_sound2) && file_exists(sound2b))
    {
        
playsound2=true
        precache_sound
(sound2)
    }
}

public 
DeathMsg()
{
    if(
get_pcvar_num(adrenaline_toggle) && !restarting)
    {
        new 
id read_data(1)
        new 
target read_data(2)
        
ability[target]=0
        set_user_rendering
(target)
        if(
get_user_team(id)==get_user_team(target))
        {
            
adrenaline[id] -= get_pcvar_num(adrenaline_multiplier)
            if(
adrenaline[id]<0adrenaline[id]=0
        
}
        else
        {
            new 
maxad get_pcvar_num(adrenaline_max)
            if(
adrenaline[id]!=maxad)
            {
                
adrenaline[id] += get_pcvar_num(adrenaline_multiplier)
                if(
adrenaline[id]>=maxad)
                {
                    
adrenaline[id]=maxad
                    
if(playsound2emit_sound(id,CHAN_VOICE,sound2,VOL_NORM,ATTN_NORM,0,PITCH_NORM)
                    
client_print(id,print_chat,"[AMXX] %L",id,"MSG_HOWTO")
                }
            }
        }
    }
}

public 
client_connect(id)
{
    
adrenaline[id]=0
    ability
[id]=0
    alpha
[id]=0
    set_task
(0.5,"adrenaline_hud",id,"",0,"b")
}

public 
client_disconnect(idremove_task(id)

public 
adrenaline_hud(id)
{
    if(
get_pcvar_num(adrenaline_toggle) && is_user_alive(id))
    {
        if(
ability[id])
        {
            if(
adrenaline[id]<=0)
            {
                
ability[id]=0
                set_user_rendering
(id)
            }
            else 
adrenaline[id] -= 2
        
}

        if(
ability[id]==&& get_user_health(id)<254set_user_health(id,get_user_health(id) + 1)
        else if(
ability[id]==&& alpha[id]>70)
        {
            
alpha[id] -= 5
            set_user_rendering
(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,alpha[id])
        }

        if(
adrenaline[id]!=get_pcvar_num(adrenaline_max))
        {
            
set_hudmessage(25525500.900.0206.01.0)
            
show_hudmessage(id,"--^n| %d^n--",adrenaline[id])
        }
        else
        {
            
set_hudmessage(random_num(70,255), random_num(70,255), 00.900.0206.01.0)
            
show_hudmessage(id,"--^n| %d^n--",adrenaline[id])
        }
    }
}

public 
menu_cmd(id)
{
    if(
get_pcvar_num(adrenaline_toggle) && adrenaline[id]>=get_pcvar_num(adrenaline_max) && !restarting && !freezetime)
    {
        new 
message[1024]
        new 
len format(message,1023,"%L^n^n",id,"MSG_MENUTITLE")
        
len += format(message[len],1023-len,"1. %L^n",id,"MSG_SPEED")
        
len += format(message[len],1023-len,"2. %L^n",id,"MSG_HEALTH")
        
len += format(message[len],1023-len,"3. %L^n^n",id,"MSG_INVIS")
        
len += format(message[len],1023-len,"0. %L",id,"MSG_EXIT")
        
show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<9),message,-1,"adrenaline_menu")
    }
}

public 
menu_press(id,key)
{
    if(
get_pcvar_num(adrenaline_toggle) && !restarting && !freezetime)
    {
        switch(
key)
        {
            case 
0:
            {
                
ability[id]=1
                set_user_maxspeed
(id,get_pcvar_float(adrenaline_speed))
            }
            case 
1ability[id]=2
            
case 2:
            {
                
ability[id]=3
                set_user_rendering
(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,30)
                
alpha[id] = 30
            
}
        }
        if(
playsound1 && key!=9emit_sound(id,CHAN_VOICE,sound1,VOL_NORM,ATTN_NORM,0,PITCH_NORM)
    }
    return 
PLUGIN_HANDLED
}

public 
CurWeapon(id)
{
    if(
get_pcvar_num(adrenaline_toggle) && !freezetime)
    {
        if(
ability[id]==1)
        {
            
client_cmd(id,"cl_forwardspeed 400;cl_backspeed 400;cl_sidespeed 400")
            new 
Float:speed get_pcvar_float(adrenaline_speed)
            
set_user_maxspeed(id,speed)
            
set_pcvar_float(maxspeed_pcvar,speed)
        }
        if(
ability[id]==&& alpha[id]<200)
        {
            
alpha[id] += 20
            set_user_rendering
(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,alpha[id])
        }
    }

Here's a pic of what happens:

Can you figure it out?
jamaiz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode