Raised This Month: $ Target: $400
 0% 

Problem with name-change plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
unique`
New Member
Join Date: Jul 2008
Old 08-27-2008 , 07:33   Problem with name-change plugin
Reply With Quote #1

Hello !
Yesterday I was working on a pretty simple plugin that puts tags in front of all players name (I thought it was simple, until it didn't work xD). I don't want to talk to much jibber-jabba
here's the code:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
#define tag_terror "[T]"
#define tag_ct "[CT]"



public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
}
public 
client_connect(id)
{
    new 
CsTeams:team cs_get_user_team(id);
    new 
name[32];
    
get_user_name(id,name,31);
    
    switch(
team)
    {
        case 
CS_TEAM_T:
        {
            
client_cmd(id,"name ^"%%s^"",tag_terror,name);
        }
        case 
CS_TEAM_CT:
        {
            
client_cmd(id,"name ^"%%s^"",tag_ct,name);
        }
    }
    
}

public 
client_infochanged(id)
{    
    new 
newname[32],oldname[32]
    
get_user_info(id"name"newname,31)
    
get_user_name(id,oldname,31)
    
client_cmd(id,"name %s",oldname);

Thanks for reading and for help !
unique` is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-02-2008 , 08:24   Re: Problem with name-change plugin
Reply With Quote #2

mistake
__________________


Last edited by anakin_cstrike; 09-02-2008 at 08:27.
anakin_cstrike is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-02-2008 , 08:26   Re: Problem with name-change plugin
Reply With Quote #3

PHP Code:
new name[32],Buffer[64];
get_user_name(id,name,31);
 
switch(
get_user_team(id))
{
      case 
1format(Buffer,63,"[T] %s",name);
      case 
2format(Buffer,63,"[CT] %s",name);
}
client_cmd(id,"name ^"%s^"",Buffer); 
__________________

anakin_cstrike 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 03:16.


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