Raised This Month: $ Target: $400
 0% 

A working silver weapons plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
World Crafter
Junior Member
Join Date: Jul 2006
Old 09-30-2006 , 21:37   A working silver weapons plugin
Reply With Quote #1

More of a scripting question than a plugin request really, but its about the scripting of someone else's plugin.
http://forums.alliedmods.net/showthr...lver+weapon%2A
This is a plugin that supposedly lets you buy silver weapons. The silver weapons are supposed to be more power, have no reocil, and of course have a silver model.
This plugin only half works and it bugs the crap out of me. I've tested it on my own server and my friends server and the models do not work in this plugin. I'm no coder, but taking several long, hard looks at the code and comparing it with other plugins that change weapon models there is no difference. And the event that is supposed to change the models is called so what in the name of god is going on with this plugin?
There are a few other posts throughout that thread with other users having the same problem and the only person to respond with "well it works for me" is the person who made the plugin. Nobody else is reporting that it actually works.
__________________

Last edited by World Crafter; 10-03-2006 at 18:33.
World Crafter is offline
oneofthedragon
Member
Join Date: Jun 2006
Old 09-30-2006 , 21:44   Re: A working silver weapons plugin
Reply With Quote #2

Well then i better say it "Work(ed) well for me" I stopped using it just because i got tired of it. Make sure modules enabled, models in right places ect...
__________________
Need a map? PM me.
oneofthedragon is offline
World Crafter
Junior Member
Join Date: Jul 2006
Old 09-30-2006 , 21:56   Re: A working silver weapons plugin
Reply With Quote #3

Everyone knows that if the models weren't in the right place to start with then CS would have crashed due to the inability to precache "non existing" models. I've made sure that all neccessary modules are there and I've even tried forcing them to be enabled in modules.ini after failed attempts and runing the plugin with the default file. No cigar.
This is a plugin that changes my deagle model:
Code:
#include <amxmodx>
#include <engine>
#include <amxmisc>
public plugin_init()
{
	// Plugin Info
	register_plugin("Deagle Model Change","1.0","Dontask-jello")
	register_event("CurWeapon", "weaponChange", "be", "1=1")
	register_cvar("sv_gold_deagle", "1")
	return PLUGIN_CONTINUE
}
public plugin_precache()
{
	precache_model("models/v_goldcchs_deagle.mdl")
	precache_model("models/p_goldcchs_deagle.mdl")
	return PLUGIN_CONTINUE
}
public weaponChange(id)	
	if (get_cvar_num("sv_gold_deagle")) 
{
	new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
	if (wpnid == CSW_DEAGLE) {
		entity_set_string(id, EV_SZ_viewmodel, "models/v_goldcchs_deagle.mdl")	
		entity_set_string(id, EV_SZ_weaponmodel, "models/p_goldcchs_deagle.mdl")
	}
}
Now this plugin works. The silver weapons plugin doesn't. The code is 90% identical, the only difference being that the silver weapons plugin declares (id,clip,ammo) individually every time it checks to see what you weapon you have as opposed to this declaring it once as a variable. yes, I have tried changing the code in the silver plugin and it compiled fine but didn't solve a thing.
__________________
World Crafter is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-01-2006 , 04:31   Re: A working silver weapons plugin
Reply With Quote #4

In the silver weapons plugin, change

Code:
register_event("CurWeapon","event_curweapon","a")
to

Code:
register_event("CurWeapon","event_curweapon","be", "1=1")
organizedKaoS is offline
World Crafter
Junior Member
Join Date: Jul 2006
Old 10-01-2006 , 14:12   Re: A working silver weapons plugin
Reply With Quote #5

I'll try that and let you know what happens. Thanks.
__________________
World Crafter is offline
spunko
Senior Member
Join Date: Jun 2005
Location: Ecuador
Old 10-02-2006 , 06:09   Re: A working silver weapons plugin
Reply With Quote #6

Go there, I edited the code an it works fully now
http://forums.alliedmods.net/showthr...694#post386694
__________________
spunko is offline
Send a message via MSN to spunko
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-02-2006 , 10:23   Re: A working silver weapons plugin
Reply With Quote #7

in the plugin thread nexttime
k007 is offline
Send a message via MSN to k007
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 18:03.


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