Raised This Month: $ Target: $400
 0% 

Not Running


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-23-2007 , 17:36   Not Running
Reply With Quote #1

I just made a plugin for TFC I was going to release untill I tested it and it didn't work worth shit. It compiles fine, only with 4 errors that only regard the CVAR's [Don't mind them, there not the problem].

I was wondering if somebody could help and get it working, it just doesn't work at all. No errors, nothing.

Don't ignore this thread, take the time and help me.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <fun>

#define PLUGIN "TFC Events"
#define VERSION "1.0"
#define AUTHOR "X-Script"

new tfc_rewards
new tfc_hp_gain
new tfc_ap_gain 
new tfc_hp_limit
new tfc_ap_limit


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("tfc_red_capture"3"2=Red Capture Point")
    
register_logevent("tfc_blue_capture"3"2=Blue Capture Point")
    
    
register_event("DeathMsg""tfc_kill_notice""be")
    
    
tfc_rewards register_cvar("amx_awards""1")
    
tfc_hp_gain register_cvar("amx_gainhp""10")
    
tfc_ap_gain register_cvar("amx_gainap""20")
    
tfc_hp_limit register_cvar("amx_hplimit""100")
    
tfc_ap_limit register_cvar("amx_aplimit""100")
}

public 
plugin_precache()
{
    
precache_sound("fvox/hev_logon.wav")
    
precache_sound("items/itembk2.wav")
    
precache_sound("items/damage2.wav")
}


public 
client_putinserver(id)
{
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name[32]
    
get_user_name(idname31)
    
    
client_print(idprint_chat"Hello %s Welcome To The Server!",name)
    return 
PLUGIN_HANDLED
}

public 
tfc_red_capture(id)
{
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name[32
    
    new 
healthlimit get_cvar_num("amx_hplimit")
    new 
armorlimit get_cvar_num("amx_aplimit")
    new 
healthadd get_cvar_num("amx_gainhp")
    new 
armoradd get_cvar_num("amx_gainap")
    new 
health get_user_health(id)
    new 
armor get_user_armor(id)
    
    
get_user_name(idname31)
    
    
set_hudmessage(11200, -1.00.3006.06.00.50.151)
    
show_hudmessage(0"[TFC-GODS] %s has captured the RED FLAG",name)
    
client_cmd(id"spk items/itembk2.wav")
    
    
client_print(idprint_chat"[TFC-GODS] RED FLAG CAPTURED -- REWARDS: +Health, +Armor")
    
    if (
health healthadd)
    {
        
set_user_health(idhealthlimit healthadd)
        
client_cmd(id,"spk fvox/hev_logon.wav")
    }
    
    if (
health healthlimit)
    {
        
set_user_health(idhealthlimit)
    }
    
    if (
armor armorlimit)
    {
        
set_user_armor(idarmorlimit armoradd)
    }
    
    if (
armor armorlimit)
    {
        
set_user_armor(idarmorlimit)
    }
    return 
PLUGIN_HANDLED
}

public 
tfc_blue_capture(id)
{
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name1[32
    
    new 
healthadd1 get_cvar_num("amx_hpgain")
    new 
armoradd1 get_cvar_num("amx_apgain")
    new 
healthlimit1 get_cvar_num("amx_hplimit")
    new 
armorlimit1 get_cvar_num("amx_aplimit")
    new 
health1 get_user_health(id)
    new 
armor1 get_user_armor(id)
    
    
get_user_name(idname131)
    
    
set_hudmessage(20011, -1.00.3006.06.00.50.151)
    
show_hudmessage(0"[TFC-GODS] %s has captured the BLUE FLAG",name1)
    
client_cmd(id"spk items/itembk2.wav")
    
    
client_print(idprint_chat"[TFC-GODS] BLUE FLAG CAPTURED -- REWARDS: +Health, +Armor")
    
    if (
health1 healthlimit1)
    {
        
set_user_health(idhealth1 healthadd1)
        
client_cmd(id,"spk fvox/hev_logon.wav")
    }
    
    if (
health1 healthlimit1)
    {
        
set_user_health(idhealthlimit1)
    }
    
    if (
armor1 armorlimit1)
    {
        
set_user_armor(idarmor1 armoradd1)
    }
    
    if (
armor1 armorlimit1)
    {
        
set_user_armor(idarmoradd1)
    }
    return 
PLUGIN_HANDLED
}

public 
tfc_kill_notice(id)
{
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
killer read_data(1)
    
    
set_hudmessage(405060, -1.00.3016.06.00.50.151)
    
show_hudmessage(killer"[TFC-GODS] You have killed an enemy!")
    
client_cmd(id"spk items/damage2.wav")
    return 
PLUGIN_HANDLED

X-Script is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-23-2007 , 18:09   Re: Not Running
Reply With Quote #2

DeathMsg is a global event.

So you can't pass id.

You have to use get_players() + for().
__________________
Arkshine is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-23-2007 , 18:12   Re: Not Running
Reply With Quote #3

I'm more worried about the TFC Flag Capture working rather than the DeathMsg. I've fixed the DeathMsg, now I just really want to get TFC Flag Capture too work.
X-Script is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-23-2007 , 18:51   Re: Not Running
Reply With Quote #4

logevent doesn't pass id.

You have to use :

Code:
public tfc_blue_capture() {     id = get_loguser_index();


Code:
 stock get_loguser_index()  {     static loguser[80], name[32];     read_logargv(0,loguser,79);     parse_loguser(loguser,name,31);     return get_user_index(name);  }
__________________
Arkshine is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-23-2007 , 19:12   Re: Not Running
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <fun>

#define PLUGIN "TFC Events"
#define VERSION "1.0"
#define AUTHOR "X-Script"

new tfc_rewards
new tfc_hp_gain
new tfc_ap_gain 
new tfc_hp_limit
new tfc_ap_limit


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("tfc_red_capture"3"2=Red Capture Point")
    
register_logevent("tfc_blue_capture"3"2=Blue Capture Point")
    
    
register_event("DeathMsg""tfc_kill_notice""be")
    
    
tfc_rewards register_cvar("amx_awards""1")
    
tfc_hp_gain register_cvar("amx_gainhp""10")
    
tfc_ap_gain register_cvar("amx_gainap""20")
    
tfc_hp_limit register_cvar("amx_hplimit""100")
    
tfc_ap_limit register_cvar("amx_aplimit""100")
}

public 
plugin_precache()
{
    
precache_sound("fvox/hev_logon.wav")
    
precache_sound("items/itembk2.wav")
    
precache_sound("items/damage2.wav")
}


public 
client_putinserver(id)
{
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name[32]
    
get_user_name(idname31)
    
    
client_print(idprint_chat"Hello %s Welcome To The Server!",name)
    return 
PLUGIN_HANDLED
}

public 
tfc_red_capture(id)
{
    
id get_loguser_index()
    
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name[32
    
    new 
healthlimit get_cvar_num("amx_hplimit")
    new 
armorlimit get_cvar_num("amx_aplimit")
    new 
healthadd get_cvar_num("amx_gainhp")
    new 
armoradd get_cvar_num("amx_gainap")
    new 
health get_user_health(id)
    new 
armor get_user_armor(id)
    
    
get_user_name(idname31)
    
    
set_hudmessage(11200, -1.00.3006.06.00.50.151)
    
show_hudmessage(0"[TFC-GODS] %s has captured the RED FLAG",name)
    
client_cmd(id"spk items/itembk2.wav")
    
    
client_print(idprint_chat"[TFC-GODS] RED FLAG CAPTURED -- REWARDS: +Health, +Armor")
    
    if (
health healthadd)
    {
        
set_user_health(idhealthlimit healthadd)
        
client_cmd(id,"spk fvox/hev_logon.wav")
    }
    
    if (
health healthlimit)
    {
        
set_user_health(idhealthlimit)
    }
    
    if (
armor armorlimit)
    {
        
set_user_armor(idarmorlimit armoradd)
    }
    
    if (
armor armorlimit)
    {
        
set_user_armor(idarmorlimit)
    }
    return 
PLUGIN_HANDLED
}

public 
tfc_blue_capture(id)
{
    
id get_loguser_index()
    
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name1[32
    
    new 
healthadd1 get_cvar_num("amx_hpgain")
    new 
armoradd1 get_cvar_num("amx_apgain")
    new 
healthlimit1 get_cvar_num("amx_hplimit")
    new 
armorlimit1 get_cvar_num("amx_aplimit")
    new 
health1 get_user_health(id)
    new 
armor1 get_user_armor(id)
    
    
get_user_name(idname131)
    
    
set_hudmessage(20011, -1.00.3006.06.00.50.151)
    
show_hudmessage(0"[TFC-GODS] %s has captured the BLUE FLAG",name1)
    
client_cmd(id"spk items/itembk2.wav")
    
    
client_print(idprint_chat"[TFC-GODS] BLUE FLAG CAPTURED -- REWARDS: +Health, +Armor")
    
    if (
health1 healthlimit1)
    {
        
set_user_health(idhealth1 healthadd1)
        
client_cmd(id,"spk fvox/hev_logon.wav")
    }
    
    if (
health1 healthlimit1)
    {
        
set_user_health(idhealthlimit1)
    }
    
    if (
armor1 armorlimit1)
    {
        
set_user_armor(idarmor1 armoradd1)
    }
    
    if (
armor1 armorlimit1)
    {
        
set_user_armor(idarmoradd1)
    }
    return 
PLUGIN_HANDLED
}

stock get_loguser_index() 
{
    new 
loguser[80], name[32]
    
read_logargv(0loguser79)
    
parse_loguser(logusername31)
    
    return 
get_user_index(name)
}
    

public 
tfc_kill_notice(id)
{
    
id get_loguser_index()
    
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
killer read_data(1)
    
    
set_hudmessage(405060, -1.00.3016.06.00.50.151)
    
show_hudmessage(killer"[TFC-GODS] You have killed an enemy!")
    
client_cmd(id"spk items/damage2.wav")
    return 
PLUGIN_HANDLED

still not working
X-Script is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-23-2007 , 19:21   Re: Not Running
Reply With Quote #6

Remove id. You have to create a var.. -_-'

Code:
public tfc_red_capture()    new id = get_loguser_index(); public tfc_blue_capture()    new id = get_loguser_index();
__________________
Arkshine is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-23-2007 , 19:29   Re: Not Running
Reply With Quote #7

Woops, i forgot to delete them.

But still not working, it compiles fine (Only with 4 errors because I didn't add those CVAR's yet) but anyway, it doesn't work at all.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <engine>
#include <fun>

#define PLUGIN "TFC Events"
#define VERSION "1.0"
#define AUTHOR "X-Script"

new tfc_rewards
new tfc_hp_gain
new tfc_ap_gain 
new tfc_hp_limit
new tfc_ap_limit


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("tfc_red_capture"3"2=Red Capture Point")
    
register_logevent("tfc_blue_capture"3"2=Blue Capture Point")
    
    
register_event("DeathMsg""tfc_kill_notice""be")
    
    
tfc_rewards register_cvar("amx_awards""1")
    
tfc_hp_gain register_cvar("amx_gainhp""10")
    
tfc_ap_gain register_cvar("amx_gainap""20")
    
tfc_hp_limit register_cvar("amx_hplimit""100")
    
tfc_ap_limit register_cvar("amx_aplimit""100")
}

public 
plugin_precache()
{
    
precache_sound("fvox/hev_logon.wav")
    
precache_sound("items/itembk2.wav")
    
precache_sound("items/damage2.wav")
}


public 
client_putinserver(id)
{
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name[32]
    
get_user_name(idname31)
    
    
client_print(idprint_chat"Hello %s Welcome To The Server!",name)
    return 
PLUGIN_HANDLED
}

public 
tfc_red_capture()
{
    new 
id get_loguser_index()
    
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name[32
    
    new 
healthlimit get_cvar_num("amx_hplimit")
    new 
armorlimit get_cvar_num("amx_aplimit")
    new 
healthadd get_cvar_num("amx_gainhp")
    new 
armoradd get_cvar_num("amx_gainap")
    new 
health get_user_health(id)
    new 
armor get_user_armor(id)
    
    
get_user_name(idname31)
    
    
set_hudmessage(11200, -1.00.3006.06.00.50.151)
    
show_hudmessage(0"[TFC-GODS] %s has captured the RED FLAG",name)
    
client_cmd(id"spk items/itembk2.wav")
    
    
client_print(idprint_chat"[TFC-GODS] RED FLAG CAPTURED -- REWARDS: +Health, +Armor")
    
    if (
health healthadd)
    {
        
set_user_health(idhealthlimit healthadd)
        
client_cmd(id,"spk fvox/hev_logon.wav")
    }
    
    if (
health healthlimit)
    {
        
set_user_health(idhealthlimit)
    }
    
    if (
armor armorlimit)
    {
        
set_user_armor(idarmorlimit armoradd)
    }
    
    if (
armor armorlimit)
    {
        
set_user_armor(idarmorlimit)
    }
    return 
PLUGIN_HANDLED
}

public 
tfc_blue_capture()
{
    new 
id get_loguser_index()
    
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
name1[32
    
    new 
healthadd1 get_cvar_num("amx_hpgain")
    new 
armoradd1 get_cvar_num("amx_apgain")
    new 
healthlimit1 get_cvar_num("amx_hplimit")
    new 
armorlimit1 get_cvar_num("amx_aplimit")
    new 
health1 get_user_health(id)
    new 
armor1 get_user_armor(id)
    
    
get_user_name(idname131)
    
    
set_hudmessage(20011, -1.00.3006.06.00.50.151)
    
show_hudmessage(0"[TFC-GODS] %s has captured the BLUE FLAG",name1)
    
client_cmd(id"spk items/itembk2.wav")
    
    
client_print(idprint_chat"[TFC-GODS] BLUE FLAG CAPTURED -- REWARDS: +Health, +Armor")
    
    if (
health1 healthlimit1)
    {
        
set_user_health(idhealth1 healthadd1)
        
client_cmd(id,"spk fvox/hev_logon.wav")
    }
    
    if (
health1 healthlimit1)
    {
        
set_user_health(idhealthlimit1)
    }
    
    if (
armor1 armorlimit1)
    {
        
set_user_armor(idarmor1 armoradd1)
    }
    
    if (
armor1 armorlimit1)
    {
        
set_user_armor(idarmoradd1)
    }
    return 
PLUGIN_HANDLED
}

stock get_loguser_index() 
{
    new 
loguser[80], name[32]
    
read_logargv(0loguser79)
    
parse_loguser(logusername31)
    
    return 
get_user_index(name)
}
    

public 
tfc_kill_notice()
{
    new 
id get_loguser_index()
    
    if ( 
get_pcvar_num(tfc_rewards) == )
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
killer read_data(1)
    
    
set_hudmessage(405060, -1.00.3016.06.00.50.151)
    
show_hudmessage(killer"[TFC-GODS] You have killed an enemy!")
    
client_cmd(id"spk items/damage2.wav")
    return 
PLUGIN_HANDLED

X-Script is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-23-2007 , 19:41   Re: Not Running
Reply With Quote #8

Why did you return PLUGIN_HANDLED all the time ?!!

No need to do that.

Code:
#include <amxmodx> #include <amxmisc> #include <tfcx> #include <engine> #include <fun> #define PLUGIN "TFC Events" #define VERSION "1.0" #define AUTHOR "X-Script" new tfc_rewards new tfc_hp_gain new tfc_ap_gain new tfc_hp_limit new tfc_ap_limit public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_logevent("tfc_red_capture", 3, "2=Red Capture Point")     register_logevent("tfc_blue_capture", 3, "2=Blue Capture Point")         register_event("DeathMsg", "tfc_kill_notice", "a")         tfc_rewards = register_cvar("amx_awards", "1")     tfc_hp_gain = register_cvar("amx_gainhp", "10")     tfc_ap_gain = register_cvar("amx_gainap", "20")     tfc_hp_limit = register_cvar("amx_hplimit", "100")     tfc_ap_limit = register_cvar("amx_aplimit", "100") } public plugin_precache() {     precache_sound("fvox/hev_logon.wav")     precache_sound("items/itembk2.wav")     precache_sound("items/damage2.wav") } public client_putinserver(id) {     if( !get_pcvar_num(tfc_rewards) )         return;         new name[32]     get_user_name(id, name, 31)         client_print(id, print_chat, "Hello %s Welcome To The Server!",name) } public tfc_red_capture() {     new id = get_loguser_index()         if( !get_pcvar_num(tfc_rewards) )         return         if( !is_user_connected(id) )         return             new name[32]         new healthlimit = get_cvar_num("amx_hplimit")     new armorlimit = get_cvar_num("amx_aplimit")     new healthadd = get_cvar_num("amx_gainhp")     new armoradd = get_cvar_num("amx_gainap")     new health = get_user_health(id)     new armor = get_user_armor(id)         get_user_name(id, name, 31)         set_hudmessage(1, 1, 200, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)     show_hudmessage(0, "[TFC-GODS] %s has captured the RED FLAG",name)     client_cmd(id, "spk items/itembk2.wav")         client_print(id, print_chat, "[TFC-GODS] RED FLAG CAPTURED -- REWARDS: +Health, +Armor")         if (health < healthadd)     {         set_user_health(id, healthlimit + healthadd)         client_cmd(id,"spk fvox/hev_logon.wav")     }     else if (health > healthlimit)         set_user_health(id, healthlimit)         if (armor < armorlimit)         set_user_armor(id, armorlimit + armoradd)     else         set_user_armor(id, armorlimit) } public tfc_blue_capture() {     new id = get_loguser_index()         if( !get_pcvar_num(tfc_rewards) )         return         if( !is_user_connected(id) )         return         new name1[32]         new healthadd1 = get_cvar_num("amx_hpgain")     new armoradd1 = get_cvar_num("amx_apgain")     new healthlimit1 = get_cvar_num("amx_hplimit")     new armorlimit1 = get_cvar_num("amx_aplimit")     new health1 = get_user_health(id)     new armor1 = get_user_armor(id)         get_user_name(id, name1, 31)         set_hudmessage(200, 1, 1, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)     show_hudmessage(0, "[TFC-GODS] %s has captured the BLUE FLAG",name1)     client_cmd(id, "spk items/itembk2.wav")         client_print(id, print_chat, "[TFC-GODS] BLUE FLAG CAPTURED -- REWARDS: +Health, +Armor")         if (health1 < healthlimit1)     {         set_user_health(id, health1 + healthadd1)         client_cmd(id,"spk fvox/hev_logon.wav")     }     else         set_user_health(id, healthlimit1)             if (armor1 < armorlimit1)         set_user_armor(id, armor1 + armoradd1)     else         set_user_armor(id, armoradd1) } public tfc_kill_notice() {     if( !get_pcvar_num(tfc_rewards) )         return     new killer = read_data(1)         set_hudmessage( 40, 50, 60, -1.0, 0.30, 1, 6.0, 6.0, 0.5, 0.15, 1 )     show_hudmessage( killer, "[TFC-GODS] You have killed an enemy!" )         client_cmd( killer, "spk items/damage2.wav" ) } stock get_loguser_index() {     new loguser[80], name[32]     read_logargv(0, loguser, 79)     parse_loguser(loguser, name, 31)         return get_user_index(name) }
__________________
Arkshine is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-23-2007 , 19:51   Re: Not Running
Reply With Quote #9

The tfc_kill_notice works, but the flag captures still do not.

Also, I use it becase i don't know it's just a habit.
X-Script is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-23-2007 , 20:07   Re: Not Running
Reply With Quote #10

I don't know about TFC event.

Are you sure for that ?

Code:
register_logevent("tfc_red_capture", 3, "2=Red Capture Point") register_logevent("tfc_blue_capture", 3, "2=Blue Capture Point")
__________________
Arkshine 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 16:03.


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