Raised This Month: $ Target: $400
 0% 

Problem change users nick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
L0neW0lf
Member
Join Date: Mar 2006
Location: Denmark
Old 05-11-2006 , 12:30   Problem change users nick
Reply With Quote #1

Hi i am trying to make a plugin to make sure users have names longer than one char, but i doesnt do anything.

I cant find anything in the log about execution or anything, but amx_plugins shows it running.

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Nick Manager" #define VERSION "1.1" #define AUTHOR "Lone Wolf @ clan-server.dk" #define change_nick "amx_nick" #define newname "Illegal Name" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)    } public client_putinserver(id) {     new name[18]     get_user_name(id, name, 17)     if (strlen(name)<2)         {         server_cmd("amx_nick %s %s",name,newname)     } }

btw i dont get any compile errors or warnings....

/LoneWolf
L0neW0lf is offline
Send a message via ICQ to L0neW0lf Send a message via MSN to L0neW0lf Send a message via Skype™ to L0neW0lf
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-11-2006 , 12:35  
Reply With Quote #2

Code:
public client_putinserver(id) {   check_name(id) } public client_infochanged(id) {   check_name(id) } public check_name(id) {     new name[33]     get_user_name(id, name, 32)     if (strlen(name) < 2) {         client_cmd(id , "name ^"%s^"" , newname)     } }
If you have questions, just ask.
__________________
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
L0neW0lf
Member
Join Date: Mar 2006
Location: Denmark
Old 05-11-2006 , 12:44  
Reply With Quote #3

Thanks a lot dude

One Q:
what is it with the ^
L0neW0lf is offline
Send a message via ICQ to L0neW0lf Send a message via MSN to L0neW0lf Send a message via Skype™ to L0neW0lf
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-11-2006 , 12:49  
Reply With Quote #4

The escape character.
__________________
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
L0neW0lf
Member
Join Date: Mar 2006
Location: Denmark
Old 05-11-2006 , 13:16  
Reply With Quote #5

The part where people joins the server works like a charm, but for some reason it donst register people changing name ingame.........
L0neW0lf is offline
Send a message via ICQ to L0neW0lf Send a message via MSN to L0neW0lf Send a message via Skype™ to L0neW0lf
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-11-2006 , 13:24  
Reply With Quote #6

Assuming that you're using the code I've provided:
Code:
public check_name(id) {     new new_name[33]     get_user_info(id , "name" , new_name , 32)     if (str_len(new_name) < 2) {         client_cmd(id , "name ^"%s^"" , newname)     } }
I think that should fix it.
__________________
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
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-11-2006 , 14:34  
Reply With Quote #7

Quote:
Originally Posted by v3x
Assuming that you're using the code I've provided:
Code:
public check_name(id) {     new new_name[33]     get_user_info(id , "name" , new_name , 32)     if (str_len(new_name)) {         client_cmd(id , "name ^"%s^"" , newname)     } }
I think that should fix it.
Ay, it will.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
L0neW0lf
Member
Join Date: Mar 2006
Location: Denmark
Old 05-11-2006 , 14:47  
Reply With Quote #8

Thanks guys

But since you "kids" rox at this (i am over 30 years) and newb. And you are powning me in scripting would i be to much to ask for a little explanation for the last code........

As far as i can see it dosnt, check if str_len is < 2 or is that what the _ do ?

Thanks again

/Wolf
L0neW0lf is offline
Send a message via ICQ to L0neW0lf Send a message via MSN to L0neW0lf Send a message via Skype™ to L0neW0lf
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-11-2006 , 14:50  
Reply With Quote #9

Oops! I accidently took it out (edited)

I'm not a kid - I'm 18-years-old
__________________
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
L0neW0lf
Member
Join Date: Mar 2006
Location: Denmark
Old 05-11-2006 , 14:54  
Reply With Quote #10

LOL thanks

Feeling danm good knowing my eyes is ok
you forgot and suicid3 missed it and said it would work..........powned by an old man

But you both should feel good by saving an old mans day
L0neW0lf is offline
Send a message via ICQ to L0neW0lf Send a message via MSN to L0neW0lf Send a message via Skype™ to L0neW0lf
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 05:09.


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