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

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


Post New Thread Reply   
 
Thread Tools Display Modes
alferd
Veteran Member
Join Date: Dec 2019
Old 05-17-2020 , 01:38   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #421

This menu is for those who have a rank of 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10.

PHP Code:
#include <amxmodx>
#include <csstats>
#include <fun>
#include <cstrike>

#define PLUGIN "Weapon Menu TOP10"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new iRank;
new 
iStats[8];
new 
iBody[8];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say /weapons""WeaponMenu");
}

public 
WeaponMenu(id)
{
    
iRank get_user_stats(idiStatsiBody);
    if(
iRank <= 10)
    {
        new 
menu menu_create("Weapon Menu""MenuHandler");
        
        
menu_additem(menu"AK47 + Deagle [Rank 1]");
        
menu_additem(menu"weapon... [Rank 2 - 3]");
        
menu_additem(menu"weapon... [Rank 4 - 5]");
        
menu_additem(menu"weapon... [Rank 6 - 9]");
        
menu_additem(menu"Deagle [Rank 10]");
        
        
menu_display(idmenu);
    }
}

public 
MenuHandler(idmenuitem)
{
    if(
is_user_alive(id))
    {
        
iRank get_user_stats(idiStatsiBody);
        
        switch(
item)
        {
            case 
0:
            {
                if(
iRank == 1// Rank 1
                
{
                    
// strip_user_weapons(id); // Use this is u don't want players to have double weapons.
                    // give_item(id, "weapon_knife"); // Give knife again after stripping then.
                    
give_item(id"weapon_ak47");
                    
cs_set_user_bpammo(idCSW_AK4790);
                }
            }
            case 
1:
            {
                if(
iRank <= 3// Ranks 3 or lower.
                
{
                    
// Give Weapon + ammo
                
}
            }
            case 
2:
            {
                if(
iRank <= 5// Ranks 5 or lower.
                
{
                    
// Give Weapon + ammo
                
}
            }
            case 
3:
            {
                if(
iRank <= 9// Ranks 9 or lower.
                
{
                    
// Give weapon + ammo
                
}
            }
            case 
4:
            {
                if(
iRank <= 10// Ranks 10 or lower.
                
{
                    
// strip_user_weapons(id); 
                    // give_item(id, "weapon_knife");
                    
give_item(id"weapon_deagle");
                    
cs_set_user_bpammo(idCSW_DEAGLE35);
                }
            }
                    
        }
    }
    
menu_destroy(menu);

Is it possible to convert the rank to level?

Something like the example below:
PHP Code:
public WeaponMenu(id)
{
    
iLeve g_ePlayerData[id][Level// OciXCrom's Rank System
    
if(iLevel <= 10)
    {
        
client_print(idprint_chat,"Your Level is : %s",g_ePlayerData[id][Level])
    
        new 
menu menu_create("Weapon Menu""MenuHandler");
        
        
menu_additem(menu"AK47 + Deagle [Level 1]");
        
menu_additem(menu"weapon... [Level 2 - 3]");
        
menu_additem(menu"weapon... [Level 4 - 5]");
        
menu_additem(menu"weapon... [Level 6 - 9]");
        
menu_additem(menu"Deagle [Level 10]");
        
        
menu_display(idmenu);
    }

The bottom line is that I want to enable plugin for specified levels

Last edited by alferd; 05-17-2020 at 01:40.
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-17-2020 , 08:12   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #422

PHP Code:
#include <amxmodx>
#include <crxranks>
#include <fun>
#include <cstrike>

#define PLUGIN "Weapon Menu TOP10"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /weapons""WeaponMenu");
}

public 
WeaponMenu(id)
{
    new 
iRank crxranks_get_user_level(id);
    if(
iRank <= 10)
    {
        new 
menu menu_create("Weapon Menu""MenuHandler");

        
menu_additem(menu"AK47 + Deagle [Rank 1]");
        
menu_additem(menu"weapon... [Rank 2 - 3]");
        
menu_additem(menu"weapon... [Rank 4 - 5]");
        
menu_additem(menu"weapon... [Rank 6 - 9]");
        
menu_additem(menu"Deagle [Rank 10]");

        
menu_display(idmenu);
    }
}

public 
MenuHandler(idmenuitem)
{
    if(
is_user_alive(id))
    {
        new 
iRank crxranks_get_user_level(id);

        switch(
item)
        {
            case 
0:
            {
                if(
iRank == 1// Rank 1
                
{
                    
// strip_user_weapons(id); // Use this is u don't want players to have double weapons.
                    // give_item(id, "weapon_knife"); // Give knife again after stripping then.
                    
give_item(id"weapon_ak47");
                    
cs_set_user_bpammo(idCSW_AK4790);
                }
            }
            case 
1:
            {
                if(
iRank <= 3// Ranks 3 or lower.
                
{
                    
// Give Weapon + ammo
                
}
            }
            case 
2:
            {
                if(
iRank <= 5// Ranks 5 or lower.
                
{
                    
// Give Weapon + ammo
                
}
            }
            case 
3:
            {
                if(
iRank <= 9// Ranks 9 or lower.
                
{
                    
// Give weapon + ammo
                
}
            }
            case 
4:
            {
                if(
iRank <= 10// Ranks 10 or lower.
                
{
                    
// strip_user_weapons(id);
                    // give_item(id, "weapon_knife");
                    
give_item(id"weapon_deagle");
                    
cs_set_user_bpammo(idCSW_DEAGLE35);
                }
            }

        }
    }
    
menu_destroy(menu);

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
alferd
Veteran Member
Join Date: Dec 2019
Old 05-17-2020 , 09:01   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #423

Quote:
Originally Posted by OciXCrom View Post
PHP Code:
#include <amxmodx>
#include <crxranks>
#include <fun>
#include <cstrike>

#define PLUGIN "Weapon Menu TOP10"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /weapons""WeaponMenu");
}

public 
WeaponMenu(id)
{
    new 
iRank crxranks_get_user_level(id);
    if(
iRank <= 10)
    {
        new 
menu menu_create("Weapon Menu""MenuHandler");

        
menu_additem(menu"AK47 + Deagle [Rank 1]");
        
menu_additem(menu"weapon... [Rank 2 - 3]");
        
menu_additem(menu"weapon... [Rank 4 - 5]");
        
menu_additem(menu"weapon... [Rank 6 - 9]");
        
menu_additem(menu"Deagle [Rank 10]");

        
menu_display(idmenu);
    }
}

public 
MenuHandler(idmenuitem)
{
    if(
is_user_alive(id))
    {
        new 
iRank crxranks_get_user_level(id);

        switch(
item)
        {
            case 
0:
            {
                if(
iRank == 1// Rank 1
                
{
                    
// strip_user_weapons(id); // Use this is u don't want players to have double weapons.
                    // give_item(id, "weapon_knife"); // Give knife again after stripping then.
                    
give_item(id"weapon_ak47");
                    
cs_set_user_bpammo(idCSW_AK4790);
                }
            }
            case 
1:
            {
                if(
iRank <= 3// Ranks 3 or lower.
                
{
                    
// Give Weapon + ammo
                
}
            }
            case 
2:
            {
                if(
iRank <= 5// Ranks 5 or lower.
                
{
                    
// Give Weapon + ammo
                
}
            }
            case 
3:
            {
                if(
iRank <= 9// Ranks 9 or lower.
                
{
                    
// Give weapon + ammo
                
}
            }
            case 
4:
            {
                if(
iRank <= 10// Ranks 10 or lower.
                
{
                    
// strip_user_weapons(id);
                    // give_item(id, "weapon_knife");
                    
give_item(id"weapon_deagle");
                    
cs_set_user_bpammo(idCSW_DEAGLE35);
                }
            }

        }
    }
    
menu_destroy(menu);

PHP Code:
crxranks_get_user_level(id); 
Tnx
alferd is offline
Old 05-29-2020, 18:52
abobeanu
This message has been deleted by abobeanu. Reason: found the answer
abobeanu
Junior Member
Join Date: May 2020
Old 05-29-2020 , 21:03   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #424

Where can I Change the size of HUD message?
It look's to big on the mid of the screen.

This one:
abobeanu is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-29-2020 , 21:41   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #425

It's the standard font size. The HUD font size in CS cannot be changed. It can only be bigger by using DHUD font, but not smaller.

You can change the information shown or the position of the message if you find it getting in the way.
__________________

Last edited by OciXCrom; 05-29-2020 at 21:44.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 07-02-2020 , 03:08   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #426

Hi. How it is possible to do that the rank, level and xp reset automatically when reached a maximum level?

Last edited by LithuanianJack; 07-02-2020 at 03:09.
LithuanianJack is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-02-2020 , 07:56   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #427

The next update will feature tiers which you can use in order to do that. What this means is, when you reach the max level, you gain a +1 tear and get reset back to level 0.

For now, you can use this sub-plugin:

Code:
#include <amxmodx> #include <crxranks> #define RESET_DELAY 1.0 new g_iMaxLevels public plugin_init() {     register_plugin("CRXRanks: Reset on Last Level", "1.0", "OciXCrom")     g_iMaxLevels = crxranks_get_max_levels() }     public crxranks_user_level_updated(id, iLevel) {     if(iLevel == g_iMaxLevels)     {         set_task(RESET_DELAY, "reset_user_xp", id)     } } public reset_user_xp(id) {     crxranks_set_user_xp(id, 0) }
__________________

Last edited by OciXCrom; 07-02-2020 at 09:29.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
ZaX
Senior Member
Join Date: Jan 2015
Old 07-02-2020 , 08:00   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #428

Code:
crxranks_give_user_xp(id, crxranks_get_user_xp(id) * -1)
that supposed to be 0 right

also why not
Code:
crxranks_set_user_xp(id, 0)

Last edited by ZaX; 07-02-2020 at 08:01.
ZaX is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-02-2020 , 09:29   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #429

It's the same really. It's an older plugin, "crxranks_set_user_xp" was added in a later update. I changed it.
__________________

Last edited by OciXCrom; 07-02-2020 at 09:30.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 07-03-2020 , 16:21   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #430

Quote:
Originally Posted by OciXCrom View Post
The next update will feature tiers which you can use in order to do that. What this means is, when you reach the max level, you gain a +1 tear and get reset back to level 0.

For now, you can use this sub-plugin:

Code:
#include <amxmodx> #include <crxranks> #define RESET_DELAY 1.0 new g_iMaxLevels public plugin_init() {     register_plugin("CRXRanks: Reset on Last Level", "1.0", "OciXCrom")     g_iMaxLevels = crxranks_get_max_levels() }     public crxranks_user_level_updated(id, iLevel) {     if(iLevel == g_iMaxLevels)     {         set_task(RESET_DELAY, "reset_user_xp", id)     } } public reset_user_xp(id) {     crxranks_set_user_xp(id, 0) }
I'll use it. Thank you.

And additional request. Players requests me /top15 plugin which shows best 15 players MOTD with their levels and ranks. Isn't it hard for you to do that?
LithuanianJack 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 22:10.


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