Raised This Month: $ Target: $400
 0% 

Checking player's name?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 07-19-2007 , 00:20   Re: Checking player's name?
Reply With Quote #1

You're making this more difficult than it needs to be:

Code:
client_cmd(id, "name Arion;wait;name L0lo")

OR maybe even ...

client_cmd(id, "name Arion;name L0lo")
stupok is offline
Arion
Senior Member
Join Date: Mar 2007
Old 07-20-2007 , 10:36   Re: Checking player's name?
Reply With Quote #2

Quote:
Originally Posted by Rolnaaba View Post
Code:
client_cmd(id, "comand #1"); client_cmd(id, "comand #2");


or you may need a delay:
Code:
client_cmd(id, "comand #1"); set_task(0.1, "comand2"); public comand2() { client_cmd(id, "comand #2"); }

something to that effect.
I tried that, but every time it changes for the second time, it changes a user info, who calls again the function client_infochanged(), so it's change the name again, and again, and again xD


Quote:
Originally Posted by stupok69 View Post
You're making this more difficult than it needs to be:

Code:
client_cmd(id, "name Arion;wait;name L0lo")

OR maybe even ...

client_cmd(id, "name Arion;name L0lo")

Yay, that works! But I needed to put 2 waits to work ("name Arion; wait; wait; name L0Lo").. but from time to time it changes the name again, maibe because a info of the player has changed.. Isn't there a way to use client_connect or client_putinserver instead of client_infochanged? Or to use a condition so the function will run only one time?

Arion is offline
Send a message via MSN to Arion
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-19-2007 , 11:55   Re: Checking player's name?
Reply With Quote #3

I think he might need delay, maybe even a couple of wait;s
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 07-20-2007 , 11:54   Re: Checking player's name?
Reply With Quote #4

So you want to set and/or block names or exec commands on your players ?
_Master_ is offline
Arion
Senior Member
Join Date: Mar 2007
Old 07-20-2007 , 17:32   Re: Checking player's name?
Reply With Quote #5

Actually, I want to automatic log in non-steam admins.
Because if you add an admin by his name, every mapchange he needs to change his name to something else, and then to the previous name.. Got it?

I know I know that this forum doesn't support anything about non-steam.. but you guys are helping me to execute a command on the client, and nothing else
Arion is offline
Send a message via MSN to Arion
stupok
Veteran Member
Join Date: Feb 2006
Old 07-20-2007 , 18:17   Re: Checking player's name?
Reply With Quote #6

Have you tried using the users.ini?

Code:
; Users configuration file
; File location: $moddir/addons/amxmodx/configs/users.ini

; Line starting with ; is a comment

; Access flags:
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
; b - reservation (can join on reserved slots)
; c - amx_kick command
; d - amx_ban and amx_unban commands
; e - amx_slay and amx_slap commands
; f - amx_map command
; g - amx_cvar command (not all cvars will be available)
; h - amx_cfg command
; i - amx_chat and other chat commands
; j - amx_vote and other vote commands
; k - access to sv_password cvar (by amx_cvar command)
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
; m - custom level A (for additional plugins)
; n - custom level B
; o - custom level C
; p - custom level D
; q - custom level E
; r - custom level F
; s - custom level G
; t - custom level H
; u - menu access
; z - user (no admin)

; Account flags:
; a - disconnect player on invalid password
; b - clan tag
; c - this is steamid/wonid
; d - this is ip
; e - password is not checked (only name/ip/steamid needed)

; Password:
; Add to your autoexec.cfg: setinfo _pw "<password>"
; Change _pw to the value of amx_password_field

; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags>

; Examples of admin accounts:
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"
stupok is offline
Arion
Senior Member
Join Date: Mar 2007
Old 07-20-2007 , 20:06   Re: Checking player's name?
Reply With Quote #7

Yes, since the beginning I'm using users.ini.. this model:

; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"


But, to login as admin, you need to change the name twice, which I trying to automate
Arion is offline
Send a message via MSN to Arion
Arion
Senior Member
Join Date: Mar 2007
Old 07-27-2007 , 22:31   Re: Checking player's name?
Reply With Quote #8

I tried this, but it doesn't work..

Code:
 public client_infochanged(id)
{
    static l0loChanged = 0
    new name[32]
    get_user_info(id, "name", name, 31)

    if(equal(name, "L0Lo") && l0loChanged == 0)
    {
        client_cmd(id, "name ^"Admin L0Lo connecting^"; wait; wait; name L0Lo")
        l0loChanged = 1
    }
}
I'm sure it's something wrong with that static and how it checks if the variable is 0... Any idea?


Nevermind..

Code:
 public client_putinserver(id)
{
    set_task(5.0, "name_check", id)
}

public name_check(id)
{
    new name[32]
    get_user_info(id, "name", name, 31)

    if(equal(name, "L0Lo"))
    {
        client_cmd(id, "name ^"Admin L0Lo connecting^"; wait; wait; name L0Lo")
    }
}
It works almost all times

Last edited by Arion; 07-28-2007 at 15:19.
Arion is offline
Send a message via MSN to Arion
_Master_
Senior Member
Join Date: Dec 2006
Old 07-30-2007 , 02:57   Re: Checking player's name?
Reply With Quote #9

what if you have like 100 admins ? You would add an "if(equal())" and a "client_cmd()" for each of them ?!?
_Master_ is offline
Arion
Senior Member
Join Date: Mar 2007
Old 07-30-2007 , 10:27   Re: Checking player's name?
Reply With Quote #10

For now, as I am the only admin on my server, this should be enough..

But if it was a server with many admins, we could make a for () that would read a .ini file with the admin names
__________________
Arion is offline
Send a message via MSN to Arion
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 21:28.


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