Raised This Month: $ Target: $400
 0% 

3 in 1 model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vincentwind
Junior Member
Join Date: Apr 2006
Old 04-24-2006 , 07:13   3 in 1 model
Reply With Quote #1

Can anyone can help me put 3models into 1model ?
1.amx_flashbangmodel
#include <amxmodx>
#include <engine>

public plugin_init()
{
// Plugin information
register_plugin("Teamdeagles","0.1","Ywa-NL")
register_event("CurWeapon", "weaponChange", "be", "1=1")
register_cvar("amx_teamdeagles", "1")

return PLUGIN_CONTINUE
}

public plugin_precache()
{
// Precache models
precache_model("models/topsever1/v_flashbang.mdl")
precache_model("models/topsever1/p_flashbang.mdl")

return PLUGIN_CONTINUE
}

public weaponChange(id)
{
if ( !get_cvar_num("amx_teamdeagles") )
return PLUGIN_CONTINUE

// Get needed information
//
// Weapon ID, Ammo, Clip
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
// Team
new team = get_user_team(id);


switch( team )
{
case 1:
{
if (wpnid == CSW_FLASHBANG)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_flashbang.mdl")
entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_flashbang.mdl")
}
}
case 2:
{
if (wpnid == CSW_FLASHBANG)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_flashbang.mdl")
entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_flashbang.mdl")
}
}
case 3:
{
if (wpnid == CSW_FLASHBANG)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_flashbang.mdl")
entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_flashbang.mdl")
}
}
}

return PLUGIN_CONTINUE

}

//
// End of plugin
//

2.amx_hegrenademodel
#include <amxmodx>
#include <engine>

public plugin_init()
{
// Plugin information
register_plugin("Teamdeagles","0.1","Ywa-NL")
register_event("CurWeapon", "weaponChange", "be", "1=1")
register_cvar("amx_teamdeagles", "1")

return PLUGIN_CONTINUE
}

public plugin_precache()
{
// Precache models
precache_model("models/topsever1/v_hegrenade.mdl")
precache_model("models/topsever1/p_hegrenade.mdl")

return PLUGIN_CONTINUE
}

public weaponChange(id)
{
if ( !get_cvar_num("amx_teamdeagles") )
return PLUGIN_CONTINUE

// Get needed information
//
// Weapon ID, Ammo, Clip
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
// Team
new team = get_user_team(id);


switch( team )
{
case 1:
{
if (wpnid == CSW_HEGRENADE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_hegrenade.mdl")
entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_hegrenade.mdl")
}
}
case 2:
{
if (wpnid == CSW_HEGRENADE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_hegrenade.mdl")
entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_hegrenade.mdl")
}
}
case 3:
{
if (wpnid == CSW_HEGRENADE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_hegrenade.mdl")
entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_hegrenade.mdl")
}
}
}

return PLUGIN_CONTINUE

}

//
// End of plugin
//

3.amx_c4model
#include <amxmodx>
#include <engine>

public plugin_init()
{
// Plugin information
register_plugin("Teamdeagles","0.1","Ywa-NL")
register_event("CurWeapon", "weaponChange", "be", "1=1")
register_cvar("amx_teamdeagles", "1")

return PLUGIN_CONTINUE
}

public plugin_precache()
{
// Precache models
precache_model("models/topsever1/v_c4.mdl")

return PLUGIN_CONTINUE
}

public weaponChange(id)
{
if ( !get_cvar_num("amx_teamdeagles") )
return PLUGIN_CONTINUE

// Get needed information
//
// Weapon ID, Ammo, Clip
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
// Team
new team = get_user_team(id);


switch( team )
{
case 1:
{
if (wpnid == CSW_C4)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_c4.mdl")
}
}
case 2:
{
if (wpnid == CSW_C4)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_c4.mdl")
}
}
case 3:
{
if (wpnid == CSW_C4)
{
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_c4.mdl")
}
}
}

return PLUGIN_CONTINUE

}

//
// End of plugin
//
vincentwind is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 04-24-2006 , 07:28   Re: 3 in 1 model
Reply With Quote #2

Code:
#include <amxmodx> #include <engine> public plugin_init() {     // Plugin information     register_plugin("Teamdeagles","0.1","Ywa-NL")     register_event("CurWeapon", "weaponChange", "be", "1=1")     register_cvar("amx_teamdeagles", "1")     return PLUGIN_CONTINUE } public plugin_precache() {     // Precache models     precache_model("models/topsever1/v_flashbang.mdl")     precache_model("models/topsever1/p_flashbang.mdl")     precache_model("models/topsever1/v_hegrenade.mdl")     precache_model("models/topsever1/p_hegrenade.mdl")     precache_model("models/topsever1/v_c4.mdl") } public weaponChange(id)   {     if ( !get_cvar_num("amx_teamdeagles") )         return PLUGIN_CONTINUE     // Get needed information     //     // Weapon ID, Ammo, Clip     new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)         swtich(wpnid)     {         case CSW_FLASHBANG: {             entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_flashbang.mdl")             entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_flashbang.mdl")         }         case CSW_HEGRENADE: {             entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_hegrenade.mdl")             entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_hegrenade.mdl")         }         case CSW_C4: {             entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_c4.mdl")         }     }     return PLUGIN_CONTINUE }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
vincentwind
Junior Member
Join Date: Apr 2006
Old 04-24-2006 , 07:36   Re: 3 in 1 model
Reply With Quote #3

Quote:
Originally Posted by Suicid3
Code:
#include <amxmodx> #include <engine> public plugin_init() {     // Plugin information     register_plugin("Teamdeagles","0.1","Ywa-NL")     register_event("CurWeapon", "weaponChange", "be", "1=1")     register_cvar("amx_teamdeagles", "1")     return PLUGIN_CONTINUE } public plugin_precache() {     // Precache models     precache_model("models/topsever1/v_flashbang.mdl")     precache_model("models/topsever1/p_flashbang.mdl")     precache_model("models/topsever1/v_hegrenade.mdl")     precache_model("models/topsever1/p_hegrenade.mdl")     precache_model("models/topsever1/v_c4.mdl") } public weaponChange(id)   {     if ( !get_cvar_num("amx_teamdeagles") )         return PLUGIN_CONTINUE     // Get needed information     //     // Weapon ID, Ammo, Clip     new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)         swtich(wpnid)     {         case CSW_FLASHBANG: {             entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_flashbang.mdl")             entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_flashbang.mdl")         }         case CSW_HEGRENADE: {             entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_hegrenade.mdl")             entity_set_string(id, EV_SZ_weaponmodel,"models/topsever1/p_hegrenade.mdl")         }         case CSW_C4: {             entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/v_c4.mdl")         }     }     return PLUGIN_CONTINUE }
5 Errors ?
Help Me
vincentwind is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 04-24-2006 , 07:55  
Reply With Quote #4

Change

swtich(wpnid) -->> switch(wpnid)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Tiny
Senior Member
Join Date: Jun 2004
Location: France
Old 05-06-2006 , 10:55  
Reply With Quote #5

Well how can I add this : new g_lastweap[33]
to check also the last used weapon.
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <cstrike>


public plugin_init() 
{ 
	register_plugin("Model","1.1","CC")
	register_event("CurWeapon","handle_gun","be","1=1")

	return PLUGIN_CONTINUE
}

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


public plugin_precache()
{
	precache_model("models/v_ROgold2.mdl")
	precache_model("models/p_ROgold2.mdl")
	precache_sound("weapons/clipin.wav")
	precache_sound("weapons/clipout.wav")
	precache_sound("weapons/sliderelease.wav")
	precache_model("models/p3_fiveseven.mdl")
	precache_model("models/v3_fiveseven.mdl")
	precache_model("models/w3_fiveseven.mdl")
	precache_sound("weapons/five7_clipin.wav")
	precache_sound("weapons/five7_clipout.wav")
	precache_sound("weapons/five7_deploy.wav")
	precache_sound("weapons/five7_release.wav")
	precache_sound("weapons/fiveseven-1.wav")
	precache_sound("weapons/fiveseven-2.wav")
	precache_model("models/p3_knife.mdl")
	precache_model("models/v3_knife.mdl")

}


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

	switch(weap) 
	{ 
	case CSW_ELITE:
		{
		entity_set_string(id, EV_SZ_viewmodel, "models/v_ROgold2.mdl")
		entity_set_string(id, EV_SZ_weaponmodel, "models/p_ROgold2.mdl")
		}
	case CSW_FIVESEVEN:
		{
		entity_set_string(id, EV_SZ_viewmodel, "models/v3_fiveseven.mdl")
		entity_set_string(id, EV_SZ_weaponmodel, "models/p3_fiveseven.mdl")
		}
	case CSW_KNIFE:
		{
		entity_set_string(id, EV_SZ_viewmodel, "models/v3_knife.mdl")
		entity_set_string(id, EV_SZ_weaponmodel, "models/p3_knife.mdl")
		}
	}
	return PLUGIN_CONTINUE
}
I would like to add it into:
case (weap == CSW_ELITE && g_lastweap[id] != weap)

but it doesn't seems to work

HELP

PS: and by the way is it necessary to check if the player is alive like other plugin model, cause I don't think so cause the dead and alive players can see the same weapon in this case.
__________________
KiKoo et Bisous
Tiny is offline
Reply


Thread Tools
Display Modes

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 05:12.


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