AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_cmd help (https://forums.alliedmods.net/showthread.php?t=183417)

Artifact 04-21-2012 15:19

client_cmd help
 
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).


fysiks 04-21-2012 22:26

Re: client_cmd help
 
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).

kramesa 04-21-2012 23:46

Re: client_cmd help
 
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);     } }

Artifact 04-22-2012 14:21

Re: client_cmd help
 
Nothing, same error...

fysiks 04-22-2012 14:24

Re: client_cmd help
 
Quote:

Originally Posted by Artifact (Post 1694559)
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.

[PUPPETS] Scooter 04-22-2012 14:25

Re: client_cmd help
 
Which is line 10 in the code shown above?

Artifact 04-22-2012 14:36

Re: client_cmd help
 
Quote:

Originally Posted by fysiks (Post 1694566)
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

EpicMonkey 04-22-2012 16:15

Re: client_cmd help
 
Quote:

Originally Posted by Artifact (Post 1694584)
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

Artifact 04-22-2012 17:36

Re: client_cmd help
 
Quote:

Originally Posted by EpicMonkey (Post 1694658)
you still didn't get what he posted

^^ no, sorry Im little stupid xD


All times are GMT -4. The time now is 07:51.

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