Raised This Month: $ Target: $400
 0% 

knife only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Raging
Junior Member
Join Date: Jul 2006
Old 06-30-2007 , 08:57   knife only
Reply With Quote #1

Hi there scripters,

I know that there are a number of knife only plugins but they don't do what i want.

I have a condition zero server. On this server i have installed the maps 35hp and 35hp_2. Cool maps but i also have the roll the dice plugin. So sometimes people get full equipment or you get the rambo.
Now i don't want to set that off cause i also have other maps installed.

I need a plugin that can remove weapons at all time (not only at a new roundstart) and only leave the knife.

I'm using the per map plugins loading option of amxmodx so if someone can help me out to make such a plugin that is not specific for above maps only (maybe in the future i have more knive maps) then i will be most thankfull.

ps. i don't need a vote option!!!

Last edited by Raging; 06-30-2007 at 09:01.
Raging is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 06-30-2007 , 12:22   Re: knife only
Reply With Quote #2

this might work.
it removes all weapon and give you a knife if you pick upp something.
but it wuld be easyer if you used the event left mouse click but
i dont remaber how to do it.

Quote:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("WeapPickup","Pickup","be")
}
public Pickup(id)
{
new clip , ammo , weapon = get_user_weapon ( id , clip , ammo )

if ( weapon != CSW_KNIFE )
{
set_task(1.0, "strip", id)
}
if ( weapon == CSW_KNIFE )
{
return PLUGIN_HANDLED
}
}
public strip(id)
{
client_print(id,print_chat,"No Guns!")
strip_user_weapons(id)
give_item(id,"weapon_knife")
}
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 06-30-2007 at 16:46.
fxfighter is offline
Send a message via MSN to fxfighter
Raging
Junior Member
Join Date: Jul 2006
Old 07-01-2007 , 10:47   Re: knife only
Reply With Quote #3

thanks m8, i will try it out and let you know if it works
Raging is offline
Raging
Junior Member
Join Date: Jul 2006
Old 07-01-2007 , 11:04   Re: knife only
Reply With Quote #4

Well i tested it but it didn't work. Well it worked but instead of removing weapons only 1 time it keeps checking for guns.

In game you will here the constant refreshing of weapons. (clicking sound). So if somebody can figure out what's wrong with the code
Raging is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 07-01-2007 , 11:20   Re: knife only
Reply With Quote #5

Test this:
Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_plugin("Force Knife", "1.00", "MaTTe");     register_forward(FM_PlayerPreThink, "forward_prethink"); } public forward_prethink(id) {     new temp;     new weapon = get_user_weapon(id, temp, temp);     if(weapon != CSW_KNIFE)     {         engclient_cmd(id, "weapon_knife");     } }
mateo10 is offline
Raging
Junior Member
Join Date: Jul 2006
Old 07-02-2007 , 12:33   Re: knife only
Reply With Quote #6

Thanks Matte,

It works good. You've been a great help for me.

Karma +++
Raging is offline
osk522
BANNED
Join Date: Dec 2006
Location: Slöinge, Falkenberg, Hal
Old 07-03-2007 , 15:13   Re: knife only
Reply With Quote #7

Hook weapon change event instead...


CPU USAGE
osk522 is offline
Send a message via MSN to osk522
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 21:27.


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