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

kill = 1 Exp Not Working !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MorrocoAmxx
Member
Join Date: Apr 2014
Old 06-09-2014 , 23:34   kill = 1 Exp Not Working !
Reply With Quote #1

hi all, i have this plugin !
PHP Code:
public Round_Start()
{
    for(new 
id=1;id<=g_Players;id++)
    {
        if( 
is_valid_player(id) && !is_user_bot(id) )
        {
            
g_levels[id] = g_levels[id] = get_pcvar_num(g_level_num);
            
set_task(3.0"Level"id)
        }
    }
}

public 
Level(id)
{
    
g_trime[id] = false;
    new 
1;
    while( 
g_level[id] )
    {
        
1
    
}

    if( 
g_level[id] < get_pcvar_num(g_level_num) )
    
g_levels[id] = get_pcvar_num(g_level_num);
    else
    {
        if(
g_level[id] != g_levels[id])
        {
            new 
1;
            while( 
g_level[id] > ( get_pcvar_num(g_level_num)) )
            {
                
1;
                
g_levels[id] = get_pcvar_num(g_level_num);
            }
        }
    }
}

public 
expa_give(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
    {                
        return 
PLUGIN_HANDLED
    
}
    new 
target[32]
    new 
count[32]    
    
    
read_argv(1,target,31)
    
read_argv(2,count,31)
    new 
target_idname[32], nameid[32]
    
target_id find_player("bl"target)
    
get_user_name(target_idnamesizeof name 1
    
get_user_name(idnameidsizeof nameid 1)
    if(!
target_id
    {
        
console_print(id"Can't find that player")
        return 
PLUGIN_HANDLED
    
}
    if(
read_argc() != 3)
    return 
PLUGIN_HANDLED    

    
if(str_to_num(count) < (g_level_exp[target_id] - level_exp[target_id]) )
    {
        if(
str_to_num(count) == 0)
        
console_print(id"Exp Player %s in %i / %i"namelevel_exp[target_id], g_level_exp[target_id])
        else
        {
            
console_print(id"Player %s gives for %i exp, Her Maximum %i"namestr_to_num(count), g_level_exp[target_id])
            
level_exp[target_id] = level_exp[target_id] + str_to_num(count);
        }
        
    }
    else
    {
        
console_print(id"Maximum Exp in player %i"g_level_exp[target_id])
    }
    return 
PLUGIN_HANDLED
}

public 
level_give(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
    {                
        
console_print(id"? ??? ??? ??????? ? ???????")
        return 
PLUGIN_HANDLED
    
}
    new 
target[32]
    new 
count[32]    
    
    
read_argv(1,target,31)
    
read_argv(2,count,31)
    new 
target_idname[32], level_id
    level_id 
str_to_num(count);
    
target_id find_player("bl"target)
    
get_user_name(target_idnamesizeof name 1
    if(!
target_id
    {
        
console_print(id"Can't find that player")
        return 
PLUGIN_HANDLED
    
}
    if(
read_argc() != 3)
    return 
PLUGIN_HANDLED    

    
if( ((g_level[target_id] + level_id) <=get_pcvar_num(g_level_max)) && (level_id != 0) && ((g_level[target_id] + level_id) > ) )
    {
        if(
level_id 0)
        {
            
g_level[target_id] = g_level[target_id] + level_id;
            
level_exp[target_id] = 0;
            
message_begin(MSG_ONE_UNRELIABLEg_ScreenFade_target_id)
                   
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(target_idCHAN_STREAMsound_level_up1.0ATTN_NORM0PITCH_HIGH )
        }
        else
        {
            
g_level[target_id] = g_level[target_id] + level_id;
            
level_exp[target_id] = 0;
            
message_begin(MSG_ONE_UNRELIABLEg_ScreenFade_target_id)
                   
write_short(1<<12// duration
                
write_short(1// hold time
            
write_short(0x0000// fade type
            
write_byte(200// red
            
write_byte(40// green
            
write_byte(0// blue
            
write_byte(205// alpha
            
message_end()
        }
            
console_print(id"Player %s gives add %i level"namelevel_id)
    }
    else
        
console_print(id"Operation Invalid")
    return 
PLUGIN_HANDLED
}

public 
client_putinserver(id)
{
    if( !
is_user_bot(id) && is_valid_player(id) )
    {
        
Level_Load(id)
        
g_level_exp[id] = get_pcvar_num(g_frags_level);
        new 
name[32]
        
g_trime[id] = false;
        
nameid[id] = get_user_name(idnamesizeof name 1)
        
g_trime[id] = false;
        new 
1;
        while( 
!= g_level[id] )
        {
            
1;
        }
        if( 
g_level[id] == 0g_level[id] = 1;
        if( 
level_exp[id] == g_level[id] ) level_exp[id] = 0;
    
        if(
g_level[id] < get_pcvar_num(g_level_num))
        
g_levels[id] = get_pcvar_num(g_level_num);
        else
        {
            if(
g_level[id] != g_levels[id])
            {
                new 
1;
                while( 
g_level[id] > ( get_pcvar_num(g_level_num)) )
                {
                    
1;
                    
g_levels[id] = get_pcvar_num(g_level_num);
                }
            }
        }
    
        new 
0;
        while( 
g_level[id] > )
        {
            
1;
            
g_level_exp[id] = get_pcvar_num(g_frags_level);
        }
    }
}

public 
client_disconnect(id)
{
    if(
get_pcvar_num(g_level_type) == )
    {
        new 
name[32], player_nick[32]
        
player_nick[id] = get_user_name(idnamesizeof name 1)
        if(
player_nick[id] == nameid[id])
        
Level_Save(id)
    }
    else
        
Level_Save(id)    
    
    
g_trime[id] = false;
}

public 
hide_status(id)
{
        
set_hudmessage(0,0,0,0.0,0.0,00.00.010.00.04)
        
show_hudmessage(id,"")
}

public 
show_status(id)
{
        new 
name[32],pid read_data(2)
        
get_user_name(pid,name,31)
       if (
cs_get_user_team(pid) == CS_TEAM_CT && (get_pcvar_num(g_player_name) == 1) )
    {
               
set_hudmessage(2551000, -1.00.6001.01.1__4)
               
show_hudmessage(id,"%s^n[ Level : %i | Exp : %i/%i ]"nameg_level[pid], level_exp[pid], g_level_exp[pid])
    }
     if(
cs_get_user_team(id) == CS_TEAM_T && (get_pcvar_num(g_player_name) == 1) )
    {
        
set_hudmessage(2551000, -1.00.6011.01.1__4)
        
show_hudmessage(id,"%s^n[ Level : %i | Exp : %i/%i ]"nameg_level[id], level_exp[id], g_level_exp[id])
    }
}

public 
say_info(id)
{
    new 
text[70], arg1[32], target[32], count[32]
    
read_args(textsizeof(text)-1);
    
remove_quotes(text);
    
arg1[0] = '^0';
    
target[0] = '^0';
    
count[0] = '^0';
    
parse(textarg1sizeof(arg1)-1targetsizeof(target)-1countsizeof(count)-1);
    if ( 
equali(arg1"info"4) )
    {
        
info_player(idtarget);
    }
    if ( 
equali(arg1"bonusme"7) && (get_pcvar_num(g_level_info) == 1))
    {
    }
    if ( 
equali(arg1"levelexp"7) && (get_pcvar_num(g_level_info) == 1))
    {
        
expa_player(id);
    }
    return 
PLUGIN_CONTINUE;
}

public 
user_infected_pre(idinfector)
{
    if( 
is_user_alive(infector) && (level_exp[infector] < (g_level_exp[infector] - 1)) && cs_get_user_team(infector))
    {
        
level_exp[infector] = level_exp[infector] + 1;
    }
    else
    {
        new 
yaname[32];
        
get_user_name(infectoranamesizeof aname 1)
        if( ( 
level_exp[infector] >= (g_level_exp[infector] - 1) ) && (g_level[infector] <= get_pcvar_num(g_level_max)) && is_user_alive(infector) && cs_get_user_team(infector) && is_valid_player(infector) && get_pcvar_num(g_level_men))
        {
            
g_level[infector] = g_level[infector] + 1;
            
level_exp[infector] = 0;
            while( 
g_level[infector] != )
            {
                
1;
                
g_level_exp[infector] = get_pcvar_num(g_frags_level);
            }
            
message_begin(MSG_ONE_UNRELIABLEg_ScreenFade_infector)
                   
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(infectorCHAN_STREAMsound_level_up1.0ATTN_NORM0PITCH_HIGH )
            
set_hudmessage(020000.650.500.03.02.01.0, -1)
            
show_hudmessage(0"%L"LANG_PLAYER"LEVEL_UP"anameg_level[infector])
            
Level_Save(infector);
        }
    }
}

public 
info_player(idtarget[])
{
    new 
target_2;
    
target_2 find_player("bl"target)
    static 
name[32], nameid[32];
    
get_user_name(target_2namesizeof name 1)
    
get_user_name(idnameidsizeof nameid 1)
    if(!
target_2)
    {
    }
    return 
PLUGIN_HANDLED
}

public 
expa_player(id)
{
    return 
PLUGIN_HANDLED
}

public 
level_status(id)
{
    new 
Spec
    Spec 
pev(idPEV_SPEC_TARGET)
    new 
PlayerName[32]
    
get_user_name(SpecPlayerName31)
    if( 
is_user_alive(id))
    {
        
set_hudmessage(02000, -1.00.901.01.00.00.01)
        
ShowSyncHudMsg(id,syncObj"[ Level : %i | Exp : %i/%i ]",g_level[id], level_exp[id], g_level_exp[id])
    }
     else
     if( 
is_user_alive(Spec))
    {
        
set_hudmessage(2000200, -1.00.801.01.00.00.01)
        
ShowSyncHudMsg(id,syncObj"Spectating: %s ^n[ Level : %i | Exp : %i/%i ]"PlayerNameg_level[Spec], level_exp[Spec], g_level_exp[Spec])
    }
}

public 
Level_Save(id)
{
    new 
key[64], data[256], data_exp[256], key_exp[64]
    switch( 
get_pcvar_num(g_level_type) ) 
        { 
                case 
0
                { 
            new 
name[33]
            
get_user_name(id,name,32)
            
format(key63"%s-/"name)
            
format(key_exp63"%s-/"name)
        }
        case 
1:
        {
            new 
player_ip[33]
            
get_user_ip(id,player_ip,32)
            
format(key63"%s-/"player_ip)
            
format(key_exp63"%s-/"player_ip)
        }
        case 
2:
        {
            new 
steam_ID[33]
            
get_user_authid(id,steam_ID,32)
            
format(key63"%s-/"steam_ID)
            
format(key_exp63"%s-/"steam_ID)
        }
    }

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

    
//format(key_exp, 63, "%s-/", name)
    
format(data_exp255"%i#"level_exp[id])

    
nvault_set(g_level_datakeydata)
    
nvault_set(g_exp_datakey_expdata_exp)
    return 
PLUGIN_CONTINUE;
}

public 
Level_Load(id)
{
    new 
key[64], data[256], data_exp[256], key_exp[64]
    switch( 
get_pcvar_num(g_level_type) ) 
        { 
                case 
0
                { 
            new 
name[33]
            
get_user_name(id,name,32)
            
format(key63"%s-/"name)
            
format(key_exp63"%s-/"name)
        }
        case 
1:
        {
            new 
player_ip[33]
            
get_user_ip(id,player_ip,32)
            
format(key63"%s-/"player_ip)
            
format(key_exp63"%s-/"player_ip)
        }
        case 
2:
        {
            new 
steam_ID[33]
            
get_user_authid(id,steam_ID,32)
            
format(key63"%s-/"steam_ID)
            
format(key_exp63"%s-/"steam_ID)
        }
    }

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

    
//format(key_exp, 63, "%s-/", name)
    
format(data_exp255"%i#"level_exp[id])

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

    new 
givelevel[32], give_exp[32]
    
parse(datagivelevel31)
    
parse(data_expgive_exp31)
    
g_level[id] = str_to_num(givelevel)
    
level_exp[id] = str_to_num(give_exp)

    
set_task(1.0"level_status"id__"b")
    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) && !is_user_bot(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"%L"LANG_PLAYER"LEVEL_UP"anameg_level[attacker])
        
Level_Save(attacker);
    }
    else
    {
        if(
is_user_alive(attacker))
        {
            if(
g_level[attacker] == get_pcvar_num(g_level_max))
            
level_exp[attacker] = level_exp[attacker] + 1;
            
Level_Save(attacker);
        }
    }
}

public 
round_ended(winteam)
{
    for(new 
id=1;id<=g_Players;id++)
    
g_trime[id] = true;
}

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)

    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!t""^3"// Team Color

    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLESayText_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

i have problem with this plugin !
When i kill my discount
Do not give me 1 exp
please if you have solution to fix this problem.. please help me and thanks
MorrocoAmxx 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 08:45.


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