Raised This Month: $ Target: $400
 0% 

Bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jacksmoke2345
Junior Member
Join Date: Feb 2005
Old 06-29-2006 , 04:27   Bug
Reply With Quote #1

I'm a new coder, and well the plugin I made (all it does is render someone a new color and change the persons model / name) works on my friends Dedicated Server, but does not work on my dedicated server, or listen server.

I made the plugin for The Specialists just to test some things out. Does anyone have an idea why it does not work on my servers?
jacksmoke2345 is offline
strikerx22
Junior Member
Join Date: Apr 2005
Old 06-29-2006 , 16:01   Re: Bug
Reply With Quote #2

David, give them the code for it.
__________________
Padme:Obi-Wan told me you killed my husband, the father of my child...
Vader:No! I am your babies Daddy!
Padme: *GASP*!?!?!?!?!?!?!
strikerx22 is offline
jacksmoke2345
Junior Member
Join Date: Feb 2005
Old 06-29-2006 , 19:23   Re: Bug
Reply With Quote #3

Okay the code is

Code:
#include <amxmodx>
#include <fun>

new isninja[33] = 0
public plugin_init() {
	register_plugin("WcW's Silent Plugin","1.0","WhoCaresWho")
	register_concmd("amx_silent","do_si",ADMIN_KICK,"Makes User Silent")
	
}
public do_si(id) {
	if (!(get_user_flags(id) &ADMIN_KICK) ) {
		console_print(id, "You have no access to that command!")
		return PLUGIN_HANDLED
	}
	if (read_argc () == 0) {
		console_print (id, "Specify a user!")
		return PLUGIN_HANDLED
	}
	new user[32], uid
	read_argv(1,user,32)
	uid = find_player ("bhl", user)
	if (uid == 0) {
		console_print (id, "Nobody by that name is here")
		return PLUGIN_HANDLED
	}
	else
		{
		isninja[id] = 1
		client_print(0,print_chat,"Someone has become a ninja!",1)
	}
	return PLUGIN_HANDLED
}
public client_PreThink(id){
	if(isninja[id] > 0){
		set_user_noclip(id, 1)
		client_cmd(id,"model ninja")
		client_cmd(id,"name Ninja")
	set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderNormal,25)
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}
public client_disconnect(id) isninja[id] = 0

public plugin_precache( ) {
	precache_model "models/player/ninja/ninja.mdl"
}
The part I bolded is where it seems to not work
Attached Files
File Type: sma Get Plugin or Get Source (ninja.sma - 687 views - 1.1 KB)
jacksmoke2345 is offline
jacksmoke2345
Junior Member
Join Date: Feb 2005
Old 06-29-2006 , 19:45   Re: Bug
Reply With Quote #4

Okay nevermind fixed that, but using the same code as before, what would I add to disable the above using the same command?
jacksmoke2345 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-30-2006 , 12:51   Re: Bug
Reply With Quote #5

This really needs a rewrite, here is a fixed version, it is untested however:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> new isninja[33] public plugin_init() {     register_plugin("WcW's Silent Plugin","1.0","WhoCaresWho")     register_concmd("amx_silent","do_si",ADMIN_KICK,"Makes User Silent")         register_event("ResetHUD","fnSetNinja","be")     } public do_si(id,level,cid) {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED             new user[32], uid     read_argv(1,user,32)     uid = cmd_target(id,user)     if (!uid)         return PLUGIN_HANDLED     else     {         isninja[uid] = 1                 static szName[33],szAdminName[33]         get_user_name(uid,szName,32)         get_user_name(id,szAdminName,32)                 fnSetNinja(id)                 switch(get_cvar_num("amx_show_activity"))         {             case 1 :                 client_print(0,print_chat,"ADMIN: %s has become a ninja",szName)             case 2 :                 client_print(0,print_chat,"ADMIN %s: %s has become a ninja",szAdminName,szName)         }     }         return PLUGIN_HANDLED } public fnSetNinja(id) {     // I'm going to leave these and not do it the proper way,     // on the off chance that this is actually the proper way     // for your mod.     client_cmd(id,"model ninja")     client_cmd(id,"name Ninja")     set_user_noclip(id,1)     set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderNormal,25) } public client_disconnect(id)     isninja[id] = 0 public plugin_precache( )     precache_model("models/player/ninja/ninja.mdl")
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 08:07.


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