AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem change users nick (https://forums.alliedmods.net/showthread.php?t=28280)

L0neW0lf 05-11-2006 12:30

Problem change users nick
 
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

v3x 05-11-2006 12:35

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.

L0neW0lf 05-11-2006 12:44

Thanks a lot dude :)

One Q:
what is it with the ^

v3x 05-11-2006 12:49

The escape character.

L0neW0lf 05-11-2006 13:16

The part where people joins the server works like a charm, but for some reason it donst register people changing name ingame.........

v3x 05-11-2006 13:24

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.

Xanimos 05-11-2006 14:34

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.

L0neW0lf 05-11-2006 14:47

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

v3x 05-11-2006 14:50

Oops! I accidently took it out :P (edited)

I'm not a kid - I'm 18-years-old :D

L0neW0lf 05-11-2006 14:54

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 :lol: :P

But you both should feel good by saving an old mans day :)


All times are GMT -4. The time now is 05:09.

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