View Single Post
Plugin Info:     Modification:          Category:         
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-29-2009 , 08:14   Sample of how NOT to code for approval: XpMod
Reply With Quote #1

Description: This is a little mod i got requested to make so here it is, the idea is that you should use it with HNS (HideNSeek) when a player types /xp he gets up a menu where he can buy health, he grenade, flash (1 and 2), smoke and respawn possibility level.
For example if i buy level 1 he grenade i get 15% chanse to get a he grenade every round.
Admins with kick can take or give xp and admins with rcon can reset all xp's and levels.

Cvars:
Code:
//Xp you get when killing with any weapon except knife
xpmod_killxp 45
//Xp you get when killing with knife
xpmod_knifekillxp 35
//Xp you get when killing with knife in the head
xpmod_knifekillxphs 45
//Xp you lose if you do suicide
xpmod_xpsuicide 5
//xp your team get for winning the round
xpmod_xpwin 10
//xp you get for surviving the round
xpmod_xpsurvive 8
//Xp the different lvls cost (health)
xpmod_xphealth1 400
xpmod_xphealth2 600
xpmod_xphealth3 800
xpmod_xphealth4 1000
xpmod_xphealth5 1200
//hp you get at the different lvls
xpmod_hphealth1 10
xpmod_hphealth2 15
xpmod_hphealth3 20
xpmod_hphealth4 25
xpmod_hphealth5 30
//Xp the different lvls cost (he)
xpmod_xphe1 200
xpmod_xphe2 400
xpmod_xphe3 600
xpmod_xphe4 800
xpmod_xphe5 1000
//Xp the different lvls cost (1st flash)
xpmod_xpflash11 200
xpmod_xpflash12 400
xpmod_xpflash13 800
xpmod_xpflash14 1200
//Xp the different lvls cost (2nd flash)
xpmod_xpflash21 200
xpmod_xpflash22 400
xpmod_xpflash23 800
xpmod_xpflash24 1200
//Xp the different lvls cost (1st smoke)
xpmod_xpsmoke1 400
xpmod_xpsmoke2 600
xpmod_xpsmoke3 800
xpmod_xpsmoke4 1200
//Xp the different lvls cost (respawn)
xpmod_xprespawn1 10000
xpmod_xprespawn2 12000
xpmod_xprespawn3 14000
//Percents chanse that you get the item at that level(health)
xpmod_pthealth1 100
xpmod_pthealth2 100
xpmod_pthealth3 100
xpmod_pthealth4 100
xpmod_pthealth5 100
//Percents chanse that you get the item at that level(he)
xpmod_pthe1 15
xpmod_pthe2 23
xpmod_pthe3 37
xpmod_pthe4 46
xpmod_pthe5 63
//Percents chanse that you get the item at that level(1st flash)
xpmod_ptflash11 25
xpmod_ptflash12 50
xpmod_ptflash13 65
xpmod_ptflash14 85
//Percents chanse that you get the item at that level(2nd flash)
xpmod_ptflash21 25
xpmod_ptflash22 50
xpmod_ptflash23 65
xpmod_ptflash24 85
//Percents chanse that you get the item at that level(smoke)
xpmod_ptsmoke1 20
xpmod_ptsmoke2 45
xpmod_ptsmoke3 55
xpmod_ptsmoke4 70
//Percents chanse that you get the item at that level(respawn)
xpmod_ptrespawn1 15
xpmod_ptrespawn2 22
xpmod_ptrespawn3 33
//If player hasnt played on server hell get this much xp
xpmod_starterxp 400
//Save players xp
xpmod_savexp 1
//Since this is designed for hns well need a delay before we give the items in the beginning
xpmod_rounddelay 12.0
//Do you wish to hide the money hud
xpmod_hidemoneyhud 1
//Do you want a counter on the screen that shows the players their xp (position money hud so its recommended to remove that first)
xpmod_xponscreen 1
Commands:
- Players
- /xp - brings up the xp menu
- Admin with kick
- amx_takexp <target> <amount> - (Console) takes a players xp
- amx_givexp <target> <amount> - (Console) gives a player xp
- Admin with rcon
- /clearxpmod - resets all players xp, levels in the server and the database

Credits:
Redfalcon - Beta tester and requester and cvars are based on what he wanted.
And also thanks to all translators: here

Notes:
Requieres local compiling and download of fvault in includes
xpmod.txt goes in data/lang
Attached Files
File Type: inc fvault.inc (12.8 KB, 866 views)
File Type: sma Get Plugin or Get Source (xpmod.sma - 5402 views - 34.1 KB)
File Type: txt xpmod.txt (11.5 KB, 924 views)

Last edited by micke1101; 10-31-2009 at 15:17. Reason: stickied, changed title
micke1101 is offline