This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Sell Weapons V0.2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 01-29-2005 , 09:53   Sell Weapons V0.2
Reply With Quote #1

Code:
/*
*	Sell Weapons V0.1
*	By Knekter
*
*	This plugin allows you to sell your weapons for
*	some extra cash!  This only works for guns...
*	ill be adding support for grenades and the knife
*	soon!
*
*	CVARS:
*	------
*	amx_sellweapon <1 = on | 0 = off>
*
*	COMMANDS:
*	---------
*	say /sell
*
*	Automatically finds the ID of your weapon and
*	returns half the cost of the weapon!
*
*	VERSIONS:
*	---------
*	V0.1 - Sell Weapons Released (BETA)
*	V0.2 - Added a different way to remove weapons (BETA 2)
*	V0.3 - Fixed an error with weapon removal (BETA 3)
*
*/
Enjoy
Attached Files
File Type: sma Get Plugin or Get Source (sellweapon.sma - 1496 views - 2.0 KB)
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 01-29-2005 , 10:28  
Reply With Quote #2

Your current implementation doesn't need the engine module.

Also you aren't really removing weapons, you're just using the (very) old "teleport back and forth" trick. That's likely not needed. Make em drop teh weapon and call think on the entity holding the weapon entity. Or the other way around. Which likely would make you need the engine module anyway, and possible fakemeta module.

Also use require_module() on every module needed.
Johnny got his gun is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 01-29-2005 , 11:07   ok
Reply With Quote #3

Thanks for the advice, I just came back and starting scripting a week ago, I quit during 0.16 < I think? and I havent seen fakemeta or I haven't used the call think. Ill work on it when I get a chance
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 01-29-2005 , 11:24  
Reply With Quote #4

If you did what Johnny said, I'd use this for sure .
__________________
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
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 01-29-2005 , 20:20   Test
Reply With Quote #5

I changed the way to remove the weapons but I don't know if it will work properly. If someone could test this for me I would greatly appreciate it!
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 01-30-2005 , 15:06   UPDATE
Reply With Quote #6

fixed the weapon removal code, I think it should work now!
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 01-31-2005 , 07:25  
Reply With Quote #7

You think? Did you try it?

You can't call remove_entity on weapons or weaponboxes. It will crash the server.
You have to call think on a weaponbox then remove the weapon entity (or the other way round).
Code:
//this will CBaseEntity::Think() or something from the entity native call_think(entity)
Also for no reason you are storing the model of the weaponbox into a string before you remove the weaponbox. But you do nothing with the string.
Johnny got his gun is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-13-2005 , 11:00  
Reply With Quote #8

Author PM me to approve this
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
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 16:55.


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