AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   knife only (https://forums.alliedmods.net/showthread.php?t=57193)

Raging 06-30-2007 08:57

knife only
 
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!!! :)

fxfighter 06-30-2007 12:22

Re: knife only
 
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")
}

Raging 07-01-2007 10:47

Re: knife only
 
thanks m8, i will try it out and let you know if it works:)

Raging 07-01-2007 11:04

Re: knife only
 
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:o

mateo10 07-01-2007 11:20

Re: knife only
 
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");     } }

Raging 07-02-2007 12:33

Re: knife only
 
Thanks Matte,

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

Karma +++

osk522 07-03-2007 15:13

Re: knife only
 
Hook weapon change event instead...


CPU USAGE


All times are GMT -4. The time now is 21:27.

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