Raised This Month: $51 Target: $400
 12% 

Knife Mod - Special Abilities (Updated)


Post New Thread Reply   
 
Thread Tools Display Modes
spunko
Senior Member
Join Date: Jun 2005
Location: Ecuador
Old 12-14-2006 , 07:15   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #31

if ur an admin just typw those commands in console with the new values.. EX:
Code:
 
default 
km_highspeed 340 
 
type in console
km_highspeed 600
__________________
spunko is offline
Send a message via MSN to spunko
isti
Junior Member
Join Date: Nov 2006
Old 01-29-2007 , 11:51   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #32

Of The machete model don't work please update your attachment I am crazy to this plugin , If you want I will post here my version of this plugin with katana and more swords , knives ..


And it is not working ..... I editet your plugin and I am sure I edited it corectly but I receive the following errors :

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 84
Warning: Loose indentation on line 95
Warning: Loose indentation on line 121
Warning: Loose indentation on line 177
Header size: 1564 bytes
Code size: 9240 bytes
Data size: 5196 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 32384 bytes

4 Warnings.
Copied output file to: C:\Program Files\Valve\cstrike\addons\amxmodx\plugins\
Done.


Please resolve this errors because it does not work

This is my sma

Quote:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <vault>
#include <fun>

#define PLUGIN "Knife Mod"
#define VERSION "1.2"
#define AUTHOR "spunko"

#define TASK_INTERVAL 4.0
#define MAX_HEALTH 255

new knife_model[33]
new g_Menu

new CVAR_HIGHSPEED
new CVAR_LOWSPEED
new CVAR_LOWGRAV
new CVAR_NORMGRAV
new CVAR_HEALTH_ADD
new CVAR_HEALTH_MAX
new CVAR_DAMAGE

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)

register_event( "Damage", "event_damage", "be" )
register_event("CurWeapon","CurWeapon","be"," 1=1")

g_Menu = register_menuid("cutite")
register_menucmd(g_Menu, 1023, "knifemenu")

register_clcmd("say /cutite", "display_knife")

CVAR_HIGHSPEED = register_cvar("km_highspeed","340")
CVAR_LOWSPEED = register_cvar("km_lowspeed","170")
CVAR_HEALTH_ADD = register_cvar("km_addhealth", "20")
CVAR_HEALTH_MAX = register_cvar("km_maxhealth", "75")
CVAR_DAMAGE = register_cvar("km_damage", "80")
CVAR_LOWGRAV = register_cvar("km_lowgravity" , "400")
CVAR_NORMGRAV = get_cvar_pointer("sv_gravity")

set_task(480.0, "kmodmsg", 0, _, _, "b")
}

public plugin_precache() {
precache_model("models/knife-mod/v_butcher.mdl")
precache_model("models/knife-mod/p_butcher.mdl")
precache_model("models/knife-mod/v_machete.mdl")
precache_model("models/knife-mod/p_machete.mdl")
precache_model("models/knife-mod/v_bak.mdl")
precache_model("models/knife-mod/p_bak.mdl")
precache_model("models/knife-mod/v_pocket.mdl")
precache_model("models/knife-mod/p_pocket.mdl")
precache_model("models/v_knife.mdl")
precache_model("models/p_knife.mdl")
}

public display_knife(id) {
new menuBody[512]
add(menuBody, 511, "\rCutite\w^n^n")
add(menuBody, 511, "1. Macheta \y(Mult damage\agilitate mica)\w^n")
add(menuBody, 511, "2. Cutit militar \y(Nu se aud pasii )\w^n")
add(menuBody, 511, "3. Cutit de picnic \y(Viteza mare)\w^n")
add(menuBody, 511, "4. Unghiile lui Wolverine \y(Regenerarea viata)\w^n^n")
add(menuBody, 511, "0. Iesire^n")

new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<9 )
show_menu(id, keys, menuBody, -1, "Cutite")
}

public knifemenu(id, key) {
switch(key)
{
case 0: SetKnife(id , 4)
case 1: SetKnife(id , 2)
case 2: SetKnife(id , 3)
case 3: SetKnife(id , 1)
case 4: SetKnife(id , 0)
default: return PLUGIN_HANDLED
}
SaveData(id)
return PLUGIN_HANDLED
}

public SetKnife(id , Knife) {
knife_model[id] = Knife

new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
if ( Weapon != CSW_KNIFE )
return PLUGIN_HANDLED

new vModel[56],pModel[56]

switch(Knife)
{
case 0: {
format(vModel,55,"models/v_knife.mdl")
format(pModel,55,"models/p_knife.mdl")
}
case 1: {
format(vModel,55,"models/knife-mod/v_butcher.mdl")
format(pModel,55,"models/knife-mod/p_butcher.mdl")
}
case 2: {
format(vModel,55,"models/knife-mod/v_bak.mdl")
format(pModel,55,"models/knife-mod/p_bak.mdl")
}
case 3: {
format(vModel,55,"models/knife-mod/v_pocket.mdl")
format(pModel,55,"models/knife-mod/p_pocket.mdl")
}
case 4: {
format(vModel,55,"models/knife-mod/v_machete.mdl")
format(pModel,55,"models/knife-mod/p_machete.mdl")
}
}

entity_set_string(id, EV_SZ_viewmodel, vModel)
entity_set_string(id, EV_SZ_weaponmodel, pModel)

return PLUGIN_HANDLED;
}

public event_damage( id ) {

new victim_id = id;
if( !is_user_connected( victim_id ) ) return PLUGIN_CONTINUE
new dmg_take = read_data( 2 );
new dmgtype = read_data( 3 );
new Float:multiplier = get_pcvar_float(CVAR_DAMAGE);
new Float:damage = dmg_take * multiplier;
new health = get_user_health( victim_id );

new iWeapID, attacker_id = get_user_attacker( victim_id, iWeapID );

if( !is_user_connected( attacker_id ) || !is_user_alive( victim_id ) ) {
return PLUGIN_HANDLED
}

if( iWeapID == CSW_KNIFE && knife_model[attacker_id] == 4 ) {

if( floatround(damage) >= health ) {
if( victim_id == attacker_id ) {
return PLUGIN_CONTINUE
}else{
log_kill( attacker_id, victim_id, "knife", 0 );
}

return PLUGIN_CONTINUE
}else {
if( victim_id == attacker_id ) return PLUGIN_CONTINUE

fakedamage( victim_id, "weapon_knife", damage, dmgtype );
}
}
return PLUGIN_CONTINUE
}

public CurWeapon(id)
{
new Weapon = read_data(2)

// Set Knife Model
SetKnife(id, knife_model[id])

// Task Options

if(knife_model[id] == 0 && !task_exists(id) && Weapon == CSW_KNIFE)
set_task(TASK_INTERVAL , "task_healing",id,_,_,"b")
else if(task_exists(id))
remove_task(id)

// Abilities
set_user_footsteps(id , ( (knife_model[id] == 2 && Weapon == CSW_KNIFE) ? 1 : 0) )

new Float:Gravity = ((knife_model[id] == 1 && Weapon == CSW_KNIFE)? get_pcvar_float(CVAR_LOWGRAV) : get_pcvar_float(CVAR_NORMGRAV)) / 800.0
set_user_gravity(id , Gravity)

// Speed
new Float:Speed
if(Weapon != CSW_KNIFE || knife_model[id] < 3)
return PLUGIN_CONTINUE
else if(knife_model[id] == 3)
Speed = get_pcvar_float(CVAR_HIGHSPEED)
else if(knife_model[id] == 4)
Speed = get_pcvar_float(CVAR_LOWSPEED)

set_user_maxspeed(id, Speed)

return PLUGIN_HANDLED

}

stock log_kill(killer, victim, weapon[],headshot) {
user_silentkill( victim );

message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();

new kfrags = get_user_frags( killer );
set_user_frags( killer, kfrags++ );
new vfrags = get_user_frags( victim );
set_user_frags( victim, vfrags++ );

return PLUGIN_CONTINUE
}


public task_healing(id) {
new addhealth = get_pcvar_num(CVAR_HEALTH_ADD)
if (!addhealth)
return

new maxhealth = get_pcvar_num(CVAR_HEALTH_MAX)
if (maxhealth > MAX_HEALTH) {
set_pcvar_num(CVAR_HEALTH_MAX, MAX_HEALTH)
maxhealth = MAX_HEALTH
}

new health = get_user_health(id)

if (is_user_alive(id) && (health < maxhealth)) {
set_user_health(id, health + addhealth)
set_hudmessage(0, 255, 0, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.1, 4)
show_hudmessage(id,"<< !!Viata se regenereaza!! >>")
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(200)
write_byte(0)
write_byte(75)
message_end()
}

else {
if (is_user_alive(id) && (health > maxhealth))
remove_task(id)
}
}

public client_disconnect(id) {
if(task_exists(id)) remove_task(id)
}


public kmodmsg() {

client_print(0,print_chat,"Tasteaza /cutite in chat ca sa iti schimbi cutitul")
}

public client_authorized(id)
{
LoadData(id)
}

SaveData(id)
{

new authid[32]
get_user_authid(id, authid, 31)

new vaultkey[64]
new vaultdata[64]

format(vaultkey, 63, "KMOD_%s", authid)
format(vaultdata, 63, "%d", knife_model[id])
set_vaultdata(vaultkey, vaultdata)
}

LoadData(id)
{
new authid[32]
get_user_authid(id,authid,31)

new vaultkey[64], vaultdata[64]

format(vaultkey, 63, "KMOD_%s", authid)
get_vaultdata(vaultkey, vaultdata, 63)
knife_model[id] = str_to_num(vaultdata)

}
The messages and the menu is in Romanian.......

Last edited by isti; 01-29-2007 at 17:18. Reason: I am an idiot
isti is offline
Send a message via MSN to isti Send a message via Yahoo to isti Send a message via Skype™ to isti
spunko
Senior Member
Join Date: Jun 2005
Location: Ecuador
Old 01-29-2007 , 20:34   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #33

umm well, machete is working, the model and the abilities, maybe when u edited it u messed up some code..

for the errors you have, try Ctrl + i before saving in amxx studio, that will repair loose identation of those lines, then save and compile..

i'm kinda busy right now, so i cant help you more than that.. im working like crazy, i dont even have time to check my e-mail everyday..

good luck.. c ya
__________________
spunko is offline
Send a message via MSN to spunko
hugz
Junior Member
Join Date: Jan 2007
Old 02-10-2007 , 19:51   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #34

how do i activate this?
hugz is offline
hugz
Junior Member
Join Date: Jan 2007
Old 02-11-2007 , 10:17   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #35

i installed it rite but when i go to my server and type /knife nothing comes up
hugz is offline
Hatz
Member
Join Date: Jan 2007
Old 02-12-2007 , 14:37   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #36

Havent tried yet, but I am all about knifing and would love to use this, cept it would interfere with the uwc3 plugin and give players way unfair advantage.

Can some1 add code that makes people buy these knives for a set price? That would make it better.
Hatz is offline
senecas
Senior Member
Join Date: Jun 2006
Old 02-13-2007 , 06:35   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #37

i think there is a bug.

somtimes I could not access buy_menu with button B.

but could buy ammo things.

I am not sure. Does this plugin cause that symptom ?
senecas is offline
spunko
Senior Member
Join Date: Jun 2005
Location: Ecuador
Old 02-14-2007 , 22:44   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #38

Quote:
Originally Posted by hugz View Post
i installed it rite but when i go to my server and type /knife nothing comes up
Plz take a good look at the instructions.. maybe you forgot to activate a module, you need fun and engine.. if you dunno how to install a plugin take a look at my knife healing plugin.. there's a mini guide in it where it says INSTALLATION.

Quote:
Originally Posted by Hatz View Post
Havent tried yet, but I am all about knifing and would love to use this, cept it would interfere with the uwc3 plugin and give players way unfair advantage.

Can some1 add code that makes people buy these knives for a set price? That would make it better.
That can be made for sure, but i really dont have time, if you think you can code it by yourself take a look at the code i edited in silver weapons, it might help..

Quote:
Originally Posted by senecas View Post
i think there is a bug.

somtimes I could not access buy_menu with button B.

but could buy ammo things.

I am not sure. Does this plugin cause that symptom ?
This plugin doesn't do that, check your binds, maybe you did a wrong bind in that key, so now you cant birng the buy menu back..
__________________
spunko is offline
Send a message via MSN to spunko
senecas
Senior Member
Join Date: Jun 2006
Old 02-15-2007 , 21:01   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #39

I found the reason.

This plugin conflicts with my bomb_extrafeature plugin.
(when new round starts, server print out some of death msg, but they are alive and they cann't acces buy_menu)
you can find here http://forums.alliedmods.net/showthr...ght=bomb+extra

When I remove that plugin, the symptom's not appeared.

here's another bug.

somtimes server confues the killing msg.

ex)awp_india. somebody exactly killed one with AWP. but server played knife kill sound. and somebody killed one with knife. but server print out awp killing icon(right of top)
senecas is offline
Hatz
Member
Join Date: Jan 2007
Old 02-16-2007 , 22:26   Re: Knife Mod - Special Abilities (Updated)
Reply With Quote #40

ya not really the coding type, i can edit code pretty well but thats a lot of editing id have to do and id surely f something up, thanks for reply though
Hatz is offline
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 01:03.


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