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

"run time error 10"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SimonLANO
Member
Join Date: Dec 2008
Old 06-20-2012 , 16:43   "run time error 10"
Reply With Quote #1

Hello! I keep getting spammed by error.logs in my amx mod x log folder, it shows this:

Code:
L 06/20/2012 - 21:36:28: [AMXX] Run time error 10 (plugin "sh_darkpredator.amxx") (native "get_user_attacker") - debug not enabled!
L 06/20/2012 - 21:36:28: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/20/2012 - 21:36:28: Invalid player id 0
L 06/20/2012 - 21:36:28: [AMXX] Run time error 10 (plugin "sh_greenarrow.amxx") (native "get_user_attacker") - debug not enabled!
L 06/20/2012 - 21:36:28: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/20/2012 - 21:36:28: Invalid player id 0
L 06/20/2012 - 21:36:28: [AMXX] Run time error 10 (plugin "sh_juggernaut.amxx") (native "get_user_attacker") - debug not enabled!
L 06/20/2012 - 21:36:28: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/20/2012 - 21:36:28: Invalid player id 0
How can i fix these 4 heroes so it stop making errorlogs?

EDIT: have tried to put debug on them but dosnt seem to work, want to fix them because i think they are crashing my server because of this run time error 10
__________________
[SS]Superhero By 8Ball | 10 Free Levels | Max 50 Level | FastDL


Join us now !

Last edited by SimonLANO; 06-20-2012 at 18:40.
SimonLANO is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-20-2012 , 17:13   Re: "run time error 10"
Reply With Quote #2

Without any information of what plugins and versions you are running no one can do anything.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
SimonLANO
Member
Join Date: Dec 2008
Old 06-20-2012 , 17:20   Re: "run time error 10"
Reply With Quote #3

Im running AMX MOD X 1.81, Superheromod 1.2.0.14

Heroes i get this error at:

"Dark Predator"
Code:
//DarkPredator 1.0 (By kanu | DarkPredator)

/*Credit goes to: 

jtp10181 - Invisible Man code, Agent Deagle
AssKicR - Superhero Scripting Tutorial
{HOJ} Batman/JTP10181 - ESP Rings
AssKicR / ArtofDrowning07 - Lazer Bullets (Green Arrow)

*/

/* CVARS - COPY AND PASTE TO SHCONFIG.CFG

darkpred_level 10		//What level should DarkPredator be? Default=9
darkpred_armor 400		//How much armor should DarkPredator get? Default=400
darkpred_alpha 10		//What is the alpha level when invisible? | 0 = invisible, 255 = full visibility. | Default=50
darkpred_delay 2		//How long should a player wait to become fully invisible? (seconds) Default=2
darkpred_checkmove 0 		//Should movement be checked, or only shooting? | 0 = only check shooting | Default=0
darkpred_radius 900		//What is the radius of the rings? Default=900
darkpred_bright 192		//How bright should the rings be? Default=192
darkpred_healpoints 4		//How much HP does Darkpredator heal per second? Default=4
darkpred_bullets 6		//How many lazer bullets does he get? Default=7

*/

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

// VARIABLES
new gHeroName[]="DarkPredator" 
new gHasDarkPredPower[SH_MAXSLOTS+1] 
new gIsInvisible[SH_MAXSLOTS+1]
new gStillTime[SH_MAXSLOTS+1]
new gSpriteWhite, gRadius, gBright
new gPlayerMaxHealth[SH_MAXSLOTS+1]
new gHealPoints
new gBullets[SH_MAXSLOTS+1]
new gLastWeapon[SH_MAXSLOTS+1]
new gLastClipCount[SH_MAXSLOTS+1]
new laser,laser_impact,blast_shroom

//----------------------------------------------------------------------------------------------

public plugin_init()
{
	// Plugin Info
	register_plugin("SUPERHERO DarkPredator","1.0","kanu | DarkPredator")

	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	if ( isDebugOn() ) server_print("Attempting to create DarkPredator Hero")
	register_cvar("darkpred_level", "10" )
		  
	shCreateHero(gHeroName, "Deagle/Invisibility", "Get a free deagle and invisibility. Plus ESP rings, armor and regen.", false, "darkpred_level" )
  
	// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
  
	// INIT
	register_srvcmd("darkpred_init", "darkpred_init") 
	shRegHeroInit(gHeroName, "darkpred_init")
  
	// NEW ROUND
	register_event("ResetHUD","newRound","b") //Called on a New Round
	// WEAPON EVENT (called on CHANGING of weapon... ZOOMING of weapon... and when you RUN OUT OF AMMO on a weapon)
	register_event("CurWeapon","changeWeapon","be","1=1")  
	//Damage
	register_event("Damage", "darkpred_damage", "b", "2!0")
	
	// DEFAULT THE CVARS
	register_cvar("darkpred_armor", "400") 
	register_cvar("darkpred_alpha", "10")
	register_cvar("darkpred_delay", "2")
	register_cvar("darkpred_checkmove", "0")
	register_cvar("darkpred_healpoints", "4" )
	register_cvar("darkpred_radius", "900")
	register_cvar("darkpred_bright", "192")
	register_cvar("darkpred_bullets", "6")

	// Let Server know about DarkPredators Variables
	// 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
	shSetMaxArmor(gHeroName, "darkpred_armor" )

	// CHECK SOME BUTTONS
	set_task(0.1,"checkButtons",0,"",0,"b")
	
	// HEAL LOOP
	set_task(1.0,"darkpred_loop",0,"",0,"b" )

	//ESP Rings Task
	set_task(2.0, "darkpred_esploop", 0, "", 0, "b")

	//Makes superhero tell DarkPredator a players max health
	register_srvcmd("darkpred_maxhealth", "darkpred_maxhealth")
	shRegMaxHealth(gHeroName, "darkpred_maxhealth" )
	gHealPoints = get_cvar_num("darkpred_healpoints")

	// BULLETS FIRED
	register_event("CurWeapon","darkpred_fire", "be", "1=1", "3>0") 
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
	gSpriteWhite = precache_model("sprites/white.spr")
	laser = precache_model("sprites/laserbeam.spr") 
	laser_impact = precache_model("sprites/zerogxplode.spr") 
	blast_shroom = precache_model("sprites/mushroom.spr") 
}
//----------------------------------------------------------------------------------------------
public darkpred_init()
{
	new temp[6] //Variable to store temp info in
	// First Argument is an id
	read_argv(1,temp,5) //This Checks for the ID of the person selecting/dropping this hero and saves as string
	new id=str_to_num(temp) //This makes the string Into a num
  
	// 2nd Argument is 0 or 1 depending on whether the id has darkpredator
	read_argv(2,temp,5) //This Checks if ID has this hero
	new hasPowers=str_to_num(temp) //This makes the string into a num
	gHasDarkPredPower[id]=(hasPowers!=0) //Store if this person has the hero
  
	gPlayerMaxHealth[id] = 100
	
	if ( hasPowers ) //Check if person selected this hero
	{
		remInvisibility(id)
		shGiveWeapon(id,"weapon_deagle")
	}
	// Got to slow down DarkPredator that lost his powers...
	if ( !hasPowers  && is_user_connected(id) ) //Check if person dropped this hero
	{
		//Do stuff to him if he just droppped it
		shRemArmorPower(id) //Loose the AP power of this hero
	}
}
//----------------------------------------------------------------------------------------------
public newRound(id)
{
	remInvisibility(id)
	if ( gHasDarkPredPower[id] ) 
	{
		gBullets[id] = get_cvar_num("darkpred_bullets")
		gLastWeapon[id] = -1
		set_task(0.1, "darkpred_deagle",id)
	}
	return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public setInvisibility(id, alpha)
{

	if (alpha < 125) {
		set_user_rendering(id,kRenderFxGlowShell,1,1,1,kRenderTransAlpha,alpha)
	}
	else {
		set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,alpha)
	}
}
//----------------------------------------------------------------------------------------------
public remInvisibility(id)
{
	gStillTime[id] = -1

	if (gIsInvisible[id] > 0) {
		shUnglow(id)
		client_print(id,print_center,"[SH]DarkPredator: You are no longer cloaked")
	}

	gIsInvisible[id] = 0
}
//----------------------------------------------------------------------------------------------
public checkButtons()
{
	if ( !hasRoundStarted() || !shModActive()) return

	new bool:setVisible
	new butnprs

	for(new id = 1; id <= SH_MAXSLOTS; id++) {
		if (!is_user_alive(id) || !gHasDarkPredPower[id]) continue

		setVisible = false
		butnprs = Entvars_Get_Int(id, EV_INT_button)

		//Always check these
		if (butnprs&IN_ATTACK || butnprs&IN_ATTACK2 || butnprs&IN_RELOAD || butnprs&IN_USE) setVisible = true

		//Only check these if darkpredator_checkmove is off
		if ( get_cvar_num("darkpred_checkmove") ) {
			if (butnprs&IN_JUMP) setVisible = true
			if (butnprs&IN_FORWARD || butnprs&IN_BACK || butnprs&IN_LEFT || butnprs&IN_RIGHT) setVisible = true
			if (butnprs&IN_MOVELEFT || butnprs&IN_MOVERIGHT) setVisible = true
		}

		if (setVisible) remInvisibility(id)
		else {
			new sysTime = get_systime()
			new delay = get_cvar_num("darkpred_delay")

			if ( gStillTime[id] < 0 ) {
				gStillTime[id] = sysTime
			}
			if ( sysTime - delay >= gStillTime[id] ) {
				if (gIsInvisible[id] != 100) client_print(id,print_center,"[SH]DarkPredator: 100%s cloaked", "%")
				gIsInvisible[id] = 100
				setInvisibility(id, get_cvar_num("darkpred_alpha"))
			}
			else if ( sysTime > gStillTime[id] ) {
				new alpha = get_cvar_num("darkpred_alpha")
				new Float:prcnt =  float(sysTime - gStillTime[id]) / float(delay)
				new rPercent = floatround(prcnt * 100)
				alpha = floatround(255 - ((255 - alpha) * prcnt) )
				client_print(id,print_center,"[SH]DarkPredator: %d%s cloaked", rPercent, "%")
				gIsInvisible[id] = rPercent
				setInvisibility(id, alpha)
			}
		}
	}
}
//----------------------------------------------------------------------------------------------
public changeWeapon(id)
{
	if ( !gHasDarkPredPower[id] || !shModActive() ) return

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

	// Never Run Out of Ammo!
	if ( wpnid == CSW_DEAGLE && clip == 0 ) {
		shReloadAmmo(id)
	}
}
//----------------------------------------------------------------------------------------------
public darkpred_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 ( gHasDarkPredPower[attacker] && weapon == CSW_DEAGLE && gBullets[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 ^"Dark Deagle^"", 
		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 darkpred_fire(id)
{ 

	if ( !gHasDarkPredPower[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 && gBullets[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(255)		// red
			write_byte(0)		// 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
			
			gBullets[id]--

			new message[128]
			format(message, 127, "You Have %d bullet(s) left",gBullets[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 ( gBullets[id] == 0 ) gBullets[id] = -1
		}
		
		gLastClipCount[id] = ammo
		gLastWeapon[id] = weap
	}
	return PLUGIN_CONTINUE 
}
//----------------------------------------------------------------------------------------------
public darkpred_deagle(id)
{
	shGiveWeapon(id,"weapon_deagle")
}
//----------------------------------------------------------------------------------------------
public darkpred_esploop()
{
	if (!shModActive()) return

	new players[SH_MAXSLOTS]
	new pnum, vec1[3]
	new idring, id

	gRadius = get_cvar_num("darkpred_radius")
	gBright = get_cvar_num("darkpred_bright")

	get_players(players,pnum,"a")

	for(new i = 0; i < pnum; i++) {
		idring = players[i]
		if (!is_user_alive(idring)) continue
		if (!get_user_origin(idring,vec1,0)) continue
		for (new j = 0; j < pnum; j++) {
			id = players[j]
			if (!gHasDarkPredPower[id]) continue
			if (!is_user_alive(id)) continue
			if (idring == id) continue
			message_begin(MSG_ONE,SVC_TEMPENTITY,vec1,id)
			write_byte( 21 )
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2] + 16)
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2] + gRadius )
			write_short( gSpriteWhite )
			write_byte( 0 ) // startframe
			write_byte( 1 ) // framerate
			write_byte( 6 ) // 3 life 2
			write_byte( 8 ) // width 16
			write_byte( 1 ) // noise
			write_byte( 255 ) // r
			write_byte( 215 ) // g
			write_byte( 0 ) // b
			write_byte( gBright ) //brightness
			write_byte( 0 ) // speed
			message_end()
		}
	}
}
//----------------------------------------------------------------------------------------------
public darkpred_loop()
{
	if (!shModActive()) return
	for ( new id = 1; id <= SH_MAXSLOTS; id++ ) {
		if (  gHasDarkPredPower[id] && is_user_alive(id)  )   {
			// Let the server add the hps back since the # of max hps is controlled by it
			// I.E. Superman has more than 100 hps etc.
			shAddHPs(id, gHealPoints, gPlayerMaxHealth[id] )
		}
	}
}
//----------------------------------------------------------------------------------------------
public darkpred_maxhealth()
{
	new id[6]
	new health[9]

	read_argv(1,id,5)
	read_argv(2,health,8)

	gPlayerMaxHealth[str_to_num(id)] = str_to_num(health)
}
//----------------------------------------------------------------------------------------------
"Juggernaut"
Code:
#include <amxmod>
#include <superheromod>

// Juggernaut - made by Mydas

/* CVARS
juggernaut_level 9 - his level
*/

#define HPNO 2048
// GLOBAL VARIABLES
new gHeroName[]="Juggernaut"
new bool:gHasJuggernautPowers[SH_MAXSLOTS+1]
new playerhealth[SH_MAXSLOTS+1]
new bool:tocheck[SH_MAXSLOTS+1]
new bool:protection[SH_MAXSLOTS+1]

public plugin_init()
{
  // Plugin Info
	register_plugin("SUPERHERO Huggernaut","1.0","Mydas")

	register_cvar("juggernaut_level", "9")
	shCreateHero(gHeroName, "Invulnerability", "Almost permanent resistance to damage not caused by weapons (fall damage, lasers)", false, "juggernaut_level" )
	register_srvcmd("juggernaut_init", "juggernaut_init")
	shRegHeroInit(gHeroName, "juggernaut_init")

	register_event("ResetHUD","newRound","b")
	register_event("Damage", "juggernaut_damage", "b", "2!0")

	set_task(0.1,"juggernaut_loop",0,"",0,"b" )
}

public juggernaut_init() 
{ 
	new temp[6] 

	read_argv(1, temp, 5) 
	new id = str_to_num(temp) 

	read_argv(2, temp, 5) 
	new hasPowers = str_to_num(temp) 
	gHasJuggernautPowers[id] = (hasPowers!=0)
	if (gHasJuggernautPowers[id]) {
		client_print(id, print_center, "You will get Juggernaut next time you spawn")
		tocheck[id]=true
	} else {
		tocheck[id]=false
		protection[id]=false
		if (get_user_health(id) >= HPNO) set_user_health(id, get_user_health(id)-HPNO)
	}
} 

public newRound(id)
{
  if (!gHasJuggernautPowers[id]) return
  if (tocheck[id]) tocheck[id]=false
  new parm[1]
  parm[0]=id
  //set_user_health(id, 100)
  set_task(1.0,"sethealth",id,parm,1)
}

public sethealth(parm[])
{
	new id=parm[0]
	playerhealth[id]=get_user_health(id)+HPNO
	protection[id]=true
	set_user_health(id, playerhealth[id])
}

public juggernaut_loop()
{
	for (new id = 1; id <= SH_MAXSLOTS; id++) {
		if (gHasJuggernautPowers[id] && protection[id] && is_user_alive(id) && hasRoundStarted() && !tocheck[id]){
			//client_print(id,print_center,"life : %i-%i",get_user_health(id), playerhealth[id]) //debugging purposes
			//if ((get_user_health(id) <= HPNO) && (get_user_health(id) > playerhealth[id]-HPNO)) playerhealth[id] = get_user_health(id)+HPNO
			if (get_user_health(id) < playerhealth[id]) set_user_health(id, playerhealth[id]) 
			}
	}
}

public juggernaut_damage(id) 
{
	new damage = read_data(2)
	new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
	if (attacker <= 0 || attacker > SH_MAXSLOTS || !gHasJuggernautPowers[id] || !is_user_alive(id) || !protection[id]) return 
	if (attacker!=id && !tocheck[id]) playerhealth[id] -= damage
	if (playerhealth[id] <= HPNO+10) {
		set_user_health(id, random_num(1,10))
		protection[id]=false
	}
}
"Green Arrow"
Code:
 // GREEN ARROW! - Exploding Arrows (bullets from scout)

 /* CVARS - copy and paste to shconfig.cfg

 // Green Arrow
 garrow_level 10
 garrow_arrows 10
 garrow_getscout 0

 */

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

 // VARIABLES
 new gHeroName[]="Green Arrow"
 new gHasGarrowPower[SH_MAXSLOTS+1]
 new gArrows[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 Green Arrow","1.2","AssKicR / ArtofDrowning07")

	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("garrow_level","10")
	register_cvar("garrow_arrows", "10")
	register_cvar("garrow_getscout", "0")

	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	shCreateHero(gHeroName, "Green Arrows", "You get some Explosive Arrows for your bow(scout)!", false, "garrow_level" )

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

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

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

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

	// ARROW FIRED
	register_event("CurWeapon","garrow_fire", "be", "1=1", "3>0")
	register_event("CurWeapon","weaponChange","be","1=1")
 }
 //----------------------------------------------------------------------------------------------
 public garrow_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 garrow
	read_argv(2,temp,5)
	new hasPowers = str_to_num(temp)

	gHasGarrowPower[id]=(hasPowers!=0)

	if ( !is_user_alive(id) ) return

	switchmodel(id)

	if ( gHasGarrowPower[id] )
	{
		gArrows[id] = get_cvar_num("garrow_arrows")

		if ( get_cvar_num("garrow_getscout") == 1 )
		shGiveWeapon(id,"weapon_scout")
	}
 }
 //----------------------------------------------------------------------------------------------
 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/Greenarrow_v.mdl")
	precache_model("models/shmod/Greenarrow_p.mdl")

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

		if ( get_cvar_num("garrow_getscout") == 1 )
		shGiveWeapon(id,"weapon_scout")
	}
 }
 //----------------------------------------------------------------------------------------------
 public garrow_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 ( gHasGarrowPower[attacker] && weapon == CSW_SCOUT && gArrows[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("scout")
		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 garrow_fire(id)
 {

	if ( !gHasGarrowPower[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_SCOUT && is_user_alive(id) )
	{
		if (gLastWeapon[id] == 0) gLastWeapon[id] = weap

		if ( gLastClipCount[id] > ammo && gLastWeapon[id] == weap && gArrows[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

			gArrows[id]--

			new message[128]
			format(message, 127, "You Have %d arrow(s) left",gArrows[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 ( gArrows[id] == 0 ) gArrows[id] = -1
		}

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

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

	if ( wpnid == CSW_SCOUT ) switchmodel(id)

	switchmodel(id)

	// Never Run Out of Ammo!
	if ( clip == 0 ) {
		shReloadAmmo(id)
	}
 }
 //----------------------------------------------------------------------------------------------
__________________
[SS]Superhero By 8Ball | 10 Free Levels | Max 50 Level | FastDL


Join us now !

Last edited by SimonLANO; 06-20-2012 at 18:44.
SimonLANO is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-21-2012 , 07:24   Re: "run time error 10"
Reply With Quote #4

All of those heroes have one thing in common; they are all coded using the old ways. Two of them even use vexd which is very, very old and very much outdated.

Did you use the online compiler to compile them, or are you compiling locally?

The online compiler only has build 10 (if I recall correctly), which may cause the trouble, if you use the webcompiler, try to compile locally with build 14.
If you are using a local compiler, then make sure your include file has build 14.

If this is not the case, and you are compiling with build 14, then add debug to the heroes which are causing trouble, that will give me more to work with.

To enable debug:

Quote:
Originally Posted by plugins-shero.ini
sh_darkpredator.amxx debug
sh_greenarrow.amxx debug
sh_juggernaut.amxx debug
__________________
No idea what to write here...

Last edited by Jelle; 06-21-2012 at 07:26.
Jelle is offline
Send a message via MSN to Jelle
SimonLANO
Member
Join Date: Dec 2008
Old 06-21-2012 , 15:41   Re: "run time error 10"
Reply With Quote #5

I tried to compile them locally with build 14 now, they get compiled but it gives me 2 warnings for each hero wich is: warning 213: tag mismatch. ( Only on green arrow and dark predator ) I wil try enable debug and give more you more information soon :-)

EDIT: Ok, puted debug on green arrow, dark predator and juggernaut now, i get this in errorlog:

Code:
L 06/21/2012 - 21:35:59: [AMXX] Displaying debug trace (plugin "sh_darkpredator.amxx")
L 06/21/2012 - 21:35:59: [AMXX] Run time error 10: native error (native "get_user_attacker")
L 06/21/2012 - 21:35:59: [AMXX]    [0] sh_darkpredator.sma::darkpred_damage (line 240)
L 06/21/2012 - 21:35:59: Invalid player id 0
L 06/21/2012 - 21:35:59: [AMXX] Displaying debug trace (plugin "sh_greenarrow.amxx")
L 06/21/2012 - 21:35:59: [AMXX] Run time error 10: native error (native "get_user_attacker")
L 06/21/2012 - 21:35:59: [AMXX]    [0] sh_greenarrow.sma::garrow_damage (line 108)
L 06/21/2012 - 21:35:59: Invalid player id 0
L 06/21/2012 - 21:35:59: [AMXX] Displaying debug trace (plugin "sh_juggernaut.amxx")
L 06/21/2012 - 21:35:59: [AMXX] Run time error 10: native error (native "get_user_attacker")
L 06/21/2012 - 21:35:59: [AMXX]    [0] sh_juggernaut.sma::juggernaut_damage (line 86)
__________________
[SS]Superhero By 8Ball | 10 Free Levels | Max 50 Level | FastDL


Join us now !

Last edited by SimonLANO; 06-21-2012 at 16:38.
SimonLANO is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-21-2012 , 19:19   Re: "run time error 10"
Reply With Quote #6

There is absolutely nothing that suggests that there is something wrong in those lines. The heroes are coded the old ways, which are probably why they are acting up.

If you think they are crashing your server, then disable them and see if your server still crashes.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
SimonLANO
Member
Join Date: Dec 2008
Old 06-21-2012 , 19:41   Re: "run time error 10"
Reply With Quote #7

Ok, Strange it gives me error tho, you sure there is nothing wrong with the lines?

Is there anyway i can stop the heroes from making errorlogs ?
__________________
[SS]Superhero By 8Ball | 10 Free Levels | Max 50 Level | FastDL


Join us now !
SimonLANO is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-21-2012 , 20:10   Re: "run time error 10"
Reply With Quote #8

It looks fine to me, but the way it finds out who the attacker was and all that, well, there are easier ways to do it. I usually do not do it that ways because something like this can happen. The hero is old, you can't get around that unless you recode it properly.

I do not know of a way to stop error messages, but why would you? Error messages comes because something is wrong.

I can tell you that the player ID 0 is world, so if they died from world (which they do with more damage using SH mod or that insta kill from predator) then it prints this error because the code expects a player ID, and since ID 0 is world not a player, it writes an error for that.

There is an easy way to get around this. Replace this code:

PHP Code:
public garrow_damage(id)
 {
    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(id,weapon,bodypart)

    if ( 
attacker || attacker SH_MAXSLOTS ) return PLUGIN_CONTINUE 
with this:

PHP Code:
public garrow_damage(id)
 {
    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(id,weapon,bodypart)
    
    if ( 
attacker == 0) return PLUGIN_CONTINUE

    
if ( attacker || attacker SH_MAXSLOTS ) return PLUGIN_CONTINUE 
In green arrow that is.

In juggernaut you replace this:

PHP Code:
public juggernaut_damage(id
{
    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(idweaponbodypart)
    if (
attacker <= || attacker SH_MAXSLOTS || !gHasJuggernautPowers[id] || !is_user_alive(id) || !protection[id]) return 
    if (
attacker!=id && !tocheck[id]) playerhealth[id] -= damage
    
if (playerhealth[id] <= HPNO+10) {
        
set_user_health(idrandom_num(1,10))
        
protection[id]=false
    
}

With

PHP Code:
public juggernaut_damage(id
{
    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(idweaponbodypart)
    if ( 
attacker == ) return
    if (
attacker <= || attacker SH_MAXSLOTS || !gHasJuggernautPowers[id] || !is_user_alive(id) || !protection[id]) return 
    if (
attacker!=id && !tocheck[id]) playerhealth[id] -= damage
    
if (playerhealth[id] <= HPNO+10) {
        
set_user_health(idrandom_num(1,10))
        
protection[id]=false
    
}

And for darkpred replace this:

PHP Code:
public darkpred_damage(id)
{
    

    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(id,weapon,bodypart)
    
    if ( 
attacker || attacker SH_MAXSLOTS ) return PLUGIN_CONTINUE 
With:

PHP Code:
public darkpred_damage(id)
{
    

    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(id,weapon,bodypart)
    
    if ( 
attacker == ) return PLUGIN_CONTINUE

    
if ( attacker || attacker SH_MAXSLOTS ) return PLUGIN_CONTINUE 
That should get rid of those errors.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
SimonLANO
Member
Join Date: Dec 2008
Old 06-22-2012 , 10:43   Re: "run time error 10"
Reply With Quote #9

Thanks, i wil see if it works now. :-)
__________________
[SS]Superhero By 8Ball | 10 Free Levels | Max 50 Level | FastDL


Join us now !
SimonLANO 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 19:49.


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