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

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


Post New Thread Reply   
 
Thread Tools Display Modes
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 01-03-2019 , 10:39   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #161

Quote:
Originally Posted by OciXCrom View Post
If you want to start over, just change the "SQL_TABLE" option to a new name, otherwise it will give you that error.
i did it, changed to SQL_TABLE to NewRanks and i'm still getting that error and the data is not being saved in mysql, only steamid

PHP Code:
L 01/03/2019 13:18:30: [crx_ranksystemMysql.amxx] [SQL ErrorQuery failed (1064): You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ''STEAM_' at line 1 
this is my database



i guess the problem is something else, maybe i go back to using nvault, i wanted to use mysql to use the ranksystem in more than 1 server
tarsisd2 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-03-2019 , 14:37   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #162

I'm not sure why that is happening. I have tested the new features as much as I can and I didn't stumble upon such a problem. Can you try setting it to save by nickname instead of SteamID and change the SQL_TABLE again to see if the problem still persists? Don't use the update command though.
__________________

Last edited by OciXCrom; 01-03-2019 at 14:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 01-03-2019 , 15:13   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #163

Quote:
Originally Posted by OciXCrom View Post
I'm not sure why that is happening. I have tested the new features as much as I can and I didn't stumble upon such a problem. Can you try setting it to save by nickname instead of SteamID and change the SQL_TABLE again to see if the problem still persists? Don't use the update command though.
i did what you asked, changed to test if it would work, didn't!

PHP Code:
L 01/03/2019 18:02:57: [crx_ranksystemMysql.amxx] [SQL ErrorQuery failed (1064): You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ''Al' at line 1
L 01/03/2019 - 18:03:19: [crx_ranksystemMysql.amxx] [SQL Error] Query failed (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Pl' 
at line 1
L 01
/03/2019 18:03:29: [crx_ranksystemMysql.amxx] [SQL ErrorQuery failed (1064): You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ''Al' at line 1
L 01/03/2019 - 18:03:59: [crx_ranksystemMysql.amxx] [SQL Error] Query failed (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A' 
at line 1 


seems like it's trying to write to the player column but it's getting an syntax error and it's still not saving

for now i will use Nvault to save since it's working fine, untill we figure out what the problem is, mabe some one will know the issue, thanks very much
tarsisd2 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 01-03-2019 , 15:18   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #164

Quote:
Originally Posted by OciXCrom View Post
Try this:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <crxranks>
#include <fun>
#include <hamsandwich>

#define PLUGIN_VERSION "1.0"

new Trie:g_tWeightg_iWeight[33]

public 
plugin_init()
{
    
register_plugin("CRXRanks: Weighted XP"PLUGIN_VERSION"OciXCrom")
    
register_cvar("CRXRanksWXP"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
    
register_event("DeathMsg""OnPlayerKilled""a")
    
g_tWeight TrieCreate()
    
ReadFile()
}

public 
plugin_end()
    
TrieDestroy(g_tWeight)
    
ReadFile()
{
    new 
szConfigsName[256], szFilename[256]
    
get_configsdir(szConfigsNamecharsmax(szConfigsName))
    
formatex(szFilenamecharsmax(szFilename), "%s/RankSystemWeight.ini"szConfigsName)
    
    new 
iFilePointer fopen(szFilename"rt")
    
    if(
iFilePointer)
    {
        new 
szData[64], szValue[32], szMap[32], szKey[32], bool:bRead trueiSize
        get_mapname
(szMapcharsmax(szMap))
        
        while(!
feof(iFilePointer))
        {
            
fgets(iFilePointerszDatacharsmax(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(szDataszKeycharsmax(szKey), szValuecharsmax(szValue), '*')
                            
copy(szValuestrlen(szKey), szMap)
                            
bRead equal(szValueszKey) ? true false
                        
}
                        else
                        {
                            static const 
szAll[] = "#all"
                            
bRead equal(szDataszAll) || equali(szDataszMap)
                        }
                    }
                    else continue
                }
                default:
                {
                    if(!
bRead)
                        continue
                        
                    
strtok(szDataszKeycharsmax(szKey), szValuecharsmax(szValue), '=')
                    
trim(szKey); trim(szValue)
                            
                    if(!
szValue[0])
                        continue
                        
                    
TrieSetCell(g_tWeightszKeystr_to_num(szValue))
                }
            }
        }
        
        
fclose(iFilePointer)
    }
}

public 
client_putinserver(id)
    
crxranks_user_level_updated(idcrxranks_get_user_level(id), true)

public 
crxranks_user_level_updated(idiLevelbool:bLevelUp)
{
    
g_iWeight[id] = 0

    
for(new szI[8], iLevel0i--)
    {
        
num_to_str(iszIcharsmax(szI))
        
        if(
TrieGetCell(g_tWeightszIg_iWeight[id]))
            break
    }
}

public 
OnPlayerKilled()
{
    new 
iAttacker read_data(1), iVictim read_data(2)
    
    if(!
is_user_connected(iAttacker) || iAttacker == iVictim || !g_iWeight[iVictim])
        return

    
crxranks_give_user_xp(iAttackerg_iWeight[iVictim], _CRXRANKS_XPS_REWARD)
    
crxranks_give_user_xp(iVictimg_iWeight[iVictim] * -1_CRXRANKS_XPS_REWARD)
}

public 
crxranks_user_receive_xp(idiXPCRXRanks_XPSources:iSource)
    return (
g_iWeight[id] && iSource == CRXRANKS_XPS_REWARD) ? (iXP g_iWeight[id]) : CRXRANKS_CONTINUE 
Create a file in your "configs" folder named "RankSystemWeight.ini" and add in it the following:

PHP Code:
# <level> = <xp weight>
2
3
18 
4
26 
5
35 

For example, "18 = 4" means that players that reached level 18 will have a XP weight of 4.

When a player kills another player, he will receive the XP weight of the killed player, and the killed player will lose XP according to his own XP weight.

For example, player A has a XP weight of 4 and player B has 6.
If player A kills player B, player A will receive 6 XP and player B will lose 6 XP.

When a player receives any kind of XP that is set in the [XP Rewards] section in "RankSystem.ini", he will also receive the amount of XP weight he has.

For example, "headshot" is set to 2 in the configuration file and player B kills player A - player B will get the XP weight of player A which is 4 + the "headshot" event of 2 (+ any other events set in the .ini file) which will result in him gaining 6 XP. Player A will lose only 4 XP as this is his XP weight.

Let me know if things are working as they should, since I haven't tested the plugin. Also let me know if you want me to change something.
Using a formula to determine the XP weight can make the plugin work without an .ini file and make it much smaller, so let me know if you figure out some kind of formula. For example, XP weight = player level * 20 / 100.

About the assistance plugin you're using - post it here. Only 1 line needs to be added in order for it to give XP on assist.
this is working great, great work, just the chat msgs are not matching, if you could when you have a free time, edit it for me so it shows exactly how many points the player won and how many he lost

because now player is getting like 5 points and showing 2, and losing points and not showing

thanks a million
tarsisd2 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-03-2019 , 16:04   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #165

The chat message can't match because it's shown when you kill somebody, but the additional XP is awarded afterwards from the second plugin. One solution would be adding an additional chat message showing the bonus XP or disabling the chat message completely.
__________________

Last edited by OciXCrom; 01-03-2019 at 16:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 01-20-2019 , 03:12   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #166

Hello. I have the same problem:

PHP Code:
[crx_ranksystem.amxxYou have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 
Is this possible that the server shut downs because of this error?

Maybe I need to update my MySQL version? Now I'm using very old version "mysqlnd 5.0.11-dev - 20120503"

Last edited by LithuanianJack; 01-20-2019 at 03:41.
LithuanianJack is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-20-2019 , 07:21   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #167

Did you do the things mentioned in the update logs or is this the first time you're using the MySQL option?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 01-21-2019 , 05:55   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #168

Quote:
Originally Posted by OciXCrom View Post
Did you do the things mentioned in the update logs or is this the first time you're using the MySQL option?
I read update logs. This is the first time I'm using your plugin.

Additional question: how to move text in the other line? I'm trying to use these options but nothing changes:

HUDINFO_FORMAT = XP: $current_xp$/$next_xp$/n \n ^n Level: $level$/$max_levels$Rank: $rank$

Last edited by LithuanianJack; 01-21-2019 at 07:40.
LithuanianJack is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-21-2019 , 09:19   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #169

Click - use $br$

Try updating your MySQL version. I'm not sure what can cause that.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 01-21-2019 , 10:34   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #170

Quote:
Originally Posted by LithuanianJack View Post
I read update logs. This is the first time I'm using your plugin.

Additional question: how to move text in the other line? I'm trying to use these options but nothing changes:

HUDINFO_FORMAT = XP: $current_xp$/$next_xp$/n \n ^n Level: $level$/$max_levels$Rank: $rank$
i use this on my server, hud under the radar:

HUDINFO_POSITION = 0.02 0.23

HUDINFO_FORMAT =Rank: $rank$ $br$XP: $current_xp$/$next_xp$ $br$LvL: $level$/$max_levels$ $br$+info /xp, /level, /xplist
tarsisd2 is offline
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 06:07.


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