Raised This Month: $ Target: $400
 0% 

changename


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andrs
Junior Member
Join Date: Feb 2005
Old 03-01-2005 , 11:36   changename
Reply With Quote #1

thx.
but I have a new problem
it doesn't work to use
Code:
client_cmd(id,"name %s", usernick)
the %s",usernick won't work in client_cmd
but if i try
Code:
server_cmd("echo %s", usernick)
it will return the nick perfectly

so is there any servercmd so i can changename at the person without "client_cmd"
andrs is offline
slurpycof
Senior Member
Join Date: Nov 2004
Old 03-01-2005 , 14:39  
Reply With Quote #2

try this
Code:
    // Get nick from medlemar where steamid is the same as steamuserid     new Result:res = dbi_query(mysql, "SELECT * FROM medlemar WHERE steamid='%s'", steamuserid)     // Check if user is registerd     if dbi_num_rows(res) < 1) {         // tempBan user because he/she's not registerd         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)         server_cmd("echo 4. res fetched faild (%s)",res)     }else{         new regnick[32]         dbi_nextrow(res)         dbi_result(res, "nick", regnick, 31)         server_cmd("echo 4. res fetched (%s)",regnick)         // change usernick to the registerd nick         client_cmd(id,"name %s",regnick)     }     dbi_free_result(res)       return PLUGIN_CONTINUE }
slurpycof is offline
andrs
Junior Member
Join Date: Feb 2005
Old 03-01-2005 , 14:46   ..
Reply With Quote #3

thx.
but I have a new problem
it doesn't work to use
Code:
client_cmd(id,"name %s", usernick)
the %s",usernick won't work in client_cmd
but if i try
Code:
server_cmd("echo %s", usernick)
it will return the nick perfectly

so is there any servercmd so i can changename at the person without "client_cmd"
andrs is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-01-2005 , 14:48  
Reply With Quote #4

I dunno if this will help..
Code:
client_cmd(id,"setinfo name ^"%s^"", usernick)
__________________
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
andrs
Junior Member
Join Date: Feb 2005
Old 03-01-2005 , 14:51  
Reply With Quote #5

Quote:
Originally Posted by v3x
I dunno if this will help..
Code:
client_cmd(id,"setinfo name ^"%s^"", usernick)
thx. But no it doesn't work
andrs is offline
slurpycof
Senior Member
Join Date: Nov 2004
Old 03-01-2005 , 14:52  
Reply With Quote #6

I tried to compile your code and it crashed. I removed the extra stuff and it compiles now if this helps any.

Code:
#include <amxmodx> #include <dbi> new Sql:mysql //---------------------------------------------------------------------------------------------- public plugin_init() {     register_plugin("ws.se medlemskoll","1.00","andrz")     set_task(1.0,"mysql_init") } //---------------------------------------------------------------------------------------------- public mysql_init() {     mysql = dbi_connect("localhost", "root", "", "n3xin_WS")     if (mysql < SQL_OK) {         new err[255]         new errNum = dbi_error(mysql, err, 254)         server_print("error1: %s|%d", err, errNum)         return 1     }     server_print("Connection handle: %d", mysql)     return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public client_putinserver(id) {     server_cmd("echo 1. client_putinserver (%d) worked",id)     // Get user steamid     new steamuserid[32]     get_user_authid(id,steamuserid,31)     server_cmd("echo 2. authid (%s) taken",steamuserid)     // Get nick from medlemar where steamid is the same as steamuserid     new Result:res = dbi_query(mysql, "SELECT * FROM medlemar WHERE steamid='%s'", steamuserid)     // Check if user is registerd     if (dbi_num_rows(res) < 1) {         // tempBan user because he/she's not registerd         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)         server_cmd("echo 4. res fetched faild (%s)",res)     }else{         new regnick[32]         dbi_nextrow(res)         dbi_result(res, "nick", regnick, 31)         server_cmd("echo 4. res fetched (%s)",regnick)         // change usernick to the registerd nick         client_cmd(id,"name %s",regnick)     }     dbi_free_result(res)       return PLUGIN_CONTINUE }
slurpycof is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 03-01-2005 , 14:53  
Reply With Quote #7

You do know that this
Code:
client_cmd(id,"name %s", usernick)
wont work until the next round correct?
__________________
twistedeuphoria is offline
andrs
Junior Member
Join Date: Feb 2005
Old 03-01-2005 , 14:56  
Reply With Quote #8

Quote:
Originally Posted by twistedeuphoria
You do know that this
Code:
client_cmd(id,"name %s", usernick)
wont work until the next round correct?
Yea if I changename in cstrike it will change after I selected a team. But it is not the problem.
andrs is offline
slurpycof
Senior Member
Join Date: Nov 2004
Old 03-01-2005 , 15:00  
Reply With Quote #9

Quote:
Originally Posted by twistedeuphoria
You do know that this
Code:
client_cmd(id,"name %s", usernick)
wont work until the next round correct?
That is good to know. Is there a client command like this?

server_exec - Forces server to execute sent server command at current time.
slurpycof is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 03-01-2005 , 15:28  
Reply With Quote #10

Well the client does execute it at exactly that time...the problem is that the game does not allow people's name to change while they are dead. I do not know a way around this with one command.
__________________
twistedeuphoria 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:14.


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