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

Player model question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bladell
Senior Member
Join Date: Jun 2012
Old 09-11-2012 , 06:00   Player model question
Reply With Quote #1

Hi
I want to add a model(gun & player) to Superhero Noob.

Code:
 /* CVARS - copy and paste to shconfig.cfg

 // Noob
 Noob_level 10
 Noob_arrows 10
 Noob_getdeagle 0

 */

 #include <amxmod>
 #include <Vexd_Utilities>
 #include <superheromod>

 // VARIABLES
 new gHeroName[]="Noob"
 new gHasNoobPower[SH_MAXSLOTS+1]
 new Noobs[SH_MAXSLOTS+1]
 // Test
 new gLastWeapon[SH_MAXSLOTS+1]
 new gLastClipCount[SH_MAXSLOTS+1]
 // Sprites
 new laser,laser_impact,blast_shroom

 //----------------------------------------------------------------------------------------------
 public plugin_init()
 {
	// Plugin Info
	register_plugin("SUPERHERO Noob","1.2","DON'T STOP ME")

	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("Noob_level","10")
	register_cvar("Noob_arrows", "3")
	register_cvar("Noob_getdeagle", "1")

	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	shCreateHero(gHeroName, "exploding deagle shots", "U WILL HAVE A DEAGE WITH 3 EXPLODING SHOTS!!", false, "Noob_level" )

	// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)

	// INIT
	register_srvcmd("Noob_init", "Noob_init")
	shRegHeroInit(gHeroName, "Noob_init")

	// NEW ROUND
	register_event("ResetHUD","newRound","b")

	// GREEN ARROW DAMAGE
	register_event("Damage", "Noob_damage", "b", "2!0")

	// ARROW FIRED
	register_event("CurWeapon","Noob_fire", "be", "1=1", "3>0")
	register_event("CurWeapon","weaponChange","be","1=1")
 }
 //----------------------------------------------------------------------------------------------
 public Noob_init()
 {
	// First Argument is an id
	new temp[128]
	read_argv(1,temp,5)
	new id = str_to_num(temp)

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

	gHasNoobPower[id]=(hasPowers!=0)

	if ( !is_user_alive(id) ) return

	     switchmodel(id)
         Noob_morph(id)
		 Noob_unmorph(id)

	if ( gHasNoobPower[id] )
	{
		Noobs[id] = get_cvar_num("Noob_arrows")

		if ( get_cvar_num("Noob_getdeagle") == 1 )
		shGiveWeapon(id,"weapon_deagle")
	}
 }
 //----------------------------------------------------------------------------------------------
 public plugin_precache()
 {
	laser = precache_model("sprites/laserbeam.spr")
	laser_impact = precache_model("sprites/zerogxplode.spr")
	blast_shroom = precache_model("sprites/mushroom.spr")
	precache_model("models/shmod/Noob_v.mdl")
	precache_model("models/shmod/Noob_p.mdl")
        	precache_model("models/shmod/Noob/Noob.mdl")

 }
 //----------------------------------------------------------------------------------------------
 public newRound(id)
 {
	if ( gHasNoobPower[id] )
	{
		Noobs[id] = get_cvar_num("Noob_arrows")
		gLastWeapon[id] = -1  // I think the change Weapon automatically gets called on spawn death too...

		if ( get_cvar_num("Noob_getdeagle") == 1 )
		shGiveWeapon(id,"weapon_deagle")
	}
 }
 //----------------------------------------------------------------------------------------------
 public Noob_damage(id)
 {
	new damage = read_data(2)
	new weapon, bodypart, attacker = get_user_attacker(id,weapon,bodypart)

	if ( attacker < 0 || attacker > SH_MAXSLOTS ) return PLUGIN_CONTINUE

	if ( gHasNoobPower[attacker] && weapon == CSW_DEAGLE && Noobs[attacker] >= 0 && is_user_alive(id) )
	{
		new health = get_user_health(id)

		// damage is less than 10%
		if ( ( (1.0 * damage) / (1.0 * (health + damage) ) ) < 0.01 ) return PLUGIN_CONTINUE

		new origin[3]
		get_user_origin(id, origin)

		// player fades..
		set_user_rendering(id, kRenderFxFadeSlow, 255, 255, 255, kRenderTransColor, 4);

		// beeeg explody!
		message_begin(MSG_ALL, SVC_TEMPENTITY)
		write_byte(3)			// TE_EXPLOSION
		write_coord(origin[0])
		write_coord(origin[1])
		write_coord(origin[2]-22)
		write_short(blast_shroom)	// mushroom cloud
		write_byte(40)			// scale in 0.1's
		write_byte(12)			// frame rate
		write_byte(12)			// TE_EXPLFLAG_NOPARTICLES & TE_EXPLFLAG_NOSOUND
		message_end()

		// do turn down that awful racket..to be replaced by a blood spurt!
		message_begin(MSG_ALL, SVC_TEMPENTITY)
		write_byte(10)	// TE_LAVASPLASH
		write_coord(origin[0])
		write_coord(origin[1])
		write_coord(origin[2]-26)
		message_end()

		// kill victim
		user_kill(id, 1)

		message_begin( MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0 )
		write_byte(attacker)
		write_byte(id)
		write_byte(0)
		write_string("deagle")
		message_end()

		//Save Hummiliation
		new namea[24],namev[24],authida[20],authidv[20],teama[8],teamv[8]
		//Info On Attacker
		get_user_name(attacker,namea,23)
		get_user_team(attacker,teama,7)
		get_user_authid(attacker,authida,19)
		//Info On Victim
		get_user_name(id,namev,23)
		get_user_team(id,teamv,7)
		get_user_authid(id,authidv,19)
		//Log This Kill
		log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"Green Arrow^"",
		namea,get_user_userid(attacker),authida,teama,namev,get_user_userid(id),authidv,teamv)

		// team check!
		new attacker_team[2], victim_team[2]
		get_user_team(attacker, attacker_team, 1)
		get_user_team(id, victim_team, 1)

		// for some reason this doesn't update in the hud until the next round.. whatever.
		if (!equali(attacker_team, victim_team))
		{
			// diff. team;	$attacker gets credited for the kill and $250 and XP.
			//		$id gets their suicidal -1 frag back.
			set_user_frags(attacker, get_user_frags(attacker)+1)

			#if defined AMXX_VERSION
			cs_set_user_money(attacker, cs_get_user_money(attacker)+150)
			#else
			set_user_money(attacker, get_user_money(attacker)+150)
			#endif

			shAddXP(attacker, id, 1)
		}
		else
		{
			// same team;	$attacker loses a frag and $500 and XP.
			set_user_frags(attacker, get_user_frags(attacker)-1)

			#if defined AMXX_VERSION
			cs_set_user_money(attacker, cs_get_user_money(attacker)-500, 0)
			#else
			set_user_money(attacker, get_user_money(attacker)-500, 0)
			#endif

			shAddXP(attacker, id, -1)
		}
	}
	return PLUGIN_CONTINUE
 }
 //----------------------------------------------------------------------------------------------,
 public Noob_fire(id)
 {

	if ( !gHasNoobPower[id] ) return PLUGIN_CONTINUE

	new weap = read_data(2)		// id of the weapon
	new ammo = read_data(3)		// ammo left in clip

	if ( weap == CSW_DEAGLE && is_user_alive(id) )
	{
		if (gLastWeapon[id] == 0) gLastWeapon[id] = weap

		if ( gLastClipCount[id] > ammo && gLastWeapon[id] == weap && Noobs[id] > 0 )
		{
			new vec1[3], vec2[3]
			get_user_origin(id, vec1, 1) // origin; where you are
			get_user_origin(id, vec2, 4) // termina; where your bullet goes

			// tracer beam
			message_begin(MSG_PAS, SVC_TEMPENTITY, vec1)
			write_byte(0)		// TE_BEAMPOINTS
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2])
			write_coord(vec2[0])
			write_coord(vec2[1])
			write_coord(vec2[2])
			write_short(laser)	// laserbeam sprite
			write_byte(0)		// starting frame
			write_byte(10)		// frame rate
			write_byte(2)		// life in 0.1s
			write_byte(4)		// line width in 0.1u
			write_byte(1)		// noise in 0.1u
			write_byte(0)		// red
			write_byte(153)		// green
			write_byte(0)		// blue
			write_byte(80)		// brightness
			write_byte(100)		// scroll speed
			message_end()

			// bullet impact explosion
			message_begin(MSG_PAS, SVC_TEMPENTITY, vec2)
			write_byte(3)		// TE_EXPLOSION
			write_coord(vec2[0])	// end point of beam
			write_coord(vec2[1])
			write_coord(vec2[2])
			write_short(laser_impact)	// blast sprite
			write_byte(10)			// scale in 0.1u
			write_byte(30)			// frame rate
			write_byte(8)			// TE_EXPLFLAG_NOPARTICLES
			message_end()			// ..unless i'm mistaken, noparticles helps avoid a crash

			Noobs[id]--

			new message[128]
			format(message, 127, "You Have %d arrow(s) left",Noobs[id])
			set_hudmessage(255,0,0,-1.0,0.3,0,0.25,1.0,0.0,0.0,4)
			show_hudmessage(id, message)

			if ( Noobs[id] == 0 ) Noobs[id] = -1
		}

		gLastClipCount[id] = ammo
		gLastWeapon[id] = weap
	}
	return PLUGIN_CONTINUE
 }
 //----------------------------------------------------------------------------------------------
 public switchmodel(id)
 {
	if ( !is_user_alive(id) || !gHasNoobPower[id] ) return
	new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
	if (wpnid == CSW_DEAGLE) {
		// Weapon Model change for 3rd person view - vittu
		Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/Noob_v.mdl")
		// Weapon Model change for 3rd person view - vittu
		Entvars_Set_String(id, EV_SZ_weaponmodel, "models/shmod/Noob_p.mdl")
	}
 }
 //----------------------------------------------------------------------------------------------
 public weaponChange(id)
 {
	if ( !gHasNoobPower[id] || !shModActive() ) return

	new wpnid = read_data(2)
	new clip = read_data(3)

	if ( wpnid == CSW_DEAGLE ) switchmodel(id)

	switchmodel(id)

	// Never Run Out of Ammo!
	if ( clip == 0 ) {
		shReloadAmmo(id)
	}
 }
 //----------------------------------------------------------------------------------------------
 public sh_client_spawn(id)
 {
    //first we check if the user has the hero or not
    if ( !gHasNoobPower[id] )
    {
        //then we can go and set the playermodel
        Noob_morph(id)
     }
 }
 //----------------------------------------------------------------------------------------------
 Noob_morph(id)
{
	if ( gmorphed[id] || !is_user_alive(id) )
		return
	cs_set_user_model(id, "grim")
	gmorphed[id] = true
}
 //----------------------------------------------------------------------------------------------
 Noob_unmorph(id)
{
	if ( gmorphed[id] )
	{
		cs_reset_user_model(id)
		gmorphed[id] = false
	}
}
Can anyone tell me if the .sma is good please?
Gun model work perfectly but player model doesn't load...
I want to know if the model is wrong or the .sma.
Thanks
Bladell is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-11-2012 , 06:42   Re: Player model question
Reply With Quote #2

Code:
         switchmodel(id)
         Noob_morph(id)
         Noob_unmorph(id)
You are first morphing, then you are unmorphing right after, which means you set the playermodel, and then you take it off 0,00000001 second later which means you will never see it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Bladell
Senior Member
Join Date: Jun 2012
Old 09-11-2012 , 08:03   Re: Player model question
Reply With Quote #3

I understand
So...the corect form is
Code:
switchmodel(id)
         Noob_morph(id)
?

But I don't think that's the problem.When I try to add a player model (any player model ) I receive this error
Code:
Error: could not load file models/player/Noob/Noob.mdl
.

So...what can I do?

Last edited by Bladell; 09-11-2012 at 08:03.
Bladell is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-11-2012 , 08:16   Re: Player model question
Reply With Quote #4

No, the correct would be:

Code:
switchmodel(id)
Noob_morph(id)
You need to be aware of higher and lower cases, if you placed it in models/player/Noob/Noob.mdl it won't work if you put it in models/player/noob/noob.mdl.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Bladell
Senior Member
Join Date: Jun 2012
Old 09-11-2012 , 08:25   Re: Player model question
Reply With Quote #5

Now I can't compile it...
I get these error
Code:
/tmp/text6sYjwy.sma(72) : warning 217: loose indentation
/tmp/text6sYjwy.sma(73) : warning 217: loose indentation
/tmp/text6sYjwy.sma(74) : warning 217: loose indentation
/tmp/text6sYjwy.sma(90) : warning 217: loose indentation
/tmp/text6sYjwy.sma(188) : warning 213: tag mismatch
/tmp/text6sYjwy.sma(201) : warning 213: tag mismatch
/tmp/text6sYjwy.sma(316) : error 017: undefined symbol "gmorphed"
/tmp/text6sYjwy.sma(316) : warning 215: expression has no effect
/tmp/text6sYjwy.sma(316) : error 001: expected token: ";", but found "]"
/tmp/text6sYjwy.sma(316) : error 029: invalid expression, assumed zero
/tmp/text6sYjwy.sma(316) : fatal error 107: too many error messages on one line
Bladell is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-11-2012 , 15:17   Re: Player model question
Reply With Quote #6

PHP Code:
/* CVARS - copy and paste to shconfig.cfg

 // Noob
 Noob_level 10
 Noob_arrows 10
 Noob_getdeagle 0

 */

 //Changed the include to be amxmodx instead of amxmod /Jelle
#include <amxmodx>
#include <Vexd_Utilities>
#include <superheromod>

 // VARIABLES
 
new gHeroName[]="Noob"
 
new gHasNoobPower[SH_MAXSLOTS+1]
 new 
Noobs[SH_MAXSLOTS+1]
 
// Test
 
new gLastWeapon[SH_MAXSLOTS+1]
 new 
gLastClipCount[SH_MAXSLOTS+1]
 
// Sprites
 
new laser,laser_impact,blast_shroom
 
 
//Added a variable to hold if you are morphed or not (I think its useless but whatever) /Jelle
 
new gmorphed[SH_MAXSLOTS+1]

 
//----------------------------------------------------------------------------------------------
 
public plugin_init()
 {
    
// Plugin Info
    
register_plugin("SUPERHERO Noob","1.2","DON'T STOP ME")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("Noob_level","10")
    
register_cvar("Noob_arrows""3")
    
register_cvar("Noob_getdeagle""1")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(gHeroName"exploding deagle shots""U WILL HAVE A DEAGE WITH 3 EXPLODING SHOTS!!"false"Noob_level" )

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)

    // INIT
    
register_srvcmd("Noob_init""Noob_init")
    
shRegHeroInit(gHeroName"Noob_init")

    
//Catch when a player dies /Jelle
    
register_event("DeathMsg""noob_death""a")
    
    
// NEW ROUND
    
register_event("ResetHUD","newRound","b")

    
// GREEN ARROW DAMAGE
    
register_event("Damage""Noob_damage""b""2!0")

    
// ARROW FIRED
    
register_event("CurWeapon","Noob_fire""be""1=1""3>0")
    
register_event("CurWeapon","weaponChange","be","1=1")
 }
 
//----------------------------------------------------------------------------------------------
 
public Noob_init()
 {
    
// First Argument is an id
    
new temp[128]
    
read_argv(1,temp,5)
    new 
id str_to_num(temp)

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

    
gHasNoobPower[id]=(hasPowers!=0)

    if ( !
is_user_alive(id) ) return

    
switchmodel(id)
    
Noob_morph(id)

    if ( 
gHasNoobPower[id] )
    {
        
Noobs[id] = get_cvar_num("Noob_arrows")

        if ( 
get_cvar_num("Noob_getdeagle") == )
        
shGiveWeapon(id,"weapon_deagle")
    }
 }
 
//----------------------------------------------------------------------------------------------
 
public plugin_precache()
 {
    
laser precache_model("sprites/laserbeam.spr")
    
laser_impact precache_model("sprites/zerogxplode.spr")
    
blast_shroom precache_model("sprites/mushroom.spr")
    
precache_model("models/shmod/Noob_v.mdl")
    
precache_model("models/shmod/Noob_p.mdl")
    
precache_model("models/shmod/Noob/Noob.mdl")

 }
 
//----------------------------------------------------------------------------------------------
 
 //Added the death event here /Jelle
public noob_death()
{
    
//byte 1 has the id of the killer /Jelle
    //new killer = read_data(1)
    //But we never use it so no need for it /Jelle
    
    //byte 2 has the id of the victim /Jelle
    
new victim read_data(2)
    
    
//Check if the victim has noob /Jelle
    
if (gHasNoobPower[victim] )
    {
        
//if he does then go to Noob_unmorph /Jelle
        
Noob_unmorph(victim)
        
//Remember to send the right player id so it knows who to take the model off
    
}
}
 
 public 
newRound(id)
 {
    if ( 
gHasNoobPower[id] )
    {
        
Noobs[id] = get_cvar_num("Noob_arrows")
        
gLastWeapon[id] = -1  // I think the change Weapon automatically gets called on spawn death too...

        
if ( get_cvar_num("Noob_getdeagle") == )
        
shGiveWeapon(id,"weapon_deagle")
    }
 }
 
//----------------------------------------------------------------------------------------------
 
public Noob_damage(id)
 {
    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(id,weapon,bodypart)

    if ( 
attacker || attacker SH_MAXSLOTS ) return PLUGIN_CONTINUE

    
if ( gHasNoobPower[attacker] && weapon == CSW_DEAGLE && Noobs[attacker] >= && is_user_alive(id) )
    {
        new 
health get_user_health(id)

        
// damage is less than 10%
        
if ( ( (1.0 damage) / (1.0 * (health damage) ) ) < 0.01 ) return PLUGIN_CONTINUE

        
new origin[3]
        
get_user_origin(idorigin)

        
// player fades..
        
set_user_rendering(idkRenderFxFadeSlow255255255kRenderTransColor4);

        
// beeeg explody!
        
message_begin(MSG_ALLSVC_TEMPENTITY)
        
write_byte(3)            // TE_EXPLOSION
        
write_coord(origin[0])
        
write_coord(origin[1])
        
write_coord(origin[2]-22)
        
write_short(blast_shroom)    // mushroom cloud
        
write_byte(40)            // scale in 0.1's
        
write_byte(12)            // frame rate
        
write_byte(12)            // TE_EXPLFLAG_NOPARTICLES & TE_EXPLFLAG_NOSOUND
        
message_end()

        
// do turn down that awful racket..to be replaced by a blood spurt!
        
message_begin(MSG_ALLSVC_TEMPENTITY)
        
write_byte(10)    // TE_LAVASPLASH
        
write_coord(origin[0])
        
write_coord(origin[1])
        
write_coord(origin[2]-26)
        
message_end()

        
// kill victim
        
user_kill(id1)

        
message_beginMSG_ALLget_user_msgid("DeathMsg"),{0,0,0},)
        
write_byte(attacker)
        
write_byte(id)
        
write_byte(0)
        
write_string("deagle")
        
message_end()

        
//Save Hummiliation
        
new namea[24],namev[24],authida[20],authidv[20],teama[8],teamv[8]
        
//Info On Attacker
        
get_user_name(attacker,namea,23)
        
get_user_team(attacker,teama,7)
        
get_user_authid(attacker,authida,19)
        
//Info On Victim
        
get_user_name(id,namev,23)
        
get_user_team(id,teamv,7)
        
get_user_authid(id,authidv,19)
        
//Log This Kill
        
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"Green Arrow^"",
        
namea,get_user_userid(attacker),authida,teama,namev,get_user_userid(id),authidv,teamv)

        
// team check!
        
new attacker_team[2], victim_team[2]
        
get_user_team(attackerattacker_team1)
        
get_user_team(idvictim_team1)

        
// for some reason this doesn't update in the hud until the next round.. whatever.
        
if (!equali(attacker_teamvictim_team))
        {
            
// diff. team;    $attacker gets credited for the kill and $250 and XP.
            //        $id gets their suicidal -1 frag back.
            
set_user_frags(attackerget_user_frags(attacker)+1)

            
#if defined AMXX_VERSION
            
cs_set_user_money(attackercs_get_user_money(attacker)+150)
            
#else
            
set_user_money(attackerget_user_money(attacker)+150)
            
#endif

            //Should be a float not an integer, added ".0" after "1" to make it a float. /Jelle
            
shAddXP(attackerid1.0)
        }
        else
        {
            
// same team;    $attacker loses a frag and $500 and XP.
            
set_user_frags(attackerget_user_frags(attacker)-1)

            
#if defined AMXX_VERSION
            
cs_set_user_money(attackercs_get_user_money(attacker)-5000)
            
#else
            
set_user_money(attackerget_user_money(attacker)-5000)
            
#endif

            //Here it should be a float, not an integer. I added ".0" after "-1" to make it a float. /Jelle
            
shAddXP(attackerid, -1.0)
        }
    }
    return 
PLUGIN_CONTINUE
 
}
 
//----------------------------------------------------------------------------------------------,
 
public Noob_fire(id)
 {

    if ( !
gHasNoobPower[id] ) return PLUGIN_CONTINUE

    
new weap read_data(2)        // id of the weapon
    
new ammo read_data(3)        // ammo left in clip

    
if ( weap == CSW_DEAGLE && is_user_alive(id) )
    {
        if (
gLastWeapon[id] == 0gLastWeapon[id] = weap

        
if ( gLastClipCount[id] > ammo && gLastWeapon[id] == weap && Noobs[id] > )
        {
            new 
vec1[3], vec2[3]
            
get_user_origin(idvec11// origin; where you are
            
get_user_origin(idvec24// termina; where your bullet goes

            // tracer beam
            
message_begin(MSG_PASSVC_TEMPENTITYvec1)
            
write_byte(0)        // TE_BEAMPOINTS
            
write_coord(vec1[0])
            
write_coord(vec1[1])
            
write_coord(vec1[2])
            
write_coord(vec2[0])
            
write_coord(vec2[1])
            
write_coord(vec2[2])
            
write_short(laser)    // laserbeam sprite
            
write_byte(0)        // starting frame
            
write_byte(10)        // frame rate
            
write_byte(2)        // life in 0.1s
            
write_byte(4)        // line width in 0.1u
            
write_byte(1)        // noise in 0.1u
            
write_byte(0)        // red
            
write_byte(153)        // green
            
write_byte(0)        // blue
            
write_byte(80)        // brightness
            
write_byte(100)        // scroll speed
            
message_end()

            
// bullet impact explosion
            
message_begin(MSG_PASSVC_TEMPENTITYvec2)
            
write_byte(3)        // TE_EXPLOSION
            
write_coord(vec2[0])    // end point of beam
            
write_coord(vec2[1])
            
write_coord(vec2[2])
            
write_short(laser_impact)    // blast sprite
            
write_byte(10)            // scale in 0.1u
            
write_byte(30)            // frame rate
            
write_byte(8)            // TE_EXPLFLAG_NOPARTICLES
            
message_end()            // ..unless i'm mistaken, noparticles helps avoid a crash

            
Noobs[id]--

            new 
message[128]
            
format(message127"You Have %d arrow(s) left",Noobs[id])
            
set_hudmessage(255,0,0,-1.0,0.3,0,0.25,1.0,0.0,0.0,4)
            
show_hudmessage(idmessage)

            if ( 
Noobs[id] == Noobs[id] = -1
        
}

        
gLastClipCount[id] = ammo
        gLastWeapon
[id] = weap
    
}
    return 
PLUGIN_CONTINUE
 
}
 
//----------------------------------------------------------------------------------------------
 
public switchmodel(id)
 {
    if ( !
is_user_alive(id) || !gHasNoobPower[id] ) return
    new 
clipammowpnid get_user_weapon(idclipammo)
    if (
wpnid == CSW_DEAGLE) {
        
// Weapon Model change for 3rd person view - vittu
        
Entvars_Set_String(idEV_SZ_viewmodel"models/shmod/Noob_v.mdl")
        
// Weapon Model change for 3rd person view - vittu
        
Entvars_Set_String(idEV_SZ_weaponmodel"models/shmod/Noob_p.mdl")
    }
 }
 
//----------------------------------------------------------------------------------------------
 
public weaponChange(id)
 {
    if ( !
gHasNoobPower[id] || !shModActive() ) return

    new 
wpnid read_data(2)
    new 
clip read_data(3)

    if ( 
wpnid == CSW_DEAGLE switchmodel(id)

    
switchmodel(id)

    
// Never Run Out of Ammo!
    
if ( clip == ) {
        
shReloadAmmo(id)
    }
 }
 
//----------------------------------------------------------------------------------------------
 
public sh_client_spawn(id)
 {
    
//first we check if the user has the hero or not
    
if ( !gHasNoobPower[id] )
    {
        
//then we can go and set the playermodel
        
Noob_morph(id)
     }
 }
 
//----------------------------------------------------------------------------------------------
 
Noob_morph(id)
{
    if ( 
gmorphed[id] || !is_user_alive(id) )
        return
    
//Here it said "grim", it won't set the model if it is not the correct name. /Jelle
    
cs_set_user_model(id"Noob")
    
gmorphed[id] = true
}

 
//----------------------------------------------------------------------------------------------
 //You never used this anywhere. You have not catched when a player dies which means you have no place to actually run this code. /Jelle
Noob_unmorph(id)
{
    if ( 
gmorphed[id] )
    {
        
cs_reset_user_model(id)
        
gmorphed[id] = false
    
}

I fixed everything. Please take a look at my comments, you will learn a lot from them.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Bladell
Senior Member
Join Date: Jun 2012
Old 09-12-2012 , 03:39   Re: Player model question
Reply With Quote #7

Thanks for explication Jelle !
Now I can compile it but te player model error persist...
Code:
 Error: could not load file models/player/Noob/Noob.mdl
I can't understand

Last edited by Bladell; 09-12-2012 at 03:40.
Bladell is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-12-2012 , 05:31   Re: Player model question
Reply With Quote #8

You have not placed the model in the correct folder. That i cant code away since i dont know where you placed it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Bladell
Senior Member
Join Date: Jun 2012
Old 09-12-2012 , 08:10   Re: Player model question
Reply With Quote #9


:-??
I tried ten different models and no one worked.

Last edited by Bladell; 09-12-2012 at 08:12.
Bladell is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-12-2012 , 08:17   Re: Player model question
Reply With Quote #10

Could you link to the player model you have used, or attach it here? Then I can try to work it out. Seems odd.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
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 18:35.


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