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

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


Post New Thread Reply   
 
Thread Tools Display Modes
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 01-26-2020 , 11:44   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #361

Hello. The code I wrote is working. However, after 1-2 seconds it changes to the default model. How can I make permanent changes?

SOLVED:

Code:
#include <amxmodx>
#include <reapi>
#include <crxranks>

new const captainct[]     = "captainct";
new const captainte[]     = "captainte";

public plugin_init() 
{
    register_plugin("Rank Model Changer", "1.0", "msbeden");
    RegisterHookChain(RG_CBasePlayer_Spawn, "@CBasePlayer_Spawn", .post=true);
}

public plugin_precache() 
{
    precache_model("models/player/captainct/captainct.mdl");
    precache_model("models/player/captainte/captainte.mdl");
}

@CBasePlayer_Spawn(const id)
{
    new name[32];
    get_user_name(id, name, charsmax(name));

    new rank = crxranks_get_user_level(id);
    
    if(rank >= 8) {
        new TeamName:team = get_member(id, m_iTeam);

        if (team == TEAM_TERRORIST) {
            rg_set_user_model(id, captainte);
        } else if(team == TEAM_CT) {
            rg_set_user_model(id, captainct);
        } else {
            
        }
    }
}

Last edited by msbeden; 01-27-2020 at 01:31. Reason: SOLVED
msbeden is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-26-2020 , 13:59   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #362

You have another plugin that's resetting the model.
Why do you use reset_model before set_model? There's no point in doing that.
__________________

Last edited by OciXCrom; 01-26-2020 at 14:00.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 01-27-2020 , 01:12   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #363

Quote:
Originally Posted by OciXCrom View Post
You have another plugin that's resetting the model.
Why do you use reset_model before set_model? There's no point in doing that.

I have no idea. Maybe I thought it would work. Fortunately I did it.

Sir, the code "xplist" only shows online players. I want to show the experience ranking of all recordings on MOTD. How can I do it?
msbeden is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-27-2020 , 06:31   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #364

There's no such option at the moment because it's not easy to make. If you can find another plugin that does that, feel free to modify it using my plugin's natives.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 01-27-2020 , 13:19   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #365

It is necessary to make a ranking by connecting to the database. I think I can do it from the "xplist" code.
msbeden is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-27-2020 , 16:46   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #366

Not really. The "xplist" code is very simple and only for online players. To get the full list of both offline and online players, you will need to use SQL queries and other magic completelly different from the "xplist" command.
__________________

Last edited by OciXCrom; 01-27-2020 at 16:47.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 01-28-2020 , 01:01   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #367

Sir, wouldn't you be doing motd? I think it would be nice. I can say that it is perfect for the new update.

I will still try to do it myself
msbeden is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-28-2020 , 05:01   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #368

It's on my to-do list and I will add it at some point, but I don't feel like doing it at the moment. The reason for that is... well my laziness.
__________________

Last edited by OciXCrom; 01-28-2020 at 05:01.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 01-28-2020 , 07:39   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #369

I started, can you help? >> https://forums.alliedmods.net/showth...27#post2681927
msbeden is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 01-30-2020 , 13:53   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #370

Hey OciXCrom,
Can you supply a version that can save both steamid and their respective username to the mysql? Intend on implementing a webpage to display this info
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
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 19:54.


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