Ranksystem subplugin request - give more XP on certain levels
-
mar1anx
Извън линия - Foreigner
- Мнения: 41
- Регистриран на: 17 Сеп 2018, 00:56
- Се отблагодари: 4 пъти
- Получена благодарност: 2 пъти
Ranksystem subplugin request - give more XP on certain levels
Hi,
I also have an idea for OciXCrom's ranksystem plugin.
Either a sub plug or a plugin edit to increase the drop to xp at a certain level.
Example:
From level 1 to 30 give the xp that is placed in RankSystem.ini and then give it more by 10-20, then at level 50 to get the total from level 30 another 10-20 xp.
But be compatible with happyhour.
Thanks,
I also have an idea for OciXCrom's ranksystem plugin.
Either a sub plug or a plugin edit to increase the drop to xp at a certain level.
Example:
From level 1 to 30 give the xp that is placed in RankSystem.ini and then give it more by 10-20, then at level 50 to get the total from level 30 another 10-20 xp.
But be compatible with happyhour.
Thanks,
Последно промяна от OciXCrom на 17 Сеп 2018, 15:16, променено общо 1 път.
Причина: Edited title! Please use more descriptive titles.
Причина: Edited title! Please use more descriptive titles.
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
Ranksystem request
crxranks_xp_per_level.sma
Create a new file in your configs folder named RankSystemXPL.ini and add the following content inside it:
As you can see from the settings I added:
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <crxranks>
#define PLUGIN_VERSION "1.0.2"
new Trie:g_tXP
new g_szXP[33][16]
public plugin_init()
{
register_plugin("CRXRanks: XP Per Level", PLUGIN_VERSION, "OciXCrom")
register_cvar("CRXRanksXPL", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
g_tXP = TrieCreate()
ReadFile()
}
public plugin_end()
TrieDestroy(g_tXP)
ReadFile()
{
new szFilename[256]
get_configsdir(szFilename, charsmax(szFilename))
add(szFilename, charsmax(szFilename), "/RankSystemXPL.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_tXP, szKey, szValue)
}
}
}
fclose(iFilePointer)
}
}
public client_putinserver(id)
{
g_szXP[id][0] = EOS
check_level(id, crxranks_get_user_level(id))
}
public crxranks_user_receive_xp(id, iXP, CRXRanks_XPSources:iSource)
{
if(!g_szXP[id][0] || iSource == CRXRANKS_XPS_ADMIN)
return CRXRANKS_CONTINUE
return floatround(math_add_f(float(iXP), g_szXP[id]))
}
public crxranks_user_level_updated(id, iLevel)
check_level(id, iLevel)
check_level(id, iLevel)
{
for(new szLevel[8], i = iLevel; i > 0; i--)
{
num_to_str(i, szLevel, charsmax(szLevel))
if(TrieKeyExists(g_tXP, szLevel))
{
TrieGetString(g_tXP, szLevel, g_szXP[id], charsmax(g_szXP[]))
break
}
}
}
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
}
Код за потвърждение: Избери целия код
#======================================================#
# CRXRanks: XP Per Level Configuration file #
#======================================================#
# This plugin requires OciXCrom's Rank System to work #
#======================================================#
# Add each amount of bonus XP on a new line following the format:
# <level number> = <amount of bonus XP>
30 = +10
50 = +20
- 30 = +10 means that when a player reaches level 30, he will get +10 XP every time he receives XP
- 50 = +20 means that when a player reaches level 50, he will get +20 XP every time he receives XP
-
mar1anx
Извън линия - Foreigner
- Мнения: 41
- Регистриран на: 17 Сеп 2018, 00:56
- Се отблагодари: 4 пъти
- Получена благодарност: 2 пъти
Ranksystem subplugin request - give more XP on certain levels
L 09/17/2018 - 19:29:35: [AMXX] Run time error 4: index out of bounds
L 09/17/2018 - 19:29:35: [AMXX] [0] crx_increasexp.txt::math_add (line 124)
L 09/17/2018 - 19:29:35: [AMXX] [1] crx_increasexp.txt::crxranks_user_receive_xp (line 107)
L 09/17/2018 - 19:29:46: Invalid map handle provided (0)
L 09/17/2018 - 19:29:46: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0")
L 09/17/2018 - 19:29:46: [AMXX] Run time error 10: native error (native "TrieKeyExists")
L 09/17/2018 - 19:29:46: [AMXX] [0] crx_increasexp.txt::crxranks_user_level_updated (line 115)
L 09/17/2018 - 19:29:35: [AMXX] [0] crx_increasexp.txt::math_add (line 124)
L 09/17/2018 - 19:29:35: [AMXX] [1] crx_increasexp.txt::crxranks_user_receive_xp (line 107)
L 09/17/2018 - 19:29:46: Invalid map handle provided (0)
L 09/17/2018 - 19:29:46: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0")
L 09/17/2018 - 19:29:46: [AMXX] Run time error 10: native error (native "TrieKeyExists")
L 09/17/2018 - 19:29:46: [AMXX] [0] crx_increasexp.txt::crxranks_user_level_updated (line 115)
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
-
mar1anx
Извън линия - Foreigner
- Мнения: 41
- Регистриран на: 17 Сеп 2018, 00:56
- Се отблагодари: 4 пъти
- Получена благодарност: 2 пъти
Ranksystem subplugin request - give more XP on certain levels
L 09/17/2018 - 23:48:48: Invalid map handle provided (0)
L 09/17/2018 - 23:48:48: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0")
L 09/17/2018 - 23:48:48: [AMXX] Run time error 10: native error (native "TrieKeyExists")
L 09/17/2018 - 23:48:48: [AMXX] [0] crx_increasexp.txt::crxranks_user_level_updated (line 115)
L 09/17/2018 - 23:48:48: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0")
L 09/17/2018 - 23:48:48: [AMXX] Run time error 10: native error (native "TrieKeyExists")
L 09/17/2018 - 23:48:48: [AMXX] [0] crx_increasexp.txt::crxranks_user_level_updated (line 115)
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
Ranksystem subplugin request - give more XP on certain levels
You didn't update the plugin. The error says the plugin version is 1.0, but the updated version is 1.0.1.
-
mar1anx
Извън линия - Foreigner
- Мнения: 41
- Регистриран на: 17 Сеп 2018, 00:56
- Се отблагодари: 4 пъти
- Получена благодарност: 2 пъти
Ranksystem subplugin request - give more XP on certain levels
L 09/18/2018 - 09:13:35: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0.1")
L 09/18/2018 - 09:13:35: [AMXX] Run time error 4: index out of bounds
L 09/18/2018 - 09:13:35: [AMXX] [0] crx_increasexp.txt::math_add (line 125)
L 09/18/2018 - 09:13:35: [AMXX] [1] crx_increasexp.txt::crxranks_user_receive_xp (line 108)
L 09/18/2018 - 09:13:43: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0.1")
L 09/18/2018 - 09:13:43: [AMXX] Run time error 4: index out of bounds
L 09/18/2018 - 09:13:43: [AMXX] [0] crx_increasexp.txt::math_add (line 125)
L 09/18/2018 - 09:13:43: [AMXX] [1] crx_increasexp.txt::crxranks_user_receive_xp (line 108)
there is a possibility to set from level 30 to 40 (31/32/33 / etc) to give + 20% and after 40 to 50 to give + 25% and so, or I have to put each level to give more xp?
L 09/18/2018 - 09:13:35: [AMXX] Run time error 4: index out of bounds
L 09/18/2018 - 09:13:35: [AMXX] [0] crx_increasexp.txt::math_add (line 125)
L 09/18/2018 - 09:13:35: [AMXX] [1] crx_increasexp.txt::crxranks_user_receive_xp (line 108)
L 09/18/2018 - 09:13:43: [AMXX] Displaying debug trace (plugin "crx_increasexp.amxx", version "1.0.1")
L 09/18/2018 - 09:13:43: [AMXX] Run time error 4: index out of bounds
L 09/18/2018 - 09:13:43: [AMXX] [0] crx_increasexp.txt::math_add (line 125)
L 09/18/2018 - 09:13:43: [AMXX] [1] crx_increasexp.txt::crxranks_user_receive_xp (line 108)
there is a possibility to set from level 30 to 40 (31/32/33 / etc) to give + 20% and after 40 to 50 to give + 25% and so, or I have to put each level to give more xp?
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
Ranksystem subplugin request - give more XP on certain levels
I edited the code again, now I tested and it's working.
You don't have to put each level, you can skip them. The player will receive the XP bonus from the last level added in the .ini file that he has.
You don't have to put each level, you can skip them. The player will receive the XP bonus from the last level added in the .ini file that he has.
-
mar1anx
Извън линия - Foreigner
- Мнения: 41
- Регистриран на: 17 Сеп 2018, 00:56
- Се отблагодари: 4 пъти
- Получена благодарност: 2 пъти
Ranksystem subplugin request - give more XP on certain levels
Thanks now works, if I find any problem I'll come back with a reply.
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
Ranksystem subplugin request - give more XP on certain levels
I'll lock the thread. If you have any problems or questions, use the orange Report button to let us know you want it to be unlocked.
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 0 Отговори
- 1403 Преглеждания
-
Последно мнение от mar1anx
-
- 3 Отговори
- 1611 Преглеждания
-
Последно мнение от Cirovic
-
- 7 Отговори
- 3385 Преглеждания
-
Последно мнение от iv69
-
- 8 Отговори
- 1786 Преглеждания
-
Последно мнение от The Pain
-
- 7 Отговори
- 2774 Преглеждания
-
Последно мнение от thoughtz
-
- 3 Отговори
- 1408 Преглеждания
-
Последно мнение от menkisa
-
- 6 Отговори
- 1727 Преглеждания
-
Последно мнение от OciXCrom
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 11 госта