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.
Speed Per Level:
Код за потвърждение: Избери целия код
#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:
Код за потвърждение: Избери целия код
#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
Код за потвърждение: Избери целия код
#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
Код за потвърждение: Избери целия код
# 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