Raised This Month: $ Target: $400
 0% 

client_cmd help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-21-2012 , 15:19   client_cmd help
Reply With Quote #1

What is wrong?
PHP Code:
public client_connect(id)
{
    static 
aname[32]
    
get_user_name(idaname31)
    if(!
is_user_bot(id) && is_user_hltv(id) && (is_user_admin(id)==ADMIN_CVAR))
    {
        
client_cmd(id"name ^"%%s^""PREFIXaname)
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Invalid character constant on line 10
Error: Invalid character constant on line 10

2 Errors.
Could not locate output file C:\Program Files\AMX Mod X\amxxstudio\Untitled.amx (compile failed).
__________________
Artifact is offline
Old 04-21-2012, 15:58
Liverwiz
This message has been deleted by Liverwiz. Reason: Noobs will be noobs......
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-21-2012 , 22:26   Re: client_cmd help
Reply With Quote #2

is_user_admin() returns a boolean value, the same as is_user_bot() and is_user_hltv(). You don't compare it to ADMIN_* constants.

You can't change their name on client_connect() they are not in the server yet, use client_putinserver(). Also, when changing names from the server you should always use set_user_info(id, "name", szNewName).
__________________

Last edited by fysiks; 04-21-2012 at 22:26.
fysiks is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 04-21-2012 , 23:46   Re: client_cmd help
Reply With Quote #3

You dont need return on client_connect()

Try this

Code:
public client_connect(id) {     new szName[32];     get_user_name(id, szName, 31);         new szNewName[32];         if(!is_user_bot(id) && !is_user_hltv(id) && get_user_flags(id) & ADMIN_CVAR) {         formatex(szNewName, 31, "%s %s", PREFIX, szName);         set_user_info(id, "name", szNewName);     } }
__________________

Last edited by kramesa; 04-21-2012 at 23:58.
kramesa is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-22-2012 , 14:21   Re: client_cmd help
Reply With Quote #4

Nothing, same error...
__________________
Artifact is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-22-2012 , 14:24   Re: client_cmd help
Reply With Quote #5

Quote:
Originally Posted by Artifact View Post
Nothing, same error...
There is no compile errors in that code. However, the code won't work. If you really want to ignore my post then fine. I don't care.
__________________
fysiks is offline
[PUPPETS] Scooter
Member
Join Date: May 2009
Old 04-22-2012 , 14:25   Re: client_cmd help
Reply With Quote #6

Which is line 10 in the code shown above?
[PUPPETS] Scooter is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-22-2012 , 14:36   Re: client_cmd help
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
There is no compile errors in that code. However, the code won't work. If you really want to ignore my post then fine. I don't care.
Sorry fysiks but I dont know very well english then I dont read many posts, just short posts or posts with code

But, I dont get it, what boolean? I always use is_user_admin(id) because in include is is_user_admin(index) and that mean my index is ID
__________________
Artifact is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-22-2012 , 16:15   Re: client_cmd help
Reply With Quote #8

Quote:
Originally Posted by Artifact View Post
Sorry fysiks but I dont know very well english then I dont read many posts, just short posts or posts with code

But, I dont get it, what boolean? I always use is_user_admin(id) because in include is is_user_admin(index) and that mean my index is ID
you still didn't get what he posted
EpicMonkey is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-22-2012 , 17:36   Re: client_cmd help
Reply With Quote #9

Quote:
Originally Posted by EpicMonkey View Post
you still didn't get what he posted
^^ no, sorry Im little stupid xD
__________________
Artifact 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:51.


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