PDA

View Full Version : Hero Request:Dual man


laptopgun3
11-12-2004, 13:48
Dual Mac-10's and if thats already made then dual M4A1's

Chivas2973
11-12-2004, 14:32
Dual Mac-10's and if thats already made then dual M4A1's

why not just make it, model heros are a joke to make if you just open the sma of a model hero

Buttface
11-12-2004, 15:08
chivas is right i mean its not even a hero with just a model you might as well just find the model and switch it with the gun you want :roll:

Kebmaster
11-12-2004, 16:04
Well, u can give it extra damage and stuff (like morpheus has)

but then it would be a rip off :roll:

laptopgun3
11-12-2004, 16:55
well ok but what do i have to change?

Chivas2973
11-12-2004, 17:00
everything that has the heros name, ex morpheus to dual, then change the model destination and the model

not rocket science, open the sma and take a look

laptopgun3
11-12-2004, 19:23
ahh yes that part i get but NOW where do i find models?

laptopgun3
11-12-2004, 20:54
everything that has the heros name, ex morpheus to dual, then change the model destination and the model

not rocket science, open the sma and take a look
it didnt work... i chaned the names and the model destination but my server just freezes when i or anybody else joins what did i do wrong? here is the SMA

#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

// M4Killer - Kills People With Dual M4's
//
// CVARS
// M4Killer_gravity - Gravity M4Killer has
// M4Killer_level - what level must they be for morpheus powers?

// VARIABLES
new gHeroName[]="M4Killer"
new gHasMorphPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO M4Killer","1.0","RadidEskimo & Freecode")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create Morpheus Hero")
register_cvar("M4Killer_level", "8")
shCreateHero(gHeroName, "Goodie Bag", " Lower Gravity/Dual M4's/Punisher Skills", false, "M4Killer_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("morpheus_init", "morpheus_init")
shRegHeroInit(gHeroName, "morpheus_init")
register_event("ResetHUD","newRound","b")
register_event("WeapPickup","model","b","1=19")
register_event("CurWeapon","check_mp5","be","1=1")
// DEFAULT THE CVARS
register_cvar("M4Killer_gravity", "0.35" )

// Let Server know about M4Killer's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMinGravity(gHeroName, "M4Killer_gravity" )
}
//----------------------------------------------------------------------------------------------
public morpheus_init()
{
new temp[6]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has flash
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

if ( hasPowers )
gHasMorphPower[id]=true
else
gHasMorphPower[id]=false
}
//----------------------------------------------------------------------------------------------
public newRound(id) {
if ( gHasMorphPower[id] && is_user_alive(id) && shModActive() ) {
morpheus_weapons(id)
}
else{
nomodel(id)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public morpheus_weapons(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
shGiveWeapon(id,"weapon_m249")
shGiveWeapon(id,"ammo_9mm")
model(id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public model(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public check_mp5(id)
{
new clip, ammo
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_MP5NAVY ) model(id)

if ( !gHasMorphPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_MP5NAVY ) return PLUGIN_CONTINUE

// Never Run Out of Ammo!
//server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
if ( clip == 0 )
{
//server_print("INVOKING MATTBT MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
get_weaponname(wpn_id,wpn,31)
//highly recommend droppging weapon - buggy without it!
give_item(id,wpn)
engclient_cmd(id, wpn )
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public nomodel(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_m249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------

Chivas2973
11-12-2004, 21:42
everything that has the heros name, ex morpheus to dual, then change the model destination and the model

not rocket science, open the sma and take a look
it didnt work... i chaned the names and the model destination but my server just freezes when i or anybody else joins what did i do wrong? here is the SMA

#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

// M4Killer - Kills People With Dual M4's
//
// CVARS
// M4Killer_gravity - Gravity M4Killer has
// M4Killer_level - what level must they be for morpheus powers?

// VARIABLES
new gHeroName[]="M4Killer"
new gHasMorphPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO M4Killer","1.0","RadidEskimo & Freecode")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create Morpheus Hero")
register_cvar("M4Killer_level", "8")
shCreateHero(gHeroName, "Goodie Bag", " Lower Gravity/Dual M4's/Punisher Skills", false, "M4Killer_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("morpheus_init", "morpheus_init")
shRegHeroInit(gHeroName, "morpheus_init")
register_event("ResetHUD","newRound","b")
register_event("WeapPickup","model","b","1=19")
register_event("CurWeapon","check_mp5","be","1=1")
// DEFAULT THE CVARS
register_cvar("M4Killer_gravity", "0.35" )

// Let Server know about M4Killer's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMinGravity(gHeroName, "M4Killer_gravity" )
}
//----------------------------------------------------------------------------------------------
public morpheus_init()
{
new temp[6]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has flash
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

if ( hasPowers )
gHasMorphPower[id]=true
else
gHasMorphPower[id]=false
}
//----------------------------------------------------------------------------------------------
public newRound(id) {
if ( gHasMorphPower[id] && is_user_alive(id) && shModActive() ) {
morpheus_weapons(id)
}
else{
nomodel(id)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public morpheus_weapons(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
shGiveWeapon(id,"weapon_m249")
shGiveWeapon(id,"ammo_9mm")
model(id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public model(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public check_mp5(id)
{
new clip, ammo
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_MP5NAVY ) model(id)

if ( !gHasMorphPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_MP5NAVY ) return PLUGIN_CONTINUE

// Never Run Out of Ammo!
//server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
if ( clip == 0 )
{
//server_print("INVOKING MATTBT MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
get_weaponname(wpn_id,wpn,31)
//highly recommend droppging weapon - buggy without it!
give_item(id,wpn)
engclient_cmd(id, wpn )
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public nomodel(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_m249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------

first, did you recompile the sma after you changed the name of the sma, also look at the bold areas, there is something wrong with everything I put in bold, like the models are in 2 different places, also pay attention to all the original capital and lower case letters, try to keep them written the exact same way, also, where I highlightes the # 19, make it 22(this makes the guns an m41a, also that is what the gun is called M4A1 not P228, just make everything consistant, look at AssKicR's tutorial for the guns

I don't think I missed anything if it is a strict rip, but I may have

laptopgun3
11-12-2004, 22:06
ok now is it right?

#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

// M4Killer - Kills People With Dual M4's
//
// CVARS
// M4Killer_gravity - Gravity M4Killer has
// M4Killer_level - what level must they be for M4Killer powers?

// VARIABLES
new gHeroName[]="M4Killer"
new gHasMorphPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO M4Killer","1.0","RadidEskimo & Freecode")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create M4Killer Hero")
register_cvar("M4Killer_level", "8")
shCreateHero(gHeroName, "M4Killer", " Lower Gravity/Dual M4's/Punisher Skills", false, "M4Killer_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("M4Killer_init", "M4Killer_init")
shRegHeroInit(gHeroName, "morpheus_init")
register_event("ResetHUD","newRound","b")
register_event("WeapPickup","model","b","1=22")
register_event("CurWeapon","check_m249","be","1=1")
// DEFAULT THE CVARS
register_cvar("M4Killer_gravity", "0.35" )

// Let Server know about M4Killer's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMinGravity(gHeroName, "M4Killer_gravity" )
}
//----------------------------------------------------------------------------------------------
public M4Killer_init()
{
new temp[6]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has flash
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

if ( hasPowers )
gHasKillerPower[id]=true
else
gHasKillwePower[id]=false
}
//----------------------------------------------------------------------------------------------
public newRound(id) {
if ( gHasKillerPower[id] && is_user_alive(id) && shModActive() ) {
M4Killer_weapons(id)
}
else{
nomodel(id)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public M4Killer_weapons(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
shGiveWeapon(id,"weapon_m249")
shGiveWeapon(id,"ammo_9mm")
model(id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public model(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_m249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public check_m249(id)
{
new clip, ammo
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_m249 ) model(id)

if ( !gHasKillerPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_m249 ) return PLUGIN_CONTINUE

// Never Run Out of Ammo!
//server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
if ( clip == 0 )
{
//server_print("INVOKING MATTBT MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
get_weaponname(wpn_id,wpn,31)
//highly recommend droppging weapon - buggy without it!
give_item(id,wpn)
engclient_cmd(id, wpn )
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public nomodel(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_m249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------

MTS Steel DrAgoN
11-12-2004, 22:11
why dont you compile it...and if it has errors post them and what is on that line?

Chivas2973
11-12-2004, 22:19
the only thing that may go wrong it the m in m249 might need to be M, also if you want the m249 instead of the m41a, the number for that weapon is 20 not 22 as I said earlier

laptopgun3
11-12-2004, 23:06
everything that has the heros name, ex morpheus to dual, then change the model destination and the model

not rocket science, open the sma and take a look
it didnt work... i chaned the names and the model destination but my server just freezes when i or anybody else joins what did i do wrong? here is the SMA

#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

// M4Killer - Kills People With Dual M4's
//
// CVARS
// M4Killer_gravity - Gravity M4Killer has
// M4Killer_level - what level must they be for morpheus powers?

// VARIABLES
new gHeroName[]="M4Killer"
new gHasMorphPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO M4Killer","1.0","RadidEskimo & Freecode")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create Morpheus Hero")
register_cvar("M4Killer_level", "8")
shCreateHero(gHeroName, "Goodie Bag", " Lower Gravity/Dual M4's/Punisher Skills", false, "M4Killer_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("morpheus_init", "morpheus_init")
shRegHeroInit(gHeroName, "morpheus_init")
register_event("ResetHUD","newRound","b")
register_event("WeapPickup","model","b","1=19")
register_event("CurWeapon","check_mp5","be","1=1")
// DEFAULT THE CVARS
register_cvar("M4Killer_gravity", "0.35" )

// Let Server know about M4Killer's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMinGravity(gHeroName, "M4Killer_gravity" )
}
//----------------------------------------------------------------------------------------------
public morpheus_init()
{
new temp[6]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has flash
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

if ( hasPowers )
gHasMorphPower[id]=true
else
gHasMorphPower[id]=false
}
//----------------------------------------------------------------------------------------------
public newRound(id) {
if ( gHasMorphPower[id] && is_user_alive(id) && shModActive() ) {
morpheus_weapons(id)
}
else{
nomodel(id)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public morpheus_weapons(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
shGiveWeapon(id,"weapon_m249")
shGiveWeapon(id,"ammo_9mm")
model(id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public model(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public check_mp5(id)
{
new clip, ammo
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_MP5NAVY ) model(id)

if ( !gHasMorphPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_MP5NAVY ) return PLUGIN_CONTINUE

// Never Run Out of Ammo!
//server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
if ( clip == 0 )
{
//server_print("INVOKING MATTBT MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
get_weaponname(wpn_id,wpn,31)
//highly recommend droppging weapon - buggy without it!
give_item(id,wpn)
engclient_cmd(id, wpn )
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public nomodel(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_m249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_m249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------

first, did you recompile the sma after you changed the name of the sma, also look at the bold areas, there is something wrong with everything I put in bold, like the models are in 2 different places, also pay attention to all the original capital and lower case letters, try to keep them written the exact same way, also, where I highlightes the # 19, make it 22(this makes the guns an m41a, also that is what the gun is called M4A1 not P228, just make everything consistant, look at AssKicR's tutorial for the guns

I don't think I missed anything if it is a strict rip, but I may have
you said 22.. so do i make it 20?

Chivas2973
11-12-2004, 23:14
I did say 22 because you originally said dual m4's so I assumed you wanted m41a, but if you want m249 the weapon is 20, look in AssKicR's tutorial

//To set on more that n one weapon place them next to each other.. Like this [12][16]
// Weapon you can use are listed below
/********************************
* Weaponname |Number *
*-------------------------------*
* All Weapons | 0 *
* P228 | 1 *
* Scout | 3 *
* HeGrenade | 4 *
* Xm1014(Autoshotty) | 5 *
* C4 | 6 *
* Mac10 | 7 *
* Aug | 8 *
* SmokeGrenade | 9 *
* Elites | 10 *
* FiveSeven | 11 *
* Ump45 | 12 *
* Sg550 | 13 *
* Usp | 16 *
* Glock18 | 17 *
* Awp | 18 *
* Mp5Navy | 19 *
* M249 | 20 *
* M3 | 21 *
* M4A1 | 22 *
* Tmp | 23 *
* G3SG1 | 24 *
* Flashbang | 25 *
* Deagle | 26 *
* SG552 | 27 *
* Ak47 | 28 *
* Knife | 29 *
* P90 | 30 *
********************************/

Buttface
11-12-2004, 23:15
the only thing that may go wrong it the m in m249 might need to be M, also if you want the m249 instead of the m41a, the number for that weapon is 20 not 22 as I said earlier

That means if you want m4a1 its 22 and m249 is 20 ok?

laptopgun3
11-12-2004, 23:20
ok ill set it, but here is teh file incase i need to change sumthing

laptopgun3
11-12-2004, 23:49
ok i think this is it

#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

// M4Killer - Kills People With Dual M4's
//
// CVARS
// M4Killer_gravity - Gravity M4Killer has
// M4Killer_level - what level must they be for M4Killer powers?

// VARIABLES
new gHeroName[]="M4Killer"
new gHasMorphPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO M4Killer","1.0","RadidEskimo & Freecode")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create M4Killer Hero")
register_cvar("M4Killer_level", "8")
shCreateHero(gHeroName, "M4Killer", " Lower Gravity/Dual M4's/Punisher Skills", false, "M4Killer_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("M4Killer_init", "M4Killer_init")
shRegHeroInit(gHeroName, "morpheus_init")
register_event("ResetHUD","newRound","b")
register_event("WeapPickup","model","b","1=20")
register_event("CurWeapon","check_M249","be","1=1")
// DEFAULT THE CVARS
register_cvar("M4Killer_gravity", "0.35" )

// Let Server know about M4Killer's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMinGravity(gHeroName, "M4Killer_gravity" )
}
//----------------------------------------------------------------------------------------------
public M4Killer_init()
{
new temp[6]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has flash
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

if ( hasPowers )
gHasKillerPower[id]=true
else
gHasKillwePower[id]=false
}
//----------------------------------------------------------------------------------------------
public newRound(id) {
if ( gHasKillerPower[id] && is_user_alive(id) && shModActive() ) {
M4Killer_weapons(id)
}
else{
nomodel(id)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public M4Killer_weapons(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
shGiveWeapon(id,"weapon_M249")
shGiveWeapon(id,"ammo_9mm")
model(id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public model(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_M249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public check_M249(id)
{
new clip, ammo
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_M249 ) model(id)

if ( !gHasKillerPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_M249 ) return PLUGIN_CONTINUE

// Never Run Out of Ammo!
//server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
if ( clip == 0 )
{
//server_print("INVOKING MATTBT MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
get_weaponname(wpn_id,wpn,31)
//highly recommend droppging weapon - buggy without it!
give_item(id,wpn)
engclient_cmd(id, wpn )
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public nomodel(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_M249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------

laptopgun3
11-13-2004, 00:21
ok i used the amxxsc to see what would come out ang got this
it says cannot read from fire amxmodx?hELP!

MTS Steel DrAgoN
11-13-2004, 00:34
check your includes andsee if its in there

laptopgun3
11-13-2004, 01:28
it didnt work... bought the m249 bit it didnt show the model! WHAT DID I DO WRONG?!?!

vittu
11-13-2004, 03:08
you got alot more stuff wrong in there but remove all of this from the code:// Weapon Model change thanks to [SHC]laptopgun3


new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_M249")
}

laptopgun3
11-13-2004, 11:32
i dont think it worked i got this it says runtime error 10 on line (M4Killer.amxx)here is my SMA

#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

// M4Killer - Kills People With Dual M4's
//
// CVARS
// M4Killer_gravity - Gravity M4Killer has
// M4Killer_level - what level must they be for M4Killer powers?

// VARIABLES
new gHeroName[]="M4Killer"
new gHasMorphPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO M4Killer","1.0","RadidEskimo & Freecode")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create M4Killer Hero")
register_cvar("M4Killer_level", "8")
shCreateHero(gHeroName, "M4Killer", " Lower Gravity/Dual M4's/Punisher Skills", false, "M4Killer_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("morpheus_init", "M4Killer_init")
shRegHeroInit(gHeroName, "M4Killer_init")
register_event("ResetHUD","newRound","b")
register_event("WeapPickup","model","b","1=20")
register_event("CurWeapon","check_M249","be","1=1")
// DEFAULT THE CVARS
register_cvar("M4Killer_gravity", "0.35" )

// Let Server know about M4Killer's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMinGravity(gHeroName, "M4Killer_gravity" )
}
//----------------------------------------------------------------------------------------------
public M4killer_init()
{
new temp[6]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has flash
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

if ( hasPowers )
gHasMorphPower[id]=true
else
gHasMorphPower[id]=false
}
//----------------------------------------------------------------------------------------------
public newRound(id) {
if ( gHasMorphPower[id] && is_user_alive(id) && shModActive() ) {
morpheus_weapons(id)
}
else{
nomodel(id)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public morpheus_weapons(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
shGiveWeapon(id,"weapon_M249")
shGiveWeapon(id,"ammo_9mm")
model(id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public model(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
// Weapon Model change thanks to [SHC]laptopgun3
entity_set_string(id, EV_SZ_viewmodel, "models/DualM4/v_m249")
new iCurrent
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {
iCurrent = find_ent_by_class(iCurrent,"weapon_M249")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public check_M249(id)
{
new clip, ammo
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_M249 ) model(id)

if ( !gHasMorphPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_M249 ) return PLUGIN_CONTINUE

// Never Run Out of Ammo!
//server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
if ( clip == 0 )
{
//server_print("INVOKING MATTBT MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)
get_weaponname(wpn_id,wpn,31)
//highly recommend droppging weapon - buggy without it!
give_item(id,wpn)
engclient_cmd(id, wpn )
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-(
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public nomodel(id) {
if ( !is_user_alive(id) ) return PLUGIN_CONTINUE
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------

Chivas2973
11-13-2004, 13:02
run time errors are usually nothing to worry about, the question is, does it work in game, if it does, tada, you did it

laptopgun3
11-13-2004, 15:41
sigh... nope it didnt work... what did i do wrong?
see here is the M249

Chivas2973
11-13-2004, 16:23
well, what does it do and what doesn't it do, did it compile error free, does the hero you ripped it from compile and work for amxmodx

laptopgun3
11-13-2004, 16:28
well it doesnt do anything exept give me free ammo and low grav
yea it compiled error free
yea it works with amxx because i ripped it from teh amxx version of amxx

Chivas2973
11-13-2004, 16:44
I just looked at the code for morpheus for amxx and I don't see a place where it precaches the model, does the morpheus with the model work for you in amxx, did you test it, odd, I think it is missing this whole section

public plugin_precache()
{
precache_model("models/mp5/v_mp51.mdl")
return PLUGIN_CONTINUE
}


Anyone else know if this is needed in amxx code, I saw it in jtp's fixed demoman, but not in freecode's amxx morpheus

laptopgun3
11-13-2004, 16:55
I just looked at the code for morpheus for amxx and I don't see a place where it precaches the model, does the morpheus with the model work for you in amxx, did you test it, odd, I think it is missing this whole section

public plugin_precache()
{
precache_model("models/mp5/v_mp51.mdl")
return PLUGIN_CONTINUE
}


Anyone else know if this is needed in amxx code, I saw it in jtp's fixed demoman, but not in freecode's amxx morpheus
yea... i compared teh amxx one to the amx one and they were different... so should i add hat to the SMA?
oh and yea morpheus works with amxx

Chivas2973
11-13-2004, 17:21
1st try changing
iCurrent = find_ent_by_class(-1,"weapon_M249")
while(iCurrent != -1) {

to iCurrent = find_ent_by_class(0,"weapon_M249")
while(iCurrent != 0) {

changing the -1 to 0 in 2 places, if it doesn't work, chage it back



other than that, your gonna have to wait for someone more experienced in coding

laptopgun3
11-13-2004, 18:17
ok expert coder help me

vittu
11-13-2004, 19:09
uhh... like i said "you got alot more stuff wrong in there but..."

you want me to fix the whole thing?

laptopgun3
11-13-2004, 19:14
sure, and when your done post up the sma and what i did wrong

Chivas2973
11-13-2004, 19:18
I just looked at the code for morpheus for amxx and I don't see a place where it precaches the model, does the morpheus with the model work for you in amxx, did you test it, odd, I think it is missing this whole section

public plugin_precache()
{
precache_model("models/mp5/v_mp51.mdl")
return PLUGIN_CONTINUE
}


Anyone else know if this is needed in amxx code, I saw it in jtp's fixed demoman, but not in freecode's amxx morpheus

I just want to know if this has anything do do with it, that is why I am putting it on the new page, I wonder if you morpheus works because the model was already precached from a different version

Chivas2973
11-13-2004, 22:33
try this, I can't believe I made it but here

EDIT:


just so everyone else knows, this hero will not work with out a model in

models/DualM4/v_m249.mdl

which is what laptop wanted, but you can use this hero with any model, just put the model in models/DualM4 and whatever model you choose name it v_m249.mdl, but if you change the model and it has been running on server, everone who has downloaded the original will never see it unless they all go into models/DualM4/ and delete the model

laptopgun3
11-13-2004, 22:36
but tell me what you changed

Chivas2973
11-13-2004, 22:42
open it, look at it, learn from it, I am not an experienced coder so I can't tell you what I changed, I just went off the rip I made awhile ago and it worked, I did change the fact that I didn't use freecodes amxx version, I used the amx version and compiled it for amxx, but see if it works

I still wanna know if a model hero can work without precaching

vittu
11-13-2004, 23:01
you guys need to stop ripping that old morpheus code... your giving way too much extradamage...

you still want this cleaned up or is chivas's version fine?

laptopgun3
11-13-2004, 23:07
well i compared my version and his version and the were the same so i just need to no what he changeed or you tell me what i need to change

vittu
11-13-2004, 23:10
look closer you version and his are not the same...



and dont take credit like this:
// Weapon Model change thanks to [SHC]laptopgun3

you did not write the code on changing a weapon model

Chivas2973
11-13-2004, 23:13
they are not the same, I precached the model, they are different from the first lines
your 1st 4 lines
#include <amxmodx>
#include <fun>
#include <superheromod>
#include <engine>

my first 4 lines
#include <amxmod.inc>
//#include <xtrafun>
#include <superheromod.inc>
#include <Vexd_Utilities>

but I can see how you would say they are the same(borrowing Fatebringer's sarcasm)

anyway vittu is right, if you want it coded perfect, let him waste his time on your model hero

cause he has nothing better to do at all, like running a sh forum or something