Raised This Month: $ Target: $400
 0% 

Levels in XP TUT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 02-06-2010 , 13:46   Levels in XP TUT
Reply With Quote #1

in the XP TUT, whats the best way to amke it so when a player levels up it tells them a rank. Like for level 1 "Your rank is pravite!"
PHP Code:
new const LEVELS[6] = {
    
0,
    
50
    
100
    
200
    
350,
    
550

__________________
Zombiezzz is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-06-2010 , 13:50   Re: Levels in XP TUT
Reply With Quote #2

something like
PHP Code:
 if( your_parameters_to_find_if_he_leveledid ) ) {
LEVELS[id]++

new 
level LEVELS[id]

switch( 
level )
{
   case 
1: {
        
client_printidprint_chat"You're a private!" )
   }
   case 
2: { 
That kind of thing. I highly doubt that code will work, but make a switch for when they level to get what level they are, and then set a message for when they level. There are many other ways to do this.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-06-2010 , 13:51   Re: Levels in XP TUT
Reply With Quote #3

like this i presume

PHP Code:
new gszRanks[][] = 
{
    
"Private",
    
"General",
    
"etc.",
    
"",
    
"",
    
""
};

//...
public level_up(id)
{
    
client_print(idprint_chat"Your rank is %s"gszRank[giLevel[id]]);
    
//You will need to replace giLevel with the var that holds each players level

__________________
minimiller is offline
Send a message via MSN to minimiller
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-06-2010 , 13:54   Re: Levels in XP TUT
Reply With Quote #4

Quote:
Originally Posted by minimiller View Post
like this i presume

PHP Code:
new gszRanks[][] = 
{
    
"Private",
    
"General",
    
"etc.",
    
"",
    
"",
    
""
};

//...
public level_up(id)
{
    
client_print(idprint_chat"Your rank is %s"gszRank[giLevel[id]]);
    
//You will need to replace giLevel with the var that holds each players level

This one works much better and more efficiently. Use mini's.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 02-06-2010 , 14:15   Re: Levels in XP TUT
Reply With Quote #5

thank you all for your help
__________________
Zombiezzz is offline
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 07:27.


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