Raised This Month: $ Target: $400
 0% 

Gun + knife models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 04-10-2006 , 15:34   Gun + knife models
Reply With Quote #1

I was wondering how to set custom models and skins for guns.

I did this for my knife model and it worked

Code:
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])     if(weapon == CSW_KNIFE)     {         entity_set_string(id, EV_SZ_viewmodel, "models/v_knife_finger.mdl")         entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife_finger.mdl")     }

So I was wondering how to do the same thing for a gun? I tried using the knife code, but no luck.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-10-2006 , 16:37  
Reply With Quote #2

Same thing, except CSW_M4A1 or whatever it is you're trying to do.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Buddy
Junior Member
Join Date: Apr 2006
Location: Germany/Bayer
Old 04-10-2006 , 17:33  
Reply With Quote #3

hy....

how can i turn it [ON] [OFF] in the Map.cfg or Server.cfg, Amx.cfg

I used the Code from ---> Golden Colts

http://forums.alliedmods.net/showthread.php?p=132765

(I am from Germany and my english are very bad)

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <cstrike>

new g_lastweap[33]

public plugin_init() 
{ 
  	register_plugin("amx_Dragon_knife1", AMXX_VERSION_STR, "[MUDDA]Middy")
  	register_event("CurWeapon","handle_gun","be","1=1")
  	register_forward(FM_TraceLine,"fw_traceline",1);
}

public handle_gun(id)
{
  	new clip, ammo
 	new weap = get_user_weapon(id,clip,ammo)

  	if(clip > 16 && weap == CSW_KNIFE)
  	{
		new iWPNidx = -1,wpn[32]
		get_weaponname(weap,wpn,31)
		while ((iWPNidx = find_ent_by_class(iWPNidx, wpn)) != 0)
		{
			if (id == entity_get_edict(iWPNidx, EV_ENT_owner)) 
			{
				cs_set_weapon_ammo(iWPNidx,16)
			}
		}
 	}

  	if(weap == CSW_KNIFE && g_lastweap[id] != weap)
  	{
		entity_set_string(id, EV_SZ_viewmodel, "models/v_Dragon_knife1.mdl")
	}
}


public plugin_precache()
{
  	precache_model("models/v_Dragon_knife1.mdl")
}

public plugin_modules() 
{
	require_module("FakeMeta");
	require_module("Engine");
	require_module("Cstrike");
}

public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id) 
{
	if(!is_user_connected(id) || !is_user_alive(id)) 
	{
		return FMRES_IGNORED;
	}

	new victim = get_tr(TR_pHit);

	if(!is_user_connected(victim) || !is_user_alive(victim)) 
	{
		return FMRES_IGNORED;
	}

	new clip, ammo, weapon = get_user_weapon(id,clip,ammo);

	if(weapon != CSW_KNIFE || clip <= 0) 
	{
		return FMRES_IGNORED;
	}

	new hitplace = get_tr(TR_iHitgroup);

	if(hitplace == HIT_LEFTARM) 
	{
		set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect it an arm
	}
	else if(hitplace == HIT_RIGHTARM) 
	{
		set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect to a leg
	}
	else if(hitplace == HIT_RIGHTLEG)
	{
		set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect to a leg
	}
	else if(hitplace == HIT_LEFTLEG) 
	{
		set_tr(TR_iHitgroup,random_num(HIT_STOMACH,HIT_CHEST)); // redirect to a leg
	}
	
	return FMRES_IGNORED;	
}
Buddy is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 04-10-2006 , 22:06  
Reply With Quote #4

http://ghw-amxx.com/viewtopic.php?t=18
http://ghw-amxx.com/viewtopic.php?t=86
Jordan is offline
Buddy
Junior Member
Join Date: Apr 2006
Location: Germany/Bayer
Old 04-10-2006 , 22:30  
Reply With Quote #5

Hy..

thanks for help..

but the plugin is great.. it works

we have a other problem..

we want use a spezial old Deagl Model,
onely at one Map in the cycle--->de_westwood(western Map)

ore

we want to use a big mario hammer model for knife
at fun_mariodust

this forum are sooo great.... we love that
like Drugs.......
ther are the crazyest things for cs...
thanks too alll upers !!!! and admins from the forum

mfg Buddy and MichL

P.s. sorry my english are sooo bad....
but thanks forward
Buddy is offline
AAleaderNik
Member
Join Date: Dec 2005
Old 04-10-2006 , 22:34  
Reply With Quote #6

im guessing then you would want to add those models in precache then you need a cvar that you can turn on mario hammer model and you need a cvar for your gun model so you can turn it off on westwood
AAleaderNik is offline
Buddy
Junior Member
Join Date: Apr 2006
Location: Germany/Bayer
Old 04-10-2006 , 22:37  
Reply With Quote #7

hy..

thanks...

We know but we dont know what we had to write in
the .sma

you understand ????

mfg BUDDY MichL
Buddy is offline
AAleaderNik
Member
Join Date: Dec 2005
Old 04-10-2006 , 22:42  
Reply With Quote #8

o i dont know scripting that well either i was just tellin ya what you would need to do if u wanted that hoping that you would know how to do those things lol
AAleaderNik is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 04-10-2006 , 22:44  
Reply With Quote #9

something like this in precache
Code:
    new mapname[64];     get_mapname(mapname, 63);     if ( equali(mapname, "de_westwood") )         precache_model("spezial old Deagl Model")     else if equali(mapname, "fun_mariodust")         precache_model("big mario hammer model")
also add something like this on CurWeapon
Code:
new mapname[64];     get_mapname(mapname, 63); if ( weap == CSW_KNIFE && equali(mapname, "fun_mariodust")
[ --<-@ ] Black Rose is offline
Buddy
Junior Member
Join Date: Apr 2006
Location: Germany/Bayer
Old 04-10-2006 , 22:51  
Reply With Quote #10

Hey

Your are all sooo great !!!

we get a post in german

Code:
amxx unpause Pluginname
amxx pause pluginname


at the and z.b. aim_map.cfg

Thanks too all !!!!

But we cam back and post selfmade Plugins
Buddy 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 16:33.


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