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

Gun Xp Mod (Last Updated : 10-02-2011)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 11:48   Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #1

<--thanks fang
-.Description.-

Buyzone is restricted and you must kill enemy to get experience,if you have needed amount of experience, then you gain a Level.By the Level you gain more new guns and you can pick up that gun ,what is your Level of gun.This is not gungame!
-.Cvars/Commands.-

gxm_enable "1" - Enable = 1,Disable = 0.
gxm_savetype "1" - Save Xp to : 1 = MySQL, 0 = NVault.
gxm_save "1" - Save Xp by : 2 = Name, 1 = SteamID, 0 = IP.
gxm_level_text "0" - Show your level by : 1 = HUD message, 0 = Simple colored text message.
gxm_xp "15" - How much experience gain, when you killed enemy.
gxm_level_style "1" - You will gain each level new gun : 1 = Yes, 0 = No,select your gun by menu.

gxm_triple "1" - Enable Triple Kill bonus xp? 1 = Yes, 0 = No.
gxm_triple_xp "3" - How much bonus xp give for Triple Kill?
gxm_triple_kills "3" - How much kills needed to give bonus xp?
gxm_ultra "1" - Enable Ultra Kill bonus xp? 1 = Yes, 0 = No.
gxm_ultra_kills "6" - How much kills needed to give bonus xp?
gxm_admin_xp "1" - Enable Extra xp for killing? 1 = Yes, 0 = No.
gxm_extra_xp "4" - How much extra xp give to admins?

gxm_show_rank "1" - Shows rank in /top20? 1 = Yes, 0 = No.

SQL cvars:
gxm_host "127.0.0.1" - The host from the db.
gxm_user "root" - The username from the db login.
gxm_pass "" - The password from the db login.
gxm_dbname "gunxpmod" - The database name.

Type in chat: /menu or menu to show Main Menu of Mod!
Type in chat: /level ,to see your information, gxm_level_text then must be set to 0.Also /top20 to see top20 players of experience.
Type in chat: /ul,ul,/unlocks to unlock upgrade for your weapon or buy other misc stuff!
Type in console : set_level your_name amount_of_level. Example : set_level xbatista 10, to set your's/target's level .

If you are running other mods, then find this lines(in gunxpmod.cfg ( scripting folder )) and edit :
PHP Code:
//#define NORMAL_MOD - Normal mod,means simple cs style without other mods.
//#define ZOMBIE_SWARM - Uncomment it if you are using Zombie Swarm and comment other.
#define ZOMBIE_INFECTION - Uncomment it if you are using Zombie Infection style mods and comment other. 
Uncommented style mod can be only one.

By the way, if
PHP Code:
#define ZOMBIE_INFECTION 
is included ,then don't forget to comment-uncomment this lines :
PHP Code:
#define ZOMBIE_BIOHAZARD
//#define ZOMBIE_PLAGUE 
You can also edit item (unlock_*.sma) name and description and change cost to whatever you want.
Example, find this line and edit :
PHP Code:
register_gxm_item("Grenades Pack""Gives an extra grenades"90)
                    
//Item name     //Item Description    //Item cost 

-.ML File.-

/g - means green text. | \d - means grey text(in menu).
/ctr - means CT/T text team color. | \y - means yellow text(in menu).
/y - default orange text. | \r - means red text(in menu). \w - means white text(in menu).

Languages translated :
None.

-.To Do.-

Suggest ;) .
More items.

-.ChangeLog.-
Quote:
2.3 Fixed issue where players sometimes can get higher level while connected also fixed the HUD task where sometimes it can overflow your screen.
2.2 Optimized a bit code for gunxpmod.sma and added new var for saving data by name, gxm_save "2" .
2.1 Fixed Hud show level being called multiple times, fixed menu bug not appearing when user cured in ZombiePlague.
2.0 Menus changed! now you can pick Primary and Secondary weapons!, fixed zombie swarm weapon giving bug, gunxpmod_shop items code are fixed.
1.9 Added gunxpmod.cfg in /configs and /scripting folders, code optimized.
1.8 Fixed ultra,triple Xp gaining bug, fixed zombie plague menu bug ,when zombie can pick weapon from menu.Added SQL support.Added grenades table where you can set grenades on what level you want(see gunxpmod.sma).
P.S. Don't forget to re-check cvars!
1.7 Fixed avarage Xp bug ,when killing enemy. More customizable for 'Biohazard' and 'Zombie Plague Mod' !!!
1.6 15%less CPU usage, Fixed some bugs with menu and other misc stuff..., Fixed giving level to players, cuz in 1.5 version - all players can give themself level , New NVault system which eats less CPU usage!
1.5 Fixed again some menu bugs, added in Level Menu you can now select your last selected gun, addded /menu!
1.4 Fixed menu bugs, added : if you bought item,you can't buy it again, code optimized.
1.3 Fixed buyzone, in NORMAL_MOD buyzone restricted, Added top20!!!
1.2 Added BIG UPDATE! Now you can upgrade your weapon to better by typing /ul or buy other misc stuff, added extra bonus reward for triple kill,ultra kill.Added admin bonus xp for killing someone.
And you can now choose weapon what you like from menu! Or disable menu system.
1.1 Plugin fixed,thanks to Nextra,added cvar to how to show your level,by HUD or by simple colored text message.
1.0 Initial release.
Attached Thumbnails
Click image for larger version

Name:	im1.jpg
Views:	17493
Size:	19.4 KB
ID:	41496   Click image for larger version

Name:	im3.jpg
Views:	45787
Size:	52.4 KB
ID:	41498   Click image for larger version

Name:	img5.jpg
Views:	33396
Size:	85.2 KB
ID:	41867  
Attached Files
File Type: zip gunxpmod.zip (6.21 MB, 12645 views)

Last edited by xbatista; 02-16-2016 at 11:19. Reason: Update
xbatista is offline
Send a message via Skype™ to xbatista
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-10-2009 , 12:35   Re: Gun Xp Mod
Reply With Quote #2

Hey there. Well done, here are some things you could/should change that I spotted on first look:

- StatusIcon message and HamDamage hooks are not used when ZombieSwarm is not defined. Take them out completely (not registering them at all). Especially in HamDamage there are native calls that are unnecessary when the function never does anything.
- Don't know if its just me but I think you should come up with more level names instead of just reusing them 3-5 times each.
- Store the values of is_user_connected and is_user_alive
- Maybe cache the cvars on new round.
- In HamDamage, I believe you don't have to check whether the victim is a player.
- Statics in client_printcolor and Event_StatusValue could be a good idea.
- Use formatex were applicable
- You really should implement SteamID support (maybe do a cvar to change between both).
- MySQL or SQLite support could be a good idea if you have the knowledge to implement either.
- I'm not sure but I believe it's better to use nvault over the old vault.

/edit:
Code:
[de]
LEVEL_TEXT = Name: %s^n Level: %d^n Rang: %s^n
LEVEL_TEXT2 = /gLevel - /ctr[ /y%i /ctr] /gXP - /ctr[ /y%i /g/ /y %i /ctr]
LEVEL_TEXT3 = /gWaffen Level - /ctr[ /y%s /ctr] /gRang - /ctr[ /y%s /ctr]
LEVEL_HUD_TEXT = [Level : %i] [XP : %i / %i]^n[Waffen Level : %s]^n[Rang : %s]
LEVEL_UP = /ctr%s /yerreicht Level /g%i!
__________________
In Flames we trust!

Last edited by Nextra; 04-10-2009 at 14:13.
Nextra is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 12:39   Re: Gun Xp Mod
Reply With Quote #3

You mean this?
PHP Code:
// plugin init//
#if defined ZOMBIE_SWARM
RegisterHam(Ham_TakeDamage"player""HamDamage");
#endif 
Okey will add by steam id ;)
And other things what you say.
xbatista is offline
Send a message via Skype™ to xbatista
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-10-2009 , 12:41   Re: Gun Xp Mod
Reply With Quote #4

Quote:
Originally Posted by xbatista View Post
You mean this?
PHP Code:
// plugin init//
#if defined ZOMBIE_SWARM
RegisterHam(Ham_TakeDamage"player""HamDamage");
#endif 
Okey will add by steam id ;)
And other things what you say.
Yes, and ofc also this:

PHP Code:
#if defined ZOMBIE_SWARM
public HamDamage(idinflictorattackerFloat:damagedamagebits

   
//...
}
#endif 
__________________
In Flames we trust!
Nextra is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 12:43   Re: Gun Xp Mod
Reply With Quote #5

But if i'll do this :
PHP Code:
#if defined ZOMBIE_SWARM
RegisterHam(Ham_TakeDamage"player""HamDamage");
#endif 
Other things don't needed, like this:
PHP Code:
#if defined ZOMBIE_SWARM
public HamDamage(idinflictorattackerFloat:damagedamagebits

   
//...
}
#endif 
xbatista is offline
Send a message via Skype™ to xbatista
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-10-2009 , 12:44   Re: Gun Xp Mod
Reply With Quote #6

But why should you leave it in? Wouldn't it even throw a warning "Function never used"?
__________________
In Flames we trust!
Nextra is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 04-10-2009 , 12:45   Re: Gun Xp Mod
Reply With Quote #7

Code:
[es]
LEVEL_TEXT = Nombre: %s^n Nivel: %d^n Rank: %s^n
LEVEL_TEXT2 = /gNivel - /ctr[ /y%i /ctr] /gXP - /ctr[ /y%i /g/ /y %i /ctr]
LEVEL_TEXT3 = /gNivel de arma - /ctr[ /y%s /ctr] /gRank - /ctr[ /y%s /ctr]
LEVEL_UP = /ctr%s /yllego al nivel /g%i!
AfteR. is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 12:46   Re: Gun Xp Mod
Reply With Quote #8

Quote:
But why should you leave it in? Wouldn't it even throw a warning "Function never used"?
Okey

EDIT: Thx for ML
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-10-2009 , 12:47   Re: Gun Xp Mod
Reply With Quote #9

Quote:
- Store the values of is_user_connected and is_user_alive
interesting thing to store is_user_alive o0 it could may bugg, so i dont suggest todo this, only for connected..
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 13:01   Re: Gun Xp Mod
Reply With Quote #10

Okey code update,check if I something mess.

P.S. ML update.

Last edited by xbatista; 04-10-2009 at 13:04.
xbatista is offline
Send a message via Skype™ to xbatista
Reply


Thread Tools
Display Modes

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 05:46.


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