AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to Add level a rank? (https://forums.alliedmods.net/showthread.php?t=128496)

PWA 06-01-2010 17:57

How to Add level a rank?
 
Hello everyone, i wanted to ask, how to add Level a rank?
Example : i have 1000XP and i get Level : 1 and the rank will be example - Begginer, how to add Ranks to levels?
Thq, if help me ;)

drekes 06-01-2010 18:49

Re: How to Add level a rank?
 
you make like 5 levels, then you make several ranks, and if he reaches a certain level, you can either reset his level and update there rank, or leave the level and update his rank. There is a tutorial about xp and rank in the tut section.

PWA 06-01-2010 19:06

Re: How to Add level a rank?
 
you think in that XP MOD?
I searched all, there is nothing about his, what a sad! there need to CHOSE a class, not level ranks.. :/

drekes 06-01-2010 19:09

Re: How to Add level a rank?
 
i'll make you an example tomorrow. I'm to tired right now.

Bugsy 06-01-2010 20:16

Re: How to Add level a rank?
 
This will set a players rank based on the number of XP points. ie., if a player has 250 XP points, he would be assigned to Good rank.
PHP Code:

enum Ranks
{
    
Noob,
    
Rookie,
    
Good,
    
Best,
    
Pro
}

new const 
RankXPRanks ][ ] = 
{
    {   
100 }, //Noob
    
101 200 }, //Rookie
    
201 300 }, //Good
    
301 400 }, //Best
    
401 999999999 //Pro
}

new const 
RankNameRanks ][] = 
{
    
"Noob",
    
"Rookie",
    
"Good",
    
"Best",
    
"Pro"
}

new 
g_XP33 ] , Ranks:g_PlayerRank33 ];

public 
SetRankid 
{
    for ( new 
Ranks:Noob <= Pro i++ )
    {
        if ( 
RankXP][ ] <= g_XPid ] <= RankXP][ ] )
        {
            
g_PlayerRankid ] = i;
            break;
        }
    }

    
client_printprint_chat "XP=%d Rank=%s" g_XPid ] , RankNameg_PlayerRankid ] ] );  



PWA 06-02-2010 05:16

Re: How to Add level a rank?
 
PHP Code:

enum {
CLASS_Nubiks 0,
CLASS_Iesacejs,
CLASS_Pieredzejusais,
CLASS_Viltigais,
CLASS_Ninzja,
CLASS_Masters,
CLASS_ObiVan,
CLASS_MastersYoda,
}

new const 
CLASSES[8][] = {
    
"Nubiks",
    
"Iesacejs",
    
"Pieredzejusais",
    
"Viltigais",
    
"Ninzja",
    
"Masters",
    
"ObiVan",
    
"MastersYoda"
}

//Heer you can add more levels
new const LEVELS[7] = {
    
1000,
    
2000,
    
3000,
    
5000,
    
7000,
    
10000,
    
15000,


I have like this, how to edit this script? to show ranks at that XP level?


All times are GMT -4. The time now is 05:24.

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