AlliedModders

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

omgitsme 06-13-2010 10:32

knife plugin
 
i want to make my first plugin, it's just a simple knife in extra items menu. and when you buy it, and knife a zombie. it takes away 500hp (you can change this)
Code:


#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <zombieplague>

new g_epicknife
new g_hasknife
new g_takeknife
new g_damage
new g_knifecost

new const medicgun_viewmodel[] = "models/v_knifen.mdl";

public plugin_init()
{
    register_plugin("Epic knife", "1.0", "omgitsme");
    register_event("CurWeapon", "event_CurWeapon", "b", "1=1");
    register_event("Damage", "event_Damage", "b", "500");
    g_epicknife = zp_register_extra_item("Epic knife" ,g_knifecost , ZP_TEAM_HUMAN);
    g_hasknife =

don't laught please, it's my first plugin

5c0r-|3i0 06-13-2010 11:36

Re: knife plugin
 
1) g_hasknife should be an bool ...
2) You create a new variable called g_knifecost without an value => the knife will be free ( = 0 ).
....
Just post the part that is needed to be modified and we 'll help you .

Jelle 06-14-2010 08:51

Re: knife plugin
 
I don't get the purpose of this thread?

SaM.ThE.MaN 06-14-2010 09:39

Re: knife plugin
 
ive played on a server called Sorpack , they have done that

hzqst 06-14-2010 10:01

Re: knife plugin
 
Sorpack is from HK
it's easy to be done
there are many plugins that change knife model and damage


All times are GMT -4. The time now is 14:45.

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