Raised This Month: $ Target: $400
 0% 

get_user_authid error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andrs
Junior Member
Join Date: Feb 2005
Old 02-28-2005 , 16:42   get_user_authid error
Reply With Quote #1

I'm a newbie at this so plz be nice.
What is wrong?

I get this error:
Client with that name or userid not found

note this is only a small part of the code
Code:
public client_connect(id) {     new steamuserid[32]     get_user_authid(id,steamuserid,31)     new Result:res = dbi_query(mysql, "SELECT nick FROM medlemar WHERE steamid='%s'", steamuserid)     if (res <= RESULT_NONE) {         server_cmd("amx_ban %s 1 reason",id)         return 1     }     client_cmd(id,"nick %s",res)     return PLUGIN_CONTINUE }
andrs is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-28-2005 , 16:49  
Reply With Quote #2

Code:
//... server_cmd("amx_ban #%d reason", get_user_userid(id) ) //...
xeroblood is offline
Send a message via MSN to xeroblood
andrs
Junior Member
Join Date: Feb 2005
Old 02-28-2005 , 18:09   More help
Reply With Quote #3

Code:
public client_connect(id) {     new steamuserid[32]     get_user_authid(id,steamuserid,31)     if (equal(steamuserid,"STEAM_ID_PENDING")) return PLUGIN_CONTINUE     new Result:res = dbi_query(mysql, "SELECT nick FROM medlemar WHERE steamid='%s'", steamuserid)     if (res <= RESULT_NONE) {         server_cmd("amx_ban #%d %d %s", get_user_userid(id), 5, "www.warserver.se" )         return PLUGIN_CONTINUE     }     client_cmd(id,"nick %s",res)     return PLUGIN_CONTINUE }

It wont work. why?

Table: medlemar
steamid: STEAM_0 : 1 : 33067
nick: andrs

My steam id is STEAM_0:13067

I've echo the authid and it returned "STEAM_0 : 1 : 33067"
andrs is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-28-2005 , 18:19  
Reply With Quote #4

Why is there spaces in the steam id u posted??

And maybe try putting in some trace code, like print to console in every block to see where things are going...
xeroblood is offline
Send a message via MSN to xeroblood
andrs
Junior Member
Join Date: Feb 2005
Old 02-28-2005 , 18:23  
Reply With Quote #5

Quote:
Originally Posted by xeroblood
Why is there spaces in the steam id u posted??

And maybe try putting in some trace code, like print to console in every block to see where things are going...
It ends with a ban. And why I have spaces i becouse it's spaces in auth (for a sick reason)
andrs is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-28-2005 , 18:29  
Reply With Quote #6

Try..
Code:
server_cmd("amx_ban #%d 5 ^"www.warserver.de^"", get_user_userid(id))
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-28-2005 , 19:27  
Reply With Quote #7

wtf
Don't use amx commands when using server_cmd() - That's EXTREMELY bad coding practice...

Try this:
Code:
new id,iMinutes,szSteamid[32] get_user_authid(id,szSteamid,31) server_cmd("kick #%d ^"Your steamid has been banned, because I hate you.^"", get_user_userid(id)) server_cmd("banid %d ^"%s^"", iMinutes, szSteamid)
or
Code:
new id,iMinutes,ip[32] get_user_ip(id,ip,31,1) server_cmd("kick #%d ^"Your ip has been banned, because you're ugly and you smell funny^"", get_user_userid(id)) server_cmd("addip %d %s", iMinutes, ip)

There may or may not be quotes around "ip" - I honestly don't remember.
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
andrs
Junior Member
Join Date: Feb 2005
Old 03-01-2005 , 10:28   res return wrong value
Reply With Quote #8

sry dubble post
andrs is offline
andrs
Junior Member
Join Date: Feb 2005
Old 03-01-2005 , 10:28   Re: res return wrong value
Reply With Quote #9

Code:
new Result:res = dbi_query(mysql, "SELECT `nick` FROM `medlemar` WHERE `steamid`='%s'", steamuserid) server_cmd("echo 4. res fetched (%s)",res)

res will return the steamid NOT `nick` for the "medlemar" table.

Why? and how do I get it to work?

Code:
public client_putinserver(id) {     server_cmd("echo 1. client_putinserver(%d) worked", id)     new steamuserid[32]     get_user_authid(id,steamuserid,31)     server_cmd("echo 2. authid (%s) taken",steamuserid)     if (equal(steamuserid,"STEAM_ID_PENDING")) return PLUGIN_CONTINUE     server_cmd("echo 3. steamid is not Steam_id_pending")     new Result:res = dbi_query(mysql, "SELECT `nick` FROM `medlemar` WHERE `steamid`='%s'", steamuserid)     if (res <= RESULT_NONE) {         server_cmd("echo 4. res fetched faild (%s)",res)         server_cmd("kick #%d ^"You have to register to play on this server. (<a href="http://www.warserver.se" target="_blank" rel="nofollow noopener">www.warserver.se</a>)^"", get_user_userid(id))         server_cmd("banid %d ^"%s^"", 5, steamuserid)         return PLUGIN_CONTINUE     }     server_cmd("echo 4. res fetched (%s)",res)     client_cmd(id,"name %s",res)     return PLUGIN_CONTINUE }
andrs 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 14:10.


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