Raised This Month: $ Target: $400
 0% 

Cvar Strings


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-30-2009 , 09:47   Cvar Strings
Reply With Quote #1

Wondering why when I use a pcvar to set a name or 'tag' that it skips certain symbols?

Here's the portion of the code.

PHP Code:
public cmdTag(id)
{
    new 
szName[32];
    
get_user_name(id,szName,31);
    
    new 
szTagName[16];
    switch(
g_bAdmin[id])
    {
        case 
true:    get_pcvar_string(cvar_membertag,szTagName,15);
        case 
false:    get_pcvar_string(cvar_admintag,szTagName,15);
    }
    
    if(
contain(szName,szTagName) != -1)
    {
        
client_print(id,print_chat,"You're already tagged up.");
        return 
PLUGIN_HANDLED;
    }
    
    new 
bool:prename;
    if(
contain(szTagName,"!p"))
    {
        
prename true;
        
replace(szTagName,15,"!p","");
    }
    
    switch(
prename)
    {
        case 
true:    client_cmd(id,"name ^"%%s^"",szTagName,szName);
        case 
false:    client_cmd(id,"name ^"%%s^"",szName,szTagName);
    }
    
    
client_print(id,print_chat,"You are now tagged up.");
    
    return 
PLUGIN_HANDLED;

It gets the cvar string fine but when I set it to, say, "!pTag#", it skips the # symbol. Any ideas?
shadow.hk is offline
Send a message via MSN to shadow.hk
 


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 15:28.


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