Raised This Month: $ Target: $400
 0% 

DeathRun XP & Ranks Mod (Version 1.0.2) (Bonus per Lvl / Rank Tags / and more...)


Post New Thread Reply   
 
Thread Tools Display Modes
JanisBriska
Junior Member
Join Date: Aug 2012
Location: Latvia, Tukums
Old 01-10-2013 , 06:09   Re: DeathRun XP & Level Mod (Version 0.0.9) (Bonus for Lvl / AdminChatColors and more
Reply With Quote #71

Make upgrade like this
https://forums.alliedmods.net/showthread.php?t=205329
__________________
JanisBriska is offline
Send a message via Skype™ to JanisBriska
Old 01-10-2013, 10:32
Just4Games
This message has been deleted by Just4Games.
Just4Games
Senior Member
Join Date: Jan 2013
Location: Romania
Old 01-10-2013 , 11:08   Re: DeathRun XP & Level Mod (Version 0.0.9) (Bonus for Lvl / AdminChatColors and more
Reply With Quote #72

found 2 bugs:
1. when i want to remove from me 1000 iit show me -1000 it doesn't downgrade me
2. if i use give_xp <nick> and amount it give to all players not just for me
Just4Games is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 01-12-2013 , 22:30   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #73

Update v1.0 [13-01-2013]
Code:
Fix Give & Remove XP Command
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 01-14-2013 , 18:58   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #74

Thank you for the update and fix. Keep up the good work quilhos!
Gam3ronE is offline
mlkdocs
Member
Join Date: Jul 2012
Old 01-22-2013 , 09:38   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #75

What's wrong with this plugin, it compiles but does not work, like, the information does not appear on the HUD or the controls work, please help me!

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <nvault>   
#include <colorchat> 
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 
#include <fakemeta> 

new Level[33], eXP[33
new 
KillXpHsXpHeXp/*, KnifeXp*/ 
new gVault 

new const szPrefix[] = "[^4inFury | Surf XP^3] -" 

#define MaxLevels 15 
#define IsPlayer(%1) ( 1 <= %1 <=  g_iMaxPlayers ) 
#define TASK_SHOW_HUD 10113 

new g_msgHudSync 
new bool:is_user_ignored33 

new const 
Levels[MaxLevels] =  

    
100// Noob #1 
    
150// Novato #2 
    
250// Aprendiz #3 
    
400// Knifer #4 
    
600// Rambo #5 
    
850// JogaNice #6 
    
1150// Extreme #7 
    
1500// ProSurf #8 
    
1900// Fenomeno #9 
    
2350// ProKill #10 
    
2850// Matador #11 
    
3400// Mito #12 
    
4000// Monster #13 
    
4650// ChuckNorris #14 
    
6000 // Lenda #15 

new const 
Prefix[MaxLevels +1][] = 

    
"Iniciante"// 0 
    
"Noob"// 1 
    
"Novato",  // 2 
    
"Aprendiz"// 3 
    
"Knifer"// 4 
    
"Rambo",  // 5 
    
"JogaNice"// 6 
    
"Extreme"// 7 
    
"ProSurf"// 8 
    
"Fenomeno"// 9 
    
"ProKill"// 10 
    
"Matador"// 11 
    
"Mito"// 12 
    
"Monster"// 13 
    
"ChuckNorris"// 14 
    
"Lenda" // 15 


// Bonus Stuff 
new healthperlevel
    
armorperlevel 
     
new g_iMaxPlayers 

// ADMIN CHAT COLORS by ConnorMcLeod 
enum _:ADMIN_DATAS  
{  
    
m_szName[32],  
    
m_iFlag  
}  

new const 
AdminsDatas[][ADMIN_DATAS] =   
{  
    {
"Dono"ADMIN_IMMUNITY},  
    {
"Manager"ADMIN_BAN},  
    
// {"SuperAdmin", ADMIN_CFG},  
    
{"Admin"ADMIN_KICK},  
    {
"VIP"ADMIN_RESERVATION}  
}; 

public 
plugin_init()  

    
register_plugin("Deathrun XP & Level Mod""0.0.9""Freestyle"
     
    
register_message(get_user_msgid("SayText"),"Message_SayText"); // CREDITS TO ConnorMcLeod 
     
    
RegisterHam Ham_Spawn"player""Ham_CheckOthers_Bonus"1); 
    
RegisterHam Ham_Item_PreFrame"player""Ham_CheckSpeed_Bonus"1); 
     
    
g_iMaxPlayers get_maxplayers( ); 
     
    
register_cvar"AdminChatColors_On""1" ); // Admin Tag EX: [Admin] Freestyle 
    
register_cvar"XP_Reward_MSG""1" ); // Message of the XP Gain 
     
    // CHAT COMMANDS // 
    
register_clcmd "say /xp""ShowPlayerXP"
    
register_clcmd "say_team /xp""ShowPlayerXP"
    
register_clcmd "say /nivel""ShowPlayerLevel"
    
register_clcmd "say_team /nivel""ShowPlayerLevel"
     
    
// XP SYSTEM // 
    
KillXp    register_cvar("drxp_per_kill""5"
    
HsXp    register_cvar("drxp_per_hs""10"
    
HeXp    register_cvar("drxp_per_nade_kill""10"
    
//KnifeXp    = register_cvar("drxp_per_knife_kill", "10") 
     
    // Give & Remove XP // 
    
register_concmd "give_xp""CmdAddXP"ADMIN_RCON"<nick, #userid, authid | @all> <xp>" 
    
register_concmd "remove_xp""CmdRemoveXP"ADMIN_RCON"<nick, #userid, authid | @all> <xp>" 
     
    
/* Bonus Stuff */ 
     
    // Health Per Level // 
    
healthperlevel    register_cvar("health_per_lvl""5"
     
    
// Armor Per Level // 
    
armorperlevel    register_cvar("armor_per_lvl""5")  
     
    
g_msgHudSync CreateHudSyncObj() 


public 
plugin_precache() 

precache_sound("iF_Surf/Uhul.wav"

return 
PLUGIN_CONTINUE 


public 
plugin_cfg( ) 
{     
    
gVault nvault_open"DEATHRUN_XP" 
     
    if ( 
gVault == INVALID_HANDLE 
        
set_fail_state"Error opening nVault" ); 


/*      INFO ABOUT PERSONAL XP/LEVEL      */ 
public ShowPlayerXP(id

    
ColorChat(idGREY"%s Voce tem ^4%i^3 XP e seu nivel e ^4%s^3!"szPrefixeXP[id], Prefix[Level[id]]) 


public 
ShowPlayerLevel(id

    new 
name[32
    
get_user_name(idnamesizeof(name) -1
         
    
ColorChat(idGREY"%s Voce esta no nivel ^4%s^3 com ^4%i^3 XP!"szPrefixPrefix[Level[id]], eXP[id]) 



/*      HP & AP & Gravity Check      */ 
public Ham_CheckOthers_Bonus(id

    if( !
is_user_aliveid ) || cs_get_user_teamid ) != CS_TEAM_T 
        return 
HAM_IGNORED
         
    
// HP Check 
    
new HPCheck = ( get_user_health(id) + get_pcvar_num(healthperlevel) * Levelid ] ); 
    
set_user_healthidHPCheck ); 
     
    
// AP Check 
    
new APCheck = ( get_user_armor(id) + get_pcvar_num(armorperlevel) * Levelid ] ); 
    
set_user_armoridAPCheck ); 
     
     
    
remove_taskTASK_SHOW_HUD id );         

    
set_task(0.1"ShowHud"TASK_SHOW_HUD id
             
    return 
HAM_IGNORED


/*      Respected Player Join / Leave Stuff      */ 

public LvL_15_PlayerJoin(id

    new 
name[32
    
get_user_name(idnamesizeof(name) -1
         
    
ColorChat(0GREY"%s ^4Lenda : ^1%s^4 entrou com ^1%i^4 XP!"szPrefixnameeXP[id]) 


public 
LvL_15_PlayerRemove(id

    new 
name[32
    
get_user_name(idnamesizeof(name) -1
         
    
ColorChat(0GREY"%s ^4Lenda : %s deixou com %i XP!"szPrefixnameeXP[id]) 


public 
plugin_end( ) 
    
nvault_closegVault 
     
public 
client_putinserver(id

    
LoadData(id
    
set_task3.0"ShowHud"id, .flags "b" ); 
     
    if(
Level[id] == 15
    { 
        
set_task(5.0"LvL_15_PlayerJoin"id
    } 


public 
client_disconnect(id

    
SaveData(id
     
    if(
Level[id] == 15
    { 
        
set_task(1.0"LvL_15_PlayerRemove"id
    } 


/*      XP REWARDS      */ 
public client_deathiKilleriVictimwpnindexhitplace 

    new 
vname[32
    new 
kname[32
     
    
get_user_nameiKillerknamecharsmaxkname ) ) 
    
get_user_nameiVictimvnamecharsmaxvname ) ) 

    if( 
is_user_ignorediKiller ] ) 
        return 
PLUGIN_HANDLED_MAIN 
     
    get_user_name
iKillerknamecharsmaxkname ) ) 
    
get_user_nameiVictimvnamecharsmaxvname ) ) 
     
    if( 
iKiller != iVictim && ( <= iKiller <= g_iMaxPlayers ) && ( <= iVictim <= g_iMaxPlayers ) && !( hitplace == HIT_HEAD ) && !( wpnindex == CSW_HEGRENADE ) ) 
    { 
        
eXP[iKiller] += get_pcvar_num(KillXp
         
        if( 
get_cvar_num("XP_Reward_MSG") == )  
        { 
            
ColorChat iKillerGREY"%s Voce tem^4 %i^3 XP por matar^4 %s^3"szPrefixget_pcvar_num(KillXp), vname 
        } 
    } 
     
    if( 
hitplace == HIT_HEAD 
    { 
        
eXP[iKiller] += get_pcvar_num(HsXp
         
        if( 
get_cvar_num("XP_Reward_MSG") == )  
        { 
            
ColorChat iKillerGREY"%s Voce tem ^4%i^3 XP por matar ^4%s^3 com ^4HeadShot"szPrefixget_pcvar_num (HsXp), vname 
        } 
    } 
     
    if( 
wpnindex == CSW_HEGRENADE && iKiller != iVictim 
    { 
        
eXP[iKiller] += get_pcvar_num(HeXp
         
        if( 
get_cvar_num("XP_Reward_MSG") == )  
        { 
            
ColorChatiKillerGREEN"%s^1 Voce tem^4 %i^3 XP por matar^4 %s^3 com uma ^4Granada"szPrefixget_pcvar_num (HeXp), vname 
        } 
    } 
    
CheckLevel(iKiller
    
SaveData(iKiller
     
    return 
PLUGIN_CONTINUE 


public 
CheckLevel(id

    if(
Level[id] < MaxLevels-1
    { 
        while(
eXP[id] >= Levels[Level[id]]) 
        { 
            
Level[id] += 1  
            ColorChat
(idGREY"%s Parabens, voce subiu de nivel! Voce esta agora no nivel : ^4%i^3"szPrefixLevel[id]) 
            
client_cmd(id,"spk iF_Surf/Uhul.wav"
        } 
    }  


/*      HUD PERMANENT INFO      */ 
public ShowHud(task

    new 
id task TASK_SHOW_HUD 
     
    
if(!is_user_alive(id)) 
        return; 
     
    
set_hudmessage(025500.020.4900.00.30.00.0
    
ShowSyncHudMsg(idg_msgHudSync,"inFury^n[Status : %s]^n[XP : %i]"Prefix[Level[id]], eXP[id]) 
     
    
set_task(0.1"ShowHud"TASK_SHOW_HUD id)     


/*      nVault Stuff      */ 
public SaveData(id)  
{  
    new 
Name[35
    
get_user_name(id,Name,34)  
    new 
vaultkey[64],vaultdata[256]  
     
    
format(vaultkey,63,"%s-Mod",Name)  
    
format(vaultdata,255,"%i#%i#",eXP[id],Level[id])  
     
    
nvault_set(gVault,vaultkey,vaultdata)  
     
    return 
PLUGIN_CONTINUE  
}  
public 
LoadData(id)  
{  
    new 
Name[35
    
get_user_name(id,Name,34)  
    new 
vaultkey[64],vaultdata[256]  
     
    
format(vaultkey,63,"%s-Mod",Name)  
    
format(vaultdata,255,"%i#%i#",eXP[id],Level[id])  
     
    
nvault_get(gVault,vaultkey,vaultdata,255)  
     
    
replace_all(vaultdata255"#"" ")  
     
    new 
playerxp[32], playerlevel[32]  
     
    
parse(vaultdataplayerxp31playerlevel31)  
     
    
eXP[id] = str_to_num(playerxp)  
     
    
Level[id] = str_to_num(playerlevel)  
     
    return 
PLUGIN_CONTINUE  
}  

/*      Remove And Add XP      */ 
public CmdAddXP iPlayerlevelcid 

    if( !
cmd_access(iPlayerlevelcid3) ) return PLUGIN_HANDLED
        
    new 
arg 32 
    
read_argv 1argcharsmax arg ) ) 
  
    new 
AddXP 32 
    
read_argv 2AddXPcharsmax AddXP ) ) 
  
    new 
XPtoGive str_to_num AddXP 
        
    new 
iTarget 
    
new AdminName 32 
    new 
TargetName 32 
    
get_user_name iPlayerAdminNamecharsmax AdminName ) ) 
        
    if ( 
equali arg"@all" ) ) 
    { 
        new 
iPlayer 32 ], iNumAll 
        get_players 
iPlayeriNum 
             
        for ( new 
iiNumi++ ) 
        { 
            
All iPlayer 
                        
            
eXPAll ] += XPtoGive 
        

         
        
CheckLevelAll 
         
        
ColorChat 0GREY"%s ^1%s^3 deu^1 %i^3 XP para todos ^1 players^3!"szPrefixAdminNameXPtoGive 
    } 
     
    else 
    { 
        
iTarget cmd_targetiPlayerarg31 
        
get_user_name iTargetTargetNamecharsmax TargetName ) ) 
  
        if( !
iTarget 
            return 
PLUGIN_HANDLED 
        
        eXP
iTarget ] += XPtoGive 
         
        CheckLevel
iTarget 
         
        
ColorChat 0GREY"%s ^1%s^3 deu^1 %i^3 XP para^1 %s^3"szPrefixAdminNameXPtoGiveTargetName 
    } 
  
    return 
PLUGIN_HANDLED 

  
public 
CmdRemoveXP iPlayerlevelcid 

    if( !
cmd_access(iPlayerlevelcid3) ) return PLUGIN_HANDLED
        
    new 
arg 32 
    
read_argv 1argcharsmax arg ) ) 
  
    new 
RemoveXP 32 
    
read_argv 2RemoveXPcharsmax RemoveXP ) ) 
  
    new 
XPtoRemove str_to_num RemoveXP 
        
    new 
iTarget 
    
new AdminName 32 
    new 
TargetName 32 
    
get_user_name iPlayerAdminNamecharsmax AdminName ) ) 
        
    if ( 
equali arg"@all" ) ) 
    { 
        new 
iPlayer 32 ], iNumAll 
        get_players 
iPlayeriNum 
        for ( new 
iiNumi++ ) 
        { 
            
All iPlayer 
                        
            
eXPAll ] -= XPtoRemove 
        

     
        
ColorChat 0GREY"%s ^1%s^3 removeu^1 %i^3 XP de todos^1 players^3!"szPrefixAdminNameXPtoRemove 
    } 
     
    else 
    { 
        
iTarget cmd_targetiPlayerarg31 
        
get_user_name iTargetTargetNamecharsmax TargetName ) ) 
  
        if( !
iTarget 
            return 
PLUGIN_HANDLED 
        
        eXP
iTarget ] -= XPtoRemove 
                
        ColorChat 
0GREY"%s ^1%s^3 removeu^1 %i^3 XP de ^1 %s^3"szPrefixAdminNameXPtoRemoveTargetName 
    } 
     
    return 
PLUGIN_HANDLED 


/*      Level Behind Nick & AdminChatColors 
              CREDITS TO ConnorMcLeod            */ 
public Message_SayText(msgId,msgDest,msgEnt)  
{  
    new 
id get_msg_arg_int(1);  
    if( 
is_user_connected(id) )  
    {  
        if( 
get_cvar_num("AdminChatColors_On") == )  
        { 
            new 
flags get_user_flags(id
            for(new 
ii<sizeof(AdminsDatas); i++)  
            {  
                if( 
flags AdminsDatas[i][m_iFlag] )  
                {  
                    new 
szChannel[64
                    
get_msg_arg_string(2szChannelcharsmax(szChannel)) 
         
                    if( 
equal(szChannel"#Cstrike_Chat_All") )  
                    {  
                        
formatex(szChannelcharsmax(szChannel), "^4[%s - %s] ^3%%s1 ^1:  %%s2"Prefix[Level[id]], AdminsDatas[i][m_szName]) 
                        
set_msg_arg_string(2szChannel
                    }  
                    else if( !
equal(szChannel"#Cstrike_Name_Change") )  
                    {  
                        
format(szChannelcharsmax(szChannel), "^4[%s - %s] %s"Prefix[Level[id]], AdminsDatas[i][m_szName], szChannel
                        
set_msg_arg_string(2szChannel
                    }  
                    return 
                }  
                else 
                { 
                    new 
szChannel[64
                    
get_msg_arg_string(2szChannelcharsmax(szChannel)) 
         
                    if( 
equal(szChannel"#Cstrike_Chat_All") )  
                    {  
                        
formatex(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"Prefix[Level[id]]) 
                        
set_msg_arg_string(2szChannel
                    }  
                    else if( !
equal(szChannel"#Cstrike_Name_Change") )  
                    {  
                        
format(szChannelcharsmax(szChannel), "^4[%s] %s"Prefix[Level[id]], szChannel
                        
set_msg_arg_string(2szChannel
                    }  
                    return  
                } 
            }  
        } 
        else 
        { 
            new 
szChannel[64
            
get_msg_arg_string(2szChannelcharsmax(szChannel)); 
         
            if( 
equal(szChannel"#Cstrike_Chat_All") )  
            {  
                
formatex(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"Prefix[Level[id]]) 
                
set_msg_arg_string(2szChannel
            }  
            else if( !
equal(szChannel"#Cstrike_Name_Change") )  
            {  
                
format(szChannelcharsmax(szChannel), "^4[%s] %s"Prefix[Level[id]], szChannel)  
                
set_msg_arg_string(2szChannel
            }  
            return  
        } 
    }  

mlkdocs is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 01-23-2013 , 10:00   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #76

The original plugin doens'nt have any problem, your version yes, try not change the code, just translate, and for change de speed cvar that you dont want, put 0 in the right cvar
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
riscanuc
Member
Join Date: Apr 2012
Old 03-17-2013 , 02:25   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #77

How out AdminChat ?
__________________
riscanuc is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 03-19-2013 , 07:25   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #78

What?
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 03-22-2013 , 09:51   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #79

maybe he means to remove adminchat...
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
sami_spt
Veteran Member
Join Date: Sep 2012
Location: I<3 pussy cats
Old 03-22-2013 , 09:55   Re: DeathRun XP & Level Mod (Version 1.0) (Bonus for Lvl / AdminChatColors and more..
Reply With Quote #80

Hey Quilhos!

Still waiting for the SQL Version

Nice plugin you have, but I hate Nvault saving..

Quote:
Originally Posted by quilhos View Post
I will do something in sql sooner x)
sami_spt 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 07:48.


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