Raised This Month: $ Target: $400
 0% 

Change name points behind


Post New Thread Reply   
 
Thread Tools Display Modes
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-17-2010 , 21:31   Re: Change name points behind
Reply With Quote #11

This would fix that I think.
PHP Code:
public plugin_init()
{
    
register_event("TeamInfo""FwdTeamInfoEvent""a""1>0")
}

public 
FwdTeamInfoEvent()
{
    new 
id read_data(1)
    
points_in_name(id)

RedRobster is offline
Old 08-17-2010, 22:11
Bugsy
This message has been deleted by Bugsy.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2010 , 23:16   Re: Change name points behind
Reply With Quote #12

Quote:
Originally Posted by GXLZPGX View Post
I think the new problem he found, is every time the player rejoins, it adds another point system to his name.

Original Name:
TGIFridays

Name after first join:
TGIFridays<10>

Name after he leaves and comes back:
TGIFridays<10><10>
That's because he wasn't using my function (at all) when he got that result. My code removes the existing "<###>" and re-adds it meaning that there will always only be one.


So, what I'm saying is there is no problem with my code. However, it is capped at 9999 points.
__________________
fysiks is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 08-18-2010 , 05:59   Re: Change name points behind
Reply With Quote #13

Quote:
Originally Posted by RedRobster View Post
This would fix that I think.
PHP Code:
public plugin_init()
{
    
register_event("TeamInfo""FwdTeamInfoEvent""a""1>0")
}
 
public 
FwdTeamInfoEvent()
{
    new 
id read_data(1)
    
points_in_name(id)


thanks a lot to all, i will try this


EDIT: doesnt work this, fysiks your function works great, but if pllayer change the name doesnt appear the points behind your name

eg: when i join on server
add the points behind my name eg: MACE<10>
but if i change the name to LOL
the points doesnt appear on the name eg: LOL

i want the funtion to put the points behind when i change my name
i cant do that with the function client_infochanged(id), because this function add a lot of points behind your name
understand?

sorry for my english
__________________

#include ++ by MACE

Last edited by MrMaCEEE; 08-18-2010 at 06:17.
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 08-22-2010 , 16:15   Re: Change name points behind
Reply With Quote #14

help 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 08-22-2010 , 17:42   Re: Change name points behind
Reply With Quote #15

Quote:
Originally Posted by MrMaCEEE View Post
help pls
No. You don't listen.
__________________
fysiks is offline
m0v3
Member
Join Date: May 2009
Old 08-23-2010 , 05:28   Re: Change name points behind
Reply With Quote #16

Quote:
Originally Posted by fysiks View Post
That code looks familiar. However, you change it to be an inconsiderate server operator! Remove that code and leave it how I had it.

PHP Code:
public client_infochanged(id)
{
    
points_in_name(id)

I wanted to ask if it isn't an infinite loop ? As amx_nick sets info, again this func is called.
m0v3 is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 08-23-2010 , 11:17   Re: Change name points behind
Reply With Quote #17

yes, is infinite. I want to block this only change 1 time
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-23-2010 , 12:20   Re: Change name points behind
Reply With Quote #18

Quote:
Originally Posted by m0v3 View Post
I wanted to ask if it isn't an infinite loop ? As amx_nick sets info, again this func is called.
First of all my function DOES NOT use amx_nick. Second, if you use my original function it does not create an infinite loop. However, I just found that it does not let you change your name at all lol .

EDIT: I modified my function. I would suggest that you use it when points are added and not in client_infochanged().

PHP Code:
stock points_in_name(idiPoints)
{
    new 
szName[32], szName2[32]
    
get_user_name(idszNamecharsmax(szName))
    new 
iLen strlen(szName)

    if(
iLen)
    {
        
/* 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>"iPoints)
        
set_user_info(id"name"szName)
    }

__________________

Last edited by fysiks; 08-23-2010 at 14:01.
fysiks is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 08-30-2010 , 12:26   Re: Change name points behind
Reply With Quote #19

@fysiks thanks
__________________

#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 10:29.


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