Raised This Month: $ Target: $400
 0% 

Put this on player name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 06-01-2010 , 18:44   Put this on player name
Reply With Quote #1

I want to change the constant TAG_CT [] and TAG_TR [] = " <100>" to receive player points, I have the sources see:

When you wirte .skill appear the playerpoints eg: You have 12 skillpoints!

PHP Code:
public cmd_show_points(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
 
    new 
arg[32], pname[32]
    
read_argv(1arg31)
 
    new 
player cmd_target(idarg8)
 
    
get_user_name(player,pname,31);
 
    if(!
player)
        return 
PLUGIN_HANDLED;
 
    
client_print(id,print_console,"%s, tens %d skillpoints!",pname,points[player]);
 
    return 
1;

And when player connect to server change automatically nickname and i already have the code:
PHP Code:
 public team_join()  
{  
    new 
id read_data(1)  
    new 
arg[32], pname[32]
    
read_argv(1arg31)
    static 
name[33]  
    
get_user_name(id,name,32)  
    new 
player cmd_target(idarg8)
 
    switch(
cs_get_user_team(id))  
    {  
        case 
CS_TEAM_T:  
        {  
            if(
equal(nameTAG_TRcharsmax(TAG_TR)))  
            {  
                return 
// Player already has the appropriate tag.  
            
}  
            else if( !
replace(namecharsmax(name), TAG_CTTAG_TR) )  
            {  
                
format(namecharsmax(name), "%s%s"nameTAG_TR)  
            }  
 
            
set_user_info(id"name"name)  
        }  
        case 
CS_TEAM_CT:  
        {  
            if(
equal(nameTAG_CTcharsmax(TAG_CT)))  
            {  
                return 
// Player already has the appropriate tag.  
            
}  
            else if( !
replace(namecharsmax(name), TAG_TRTAG_CT) )  
            {  
                
format(namecharsmax(name), "%s%s"nameTAG_CT)  
            }  
            
set_user_info(id"name"name)
        }  
    }  

Now i want put the change automatically name to the player points, someone can help? and need more codes to see better? Sorry for my bad english
__________________

#include ++ by MACE

Last edited by MrMaCEEE; 06-01-2010 at 18:47.
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-01-2010 , 20:07   Re: Put this on player name
Reply With Quote #2

How often does the name need to be updated?
Show and example name with skill points.
What is the range of skill points? 0 - 1000? 1 - 100?
__________________
fysiks is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 06-02-2010 , 08:27   Re: Put this on player name
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
How often does the name need to be updated?
Show and example name with skill points.
What is the range of skill points? 0 - 1000? 1 - 100?
the range maybe 0 - 9000
and name only update 1 time when the player join on server.
and only change her skillpoints on the nextmap

eg: MACE <1510>
when map change automatically change my name to eg: MACE <1560>

can you help?

thanks a lot
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-02-2010 , 19:49   Re: Put this on player name
Reply With Quote #4

Ok, I made a function that will add or update the points in a player's name. Try it out.

PHP Code:
/*
    Adds or updates the points in a player's name
    E.g. MyName <1234>
*/
stock points_in_name(id)
{
    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
    new 
iLen strlen(szName)
    
    
/* Finds and removes "<####>" */
    
new iPos iLen 1
    
if( szName[iPos] == '>' )
    {
        for( new 
16i++)
        {
            if( 
szName[iPos i] == '<' )
            {
                
iLen iPos i
                szName
[iLen] = '^0'
                
break
            }
        }
    }
    
    
format(szName[iLen], charsmax(szName) - iLenszName[iLen-1] == ' ' "<%d>" " <%d>"points[id])
    
set_user_info(id"name"szName)

__________________

Last edited by fysiks; 06-02-2010 at 20:00.
fysiks is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 06-03-2010 , 11:30   Re: Put this on player name
Reply With Quote #5

thanks fysiks i will try, thanks soo much
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 06-03-2010 , 12:06   Re: Put this on player name
Reply With Quote #6

fysiks maybe dont work i will Attach the source code an try you pls.
__________________

#include ++ by MACE

Last edited by MrMaCEEE; 06-13-2010 at 10:06.
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2010 , 15:32   Re: Put this on player name
Reply With Quote #7

Quote:
Originally Posted by MrMaCEEE View Post
fysiks maybe dont work i will Attach the source code an try you pls.
I don't see my code in there anywhere. What is not working?
__________________
fysiks is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 06-03-2010 , 16:15   Re: Put this on player name
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
I don't see my code in there anywhere. What is not working?
ye, i know this is orginnal source code, you can put your code here? and i will test pls
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2010 , 16:26   Re: Put this on player name
Reply With Quote #9

Quote:
Originally Posted by MrMaCEEE View Post
ye, i know this is orginnal source code, you can put your code here? and i will test pls
You can put the function in there anywhere and then call the function wherever you want the name to be updated.
__________________
fysiks is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 06-03-2010 , 16:33   Re: Put this on player name
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
You can put the function in there anywhere and then call the function wherever you want the name to be updated.
sorry i dont understand very well, can you put this function on the code pls? and call the function pls and attach thanks a lot
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
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 21:50.


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