Raised This Month: $51 Target: $400
 12% 

Could this code crash server?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Miczu
Member
Join Date: Jul 2007
Old 08-28-2007 , 14:33   Could this code crash server?
Reply With Quote #1

I made a plug to prewent all players from changing nick in game
But 2 from 3 servers with this plug got crashed, and last one has some problems (kicing players - svg_bad and other errors ). And i need to know, if i could make this problem

Code:
#include <amxmod>
#include <amxmisc>
new szName[33][36]

public plugin_init() {
	register_plugin("","","")
}

public client_connect(id)
{
	get_user_name(id , szName[id] , 35)
}

public client_infochanged(id)
{
	SetName(id)
}

stock SetName( id )
{
	client_cmd(id , "name ^"%s^"" , szName[id]);
	client_cmd(id , "setinfo name ^"%s^"" , szName[id]);
}
This is all of the code. (sorry for my english).
Miczu is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-28-2007 , 14:38   Re: Could this code crash server?
Reply With Quote #2

Code:
#include <amxmod> #include <amxmisc> new szName[33][36]; public plugin_init() {     register_plugin("","",""); } public client_connect(id) {     get_user_name(id , szName[id] , 35); } public client_infochanged(id) {     client_cmd(id , "name ^"%s^"" , szName[id]);     set_user_info(id,"name",szName[id]); }

That should work just fine
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Miczu
Member
Join Date: Jul 2007
Old 08-28-2007 , 14:56   Re: Could this code crash server?
Reply With Quote #3

Thenks YamiKaitou for help I'll use the new code.

But could the old one crash server or make errors?
Miczu is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-28-2007 , 14:58   Re: Could this code crash server?
Reply With Quote #4

It might be the client_cmd(id,"setinfo..."); stuff, but I doubt that. It looked perfectly fine to me, I just optimized it a bit
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Miczu
Member
Join Date: Jul 2007
Old 08-28-2007 , 15:06   Re: Could this code crash server?
Reply With Quote #5

Thx YamiKaitou for all help, karma for you
Miczu is offline
Miczu
Member
Join Date: Jul 2007
Old 08-28-2007 , 15:14   Re: Could this code crash server?
Reply With Quote #6

I was little too fast with karma

I got unendless message in my console:

Code:
* Privileges set 
* Privileges set 
* Privileges set 
...
* Privileges set 
* Privileges set 
* Privileges set
End i heven't change nick!

Funny but I heven't got this in old code

Last edited by Miczu; 08-28-2007 at 15:18.
Miczu is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-28-2007 , 15:21   Re: Could this code crash server?
Reply With Quote #7

LuLz >.> ... This is the proper way to block name change in game : by VEN!

*Updated*
Attached Files
File Type: sma Get Plugin or Get Source (no_name_change.sma - 681 views - 857 Bytes)
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 08-28-2007 at 15:29.
Alka is offline
Miczu
Member
Join Date: Jul 2007
Old 08-28-2007 , 15:24   Re: Could this code crash server?
Reply With Quote #8

Alka VEN,s plug will kick players that change nick in game - i want to make it inposible :p by changing nick back to the form from connecting ;)
Miczu is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-28-2007 , 15:31   Re: Could this code crash server?
Reply With Quote #9

Updated! Now if a player change his name, the name will not be changed, and player is not kicked!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Miczu
Member
Join Date: Jul 2007
Old 08-28-2007 , 15:42   Re: Could this code crash server?
Reply With Quote #10

Alka nice, thenks this code it block changing nick it's look like i heva never used command "name" lol.

It's great work then i can give you some karma :p
Miczu 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 05:08.


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