Raised This Month: $51 Target: $400
 12% 

[Fix] Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ReD MaN
Member
Join Date: Jun 2014
Location: i dont Know --'
Old 08-07-2014 , 17:21   [Fix] Plugin
Reply With Quote #1

Hi all, I have this plugin with errors
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <cstrike>
#include <fakemeta_util>


#define PLUGIN "LevelUp System XP"
#define VERSION "3.2c"
#define AUTHOR "Re.Act!ve"

new g_level[32], g_level_datag_frags_levelg_ScreenFade
new g_level_max
new level_exp[32]
new 
g_level_exp[32], g_exp_data
new bool:g_trime[33]
new 
sound_level_up[] = { "misc/level_up.wav"}
// Zombie Classes MUST be registered on plugin_precache

public plugin_precache()
{
        
precache_soundsound_level_up )
}

public 
plugin_init()
{
    
g_frags_level register_cvar("zp_level_frags""10")
    
g_level_max  register_cvar("zp_level_max""1000")

    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_level_data nvault_open("Level_Save")
    
g_exp_data nvault_open("Exp_Save")
    
register_event("DeathMsg""Frags_Manager""a""1>0")
    
register_event("HLTV""Round_Start""a""1=0""2=0")
    
g_ScreenFade get_user_msgid"ScreenFade" )
}

public 
Level_Begin(id)
{
    
g_trime[id] = false;

    new 
1;
    while( 
<= g_level[id] )
    {
        
g_level_exp[id] = get_pcvar_num(g_frags_level);
        
1;
    }
    if( 
g_level[id] == 1)
    
g_level_exp[id] = get_pcvar_num(g_frags_level);
    return 
PLUGIN_CONTINUE;
}

public 
client_putinserver(id)
{
    
Level_Load(id)
    
Exp_Load(id)
    
Level_Begin(id)
}

public 
client_disconnect(id)
{
    
Level_Save(id)
    
Exp_Save(id)
    
remove_task(id)
    
g_trime[id] = false;
}

public 
Level_Save(id)
{
    new 
key[64], data[256]
    new 
name[33]
    
get_user_name(id,name,32)

    
format(key63"%s-/"name)
    
format(data255"%i#"g_level[id])

    
nvault_set(g_level_datakeydata)
    return 
PLUGIN_CONTINUE
}

public 
Exp_Save(id)
{
    new 
data_exp[256], key_exp[64]
    new 
authid[33];
    
get_user_authid(id,authid,32)

    
format(key_exp63"%s-/"authid)
    
format(data_exp255"%i#"level_exp[id])

    
nvault_set(g_exp_datakey_expdata_exp)
    return 
PLUGIN_CONTINUE;
}

public 
Level_Load(id)
{
    new 
key[64], data[256]
    new 
authid[33];
    
get_user_authid(id,authid,32)

    
format(key63"%s-/"authid)
    
format(data255"%i#"g_level[id])

    
nvault_get(g_level_datakeydata255)
    
replace_all(data255"#"" ")

    new 
givelevel[32]
    
parse(datagivelevel31)
    
g_level[id] = str_to_num(givelevel)
    if( 
g_level[id] == 0g_level[id] = 1;
    return 
PLUGIN_CONTINUE;
}

public 
Exp_Load(id)
{
    new 
data_exp[256], key_exp[64]
    new 
authid[33];
    
get_user_authid(id,authid,32)

    
format(key_exp63"%s-/"authid)
    
format(data_exp255"%i#"level_exp[id])

    
nvault_get(g_exp_datakey_expdata_exp255)
    
replace_all(data_exp255"#"" ")

    new 
give_exp[32]
    
parse(data_expgive_exp31)
    
level_exp[id] = str_to_num(give_exp)
    return 
PLUGIN_CONTINUE;
}

public 
Frags_Manager()
{
    new 
aname[32], attackerattacker read_data(1)
    new 
y1;
    
get_user_name(attackeranamesizeof aname 1)
    if( ( 
level_exp[attacker] >= (g_level_exp[attacker] - 1) ) && (g_level[attacker] <= get_pcvar_num(g_level_max)) && is_user_alive(attacker) )
    {
        
g_level[attacker] = g_level[attacker] + 1;
        
level_exp[attacker] = 0;
        while( 
g_level[attacker] != )
        {
            
1;
            
g_level_exp[attacker] = get_pcvar_num(g_frags_level);
        }
        
message_begin(MSG_ONE_UNRELIABLEg_ScreenFade_attacker)
        
write_short(1<<12// duration
        
write_short(1// hold time
        
write_short(0x0000// fade type
        
write_byte(1// red
        
write_byte(200// green
        
write_byte(0// blue
        
write_byte(205// alpha
        
message_end()
        
emit_sound(attackerCHAN_STREAMsound_level_up1.0ATTN_NORM0PITCH_HIGH )
        
set_hudmessage(020000.650.500.03.02.01.0, -1)
        
show_hudmessage(0"%s has cut down %i level"anameg_level[attacker])
        
Level_Save(attacker);
    }
    else
    {
        
        if(
g_level[attacker] == get_pcvar_num(g_level_max))
        
ChatColor(attacker"you have reached a maximum level: !g%i"g_level[attacker] )
        
level_exp[attacker] = level_exp[attacker] + 1;
        
Level_Save(attacker);
    }
}

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players32 ]
    static 
msg191 ]
    
vformatmsg190input)
    
    
replace_allmsg190"!g""^4" )
    
replace_allmsg190"!y""^1" )
    
replace_allmsg190"!t""^3" )
    
    if(
idplayers] = id; else get_playersplayerscount"ch" )
    {
    for(new 
0counti++)
    {
        if( 
is_user_connectedplayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players] )  
            
write_byteplayers] )
            
write_stringmsg )
            
message_end( )
        }
    }
    }

Errors:

Quote:
L Plugin called message_begin with an invalid message id (0).
L [AMXX] Displaying debug trace (plugin "Level_spec.amxx")
L [AMXX] Run time error 10: native error (native "message_begin")
L [AMXX] [0] Level_spec.sma::Frags_Manager (line 146)
Can Anyone HELP me ?
Sorry For bad english
__________________
Forum logo : No Steam = No Support
ReD MaN is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 08-07-2014 , 17:29   Re: [Fix] Plugin
Reply With Quote #2

PHP Code:
public Frags_Manager() 

    new 
aname[32], attackerattacker read_data(1
    if(!
attacker)
        return
    .... 
__________________
Hey ^_^
NikKOo31 is offline
ReD MaN
Member
Join Date: Jun 2014
Location: i dont Know --'
Old 08-07-2014 , 18:49   Re: [Fix] Plugin
Reply With Quote #3

thus ???
PHP Code:
public Frags_Manager()
{
    new 
aname[32], attackerattacker read_data(1)  
    if(!
attacker
    return 
    new 
y1;
    
get_user_name(attackeranamesizeof aname 1)
    if( ( 
level_exp[attacker] >= (g_level_exp[attacker] - 1) ) && (g_level[attacker] <= get_pcvar_num(g_level_max)) && is_user_alive(attacker) )
    {
        
g_level[attacker] = g_level[attacker] + 1;
        
level_exp[attacker] = 0;
        while( 
g_level[attacker] != )
        {
            
1;
            
g_level_exp[attacker] = get_pcvar_num(g_frags_level);
        }
        
message_begin(MSG_ONE_UNRELIABLEg_ScreenFade_attacker)
        
write_short(1<<12// duration
        
write_short(1// hold time
        
write_short(0x0000// fade type
        
write_byte(1// red
        
write_byte(200// green
        
write_byte(0// blue
        
write_byte(205// alpha
        
message_end()
        
emit_sound(attackerCHAN_STREAMsound_level_up1.0ATTN_NORM0PITCH_HIGH )
        
set_hudmessage(020000.650.500.03.02.01.0, -1)
        
show_hudmessage(0"%s has cut down %i level"anameg_level[attacker])
        
Level_Save(attacker);
    }
    else
    {
        
        if(
g_level[attacker] == get_pcvar_num(g_level_max))
            
ChatColor(attacker"^3[PG]^1 you have reached a maximum level: ^4%i"g_level[attacker] )
        
level_exp[attacker] = level_exp[attacker] + 1;
        
Level_Save(attacker);
    }

__________________
Forum logo : No Steam = No Support
ReD MaN is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 08-07-2014 , 19:13   Re: [Fix] Plugin
Reply With Quote #4

Quote:
Originally Posted by ReD MaN View Post
thus ???
PHP Code:
public Frags_Manager()
{
    new 
aname[32], attackerattacker read_data(1)  
    if(!
attacker
    return 
    new 
y1;
    
get_user_name(attackeranamesizeof aname 1)
    if( ( 
level_exp[attacker] >= (g_level_exp[attacker] - 1) ) && (g_level[attacker] <= get_pcvar_num(g_level_max)) && is_user_alive(attacker) )
    {
        
g_level[attacker] = g_level[attacker] + 1;
        
level_exp[attacker] = 0;
        while( 
g_level[attacker] != )
        {
            
1;
            
g_level_exp[attacker] = get_pcvar_num(g_frags_level);
        }
        
message_begin(MSG_ONE_UNRELIABLEg_ScreenFade_attacker)
        
write_short(1<<12// duration
        
write_short(1// hold time
        
write_short(0x0000// fade type
        
write_byte(1// red
        
write_byte(200// green
        
write_byte(0// blue
        
write_byte(205// alpha
        
message_end()
        
emit_sound(attackerCHAN_STREAMsound_level_up1.0ATTN_NORM0PITCH_HIGH )
        
set_hudmessage(020000.650.500.03.02.01.0, -1)
        
show_hudmessage(0"%s has cut down %i level"anameg_level[attacker])
        
Level_Save(attacker);
    }
    else
    {
        
        if(
g_level[attacker] == get_pcvar_num(g_level_max))
            
ChatColor(attacker"^3[PG]^1 you have reached a maximum level: ^4%i"g_level[attacker] )
        
level_exp[attacker] = level_exp[attacker] + 1;
        
Level_Save(attacker);
    }

Yes
__________________
Eagle07 is offline
ReD MaN
Member
Join Date: Jun 2014
Location: i dont Know --'
Old 08-07-2014 , 19:19   Re: [Fix] Plugin
Reply With Quote #5

Quote:
Originally Posted by Eagle07 View Post
Yes
Thanks
__________________
Forum logo : No Steam = No Support
ReD MaN 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 04:18.


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