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

OciXCrom's Rank System [XP|Levels|Ranks]


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-07-2020 , 06:39   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #391

Quote:
Originally Posted by HamletEagle View Post
Is that pesky handle leak bug fixed? Too lazy to go through all the pages and see if you managed to fix it.
Pretty sure it is. Haven't gotten any new reports since then. I edited the plugin according to your notes.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
maxedrom
Junior Member
Join Date: Apr 2020
Location: Argentina
Old 04-10-2020 , 17:05   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #392

I tried to compile and failed

Code:
//// cs_rank_system.sma
//// cs_rank_system.sma
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\cs_rank_system.sma(4) : fatal error 100: cannot read from file: "wm_play"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file compiled\cs_rank_system.amx (compile failed).
//
// Compilation Time: 0,08 sec
// ----------------------------------------
anyone?

Last edited by maxedrom; 04-10-2020 at 17:08.
maxedrom is offline
Send a message via AIM to maxedrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-10-2020 , 17:42   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #393

Quote:
Originally Posted by maxedrom View Post
I tried to compile and failed

Code:
//// cs_rank_system.sma
//// cs_rank_system.sma
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\cs_rank_system.sma(4) : fatal error 100: cannot read from file: "wm_play"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file compiled\cs_rank_system.amx (compile failed).
//
// Compilation Time: 0,08 sec
// ----------------------------------------
anyone?
That's not the filename of my plugin. You're still trying to compile the one from the other thread.
__________________

Last edited by OciXCrom; 04-10-2020 at 17:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
lrnt
New Member
Join Date: Apr 2020
Old 04-12-2020 , 16:14   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #394

Hi,

Is there a way to use the default amx stats data (csstats.dat) for ranking?
lrnt is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-12-2020 , 19:22   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #395

Not at the moment, although it's a good idea as a sub-plugin, but unfortunately csstats doesn't provide an easy way to do this. I will see what I can do.
__________________

Last edited by OciXCrom; 04-12-2020 at 19:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
lrnt
New Member
Join Date: Apr 2020
Old 04-12-2020 , 19:31   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #396

Lite Rank System (attached) seems to do it in a pretty straightforward way. I could look into developing a subplugin but I never developed plugins for amxx.
Attached Files
File Type: sma Get Plugin or Get Source (Lite_Rank_System.sma - 195 views - 19.6 KB)
lrnt is offline
Old 04-13-2020, 07:49
tarsisd2
This message has been deleted by tarsisd2. Reason: mistake
carrx
Junior Member
Join Date: Mar 2020
Old 04-17-2020 , 05:57   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #397

Its not working for me. Have Zombie Plague 5.0 and i put crxranks_speed_per_level.amxx and crxranks_damage_per_level.amxx at the end of file plugins-zp50_ammopacks.ini. Got this from: https://www.amxx-bg.info/viewtopic.php?t=4834#p27442

Speed Per Level:
Code:
#include <amxmodx>
#include <amxmisc>
#include <crxranks>
#include <fun>

native zp_get_user_zombie(id)

#define PLUGIN_VERSION "1.0-zp"

new Trie:g_tSpeed
new Float:g_fSpeed[33]

public plugin_init()
{
	register_plugin("CRXRanks: Speed Per Level", PLUGIN_VERSION, "OciXCrom")
	register_cvar("CRXRanksSPL", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	register_event("CurWeapon", "OnChangeWeapon", "be", "1=1")
	g_tSpeed = TrieCreate()
	ReadFile()
}

public plugin_end()
	TrieDestroy(g_tSpeed)
	
ReadFile()
{
	new szFilename[256]
	get_configsdir(szFilename, charsmax(szFilename))
	add(szFilename, charsmax(szFilename), "/RankSystemSpeed.ini")
	
	new iFilePointer = fopen(szFilename, "rt")
	
	if(iFilePointer)
	{
		new szData[64], szValue[32], szMap[32], szKey[32], bool:bRead = true, iSize
		get_mapname(szMap, charsmax(szMap))
		
		while(!feof(iFilePointer))
		{
			fgets(iFilePointer, szData, charsmax(szData))
			trim(szData)
			
			switch(szData[0])
			{
				case EOS, '#', ';': continue
				case '-':
				{
					iSize = strlen(szData)
					
					if(szData[iSize - 1] == '-')
					{
						szData[0] = ' '
						szData[iSize - 1] = ' '
						trim(szData)
						
						if(contain(szData, "*") != -1)
						{
							strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '*')
							copy(szValue, strlen(szKey), szMap)
							bRead = equal(szValue, szKey) ? true : false
						}
						else
						{
							static const szAll[] = "#all"
							bRead = equal(szData, szAll) || equali(szData, szMap)
						}
					}
					else continue
				}
				default:
				{
					if(!bRead)
						continue
						
					strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '=')
					trim(szKey); trim(szValue)
							
					if(!szValue[0])
						continue
						
					TrieSetCell(g_tSpeed, szKey, str_to_float(szValue))
				}
			}
		}
		
		fclose(iFilePointer)
	}
}

public OnChangeWeapon(id)
{
	if(g_fSpeed[id] != 0.0)
		set_user_maxspeed(id, g_fSpeed[id])
}

public client_putinserver(id)
	g_fSpeed[id] = 0.0

public crxranks_user_level_updated(id, iLevel)
{
	new szLevel[10]
	num_to_str(iLevel, szLevel, charsmax(szLevel))
		
	if(TrieKeyExists(g_tSpeed, szLevel))
		TrieGetCell(g_tSpeed, szLevel, g_fSpeed[id])
}

Damage Per Level:
Code:
#include <amxmodx>
#include <amxmisc>
#include <crxranks>
#include <hamsandwich>

native zp_get_user_zombie(id)

#define PLUGIN_VERSION "1.1-zp"

new Trie:g_tDamage
new g_szDamage[16][33]

public plugin_init()
{
	register_plugin("CRXRanks: Damage Per Level", PLUGIN_VERSION, "OciXCrom")
	register_cvar("CRXRanksDPL", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	RegisterHam(Ham_TakeDamage, "player", "PreTakeDamage", 0)
	g_tDamage = TrieCreate()
	ReadFile()
}

public plugin_end()
	TrieDestroy(g_tDamage)
	
ReadFile()
{
	new szFilename[256]
	get_configsdir(szFilename, charsmax(szFilename))
	add(szFilename, charsmax(szFilename), "/RankSystemDamage.ini")
	
	new iFilePointer = fopen(szFilename, "rt")
	
	if(iFilePointer)
	{
		new szData[64], szValue[32], szMap[32], szKey[32], bool:bRead = true, iSize
		get_mapname(szMap, charsmax(szMap))
		
		while(!feof(iFilePointer))
		{
			fgets(iFilePointer, szData, charsmax(szData))
			trim(szData)
			
			switch(szData[0])
			{
				case EOS, '#', ';': continue
				case '-':
				{
					iSize = strlen(szData)
					
					if(szData[iSize - 1] == '-')
					{
						szData[0] = ' '
						szData[iSize - 1] = ' '
						trim(szData)
						
						if(contain(szData, "*") != -1)
						{
							strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '*')
							copy(szValue, strlen(szKey), szMap)
							bRead = equal(szValue, szKey) ? true : false
						}
						else
						{
							static const szAll[] = "#all"
							bRead = equal(szData, szAll) || equali(szData, szMap)
						}
					}
					else continue
				}
				default:
				{
					if(!bRead)
						continue
						
					strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '=')
					trim(szKey); trim(szValue)
							
					if(!szValue[0])
						continue
						
					TrieSetString(g_tDamage, szKey, szValue)
				}
			}
		}
		
		fclose(iFilePointer)
	}
}

public PreTakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)
{
	if(!is_user_connected(iAttacker) || zp_get_user_zombie(iAttacker) || !g_szDamage[iAttacker][0])
		return
	
	SetHamParamFloat(4, math_add_f(fDamage, g_szDamage[iAttacker]))
}

public client_putinserver(id)
	g_szDamage[id][0] = EOS

public crxranks_user_level_updated(id, iLevel)
{
	new szLevel[10]
	num_to_str(iLevel, szLevel, charsmax(szLevel))
		
	if(TrieKeyExists(g_tDamage, szLevel))
		TrieGetString(g_tDamage, szLevel, g_szDamage[id], charsmax(g_szDamage[]))
}

Float:math_add_f(Float:fNum, const szMath[])
{
	static szNewMath[16], Float:fMath, bool:bPercent, cOperator
   
	copy(szNewMath, charsmax(szNewMath), szMath)
	bPercent = szNewMath[strlen(szNewMath) - 1] == '%'
	cOperator = szNewMath[0]
   
	if(!isdigit(szNewMath[0]))
		szNewMath[0] = ' '
   
	if(bPercent)
		replace(szNewMath, charsmax(szNewMath), "%", "")
	   
	trim(szNewMath)
	fMath = str_to_float(szNewMath)
   
	if(bPercent)
		fMath *= fNum / 100
	   
	switch(cOperator)
	{
		case '+': fNum += fMath
		case '-': fNum -= fMath
		case '/': fNum /= fMath
		case '*': fNum *= fMath
		default: fNum = fMath
	}
   
	return fNum
}

This is my ini config file:

RankSystemDamage.ini
Code:
#5 - this will set the damage of each attack to be exactly 5
#+5 - this will add +5 damage to each attack
#+5% - this will increase the damage of each attack with 5%
# <level number> = <damage amount>
1 = +5
2 = +5
3 = +5
4 = +5
5 = +5
6 = +5
7 = +5
8 = +5
9 = +5
10 = +5
11 = +5
12 = +5
13 = +5
14 = +5
15 = +5
16 = +5
17 = +5
18 = +5
19 = +5
20 = +20%
21 = +21%
22 = +22%
23 = +23%
24 = +24%
25 = +25%
26 = +26%
27 = +27%
28 = +28%
29 = +29%
30 = +30%

RankSystemSpeed.ini
Code:
# level = speed amount
1 = 251
2 = 252
3 = 253
4 = 254
5 = 255
6 = 256
7 = 257
8 = 258
9 = 259
10 = 260
11 = 261
12 = 262
13 = 263
14 = 264
15 = 265
16 = 266
17 = 267
18 = 268
19 = 269
20 = 270
21 = 271
22 = 272
23 = 273
24 = 274
25 = 275
26 = 276
27 = 277
28 = 278
29 = 279
30 = 300

Last edited by carrx; 04-17-2020 at 06:01.
carrx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-17-2020 , 07:04   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #398

Use the "amx_plugins" command to check if the plugins are running.
If I recall correctly, ZP overrides the player's speed all the time, so there's nothing you can really do with an external plugin to change the speed.
I don't see why the damage wouldn't work.
__________________

Last edited by OciXCrom; 04-17-2020 at 07:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
paulitooo
Member
Join Date: Dec 2018
Old 04-17-2020 , 08:56   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #399

there is 30LVL i need more 60LVL
paulitooo is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-17-2020 , 09:03   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #400

Quote:
Originally Posted by paulitooo View Post
there is 30LVL i need more 60LVL
You can have 600000 levels if you want. Open the configuration file and add them. As simple as that.
__________________

Last edited by OciXCrom; 04-17-2020 at 09:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 16:11.


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