This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

compile error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danu7y
BANNED
Join Date: Nov 2010
Location: Bucharest , Romania
Old 11-10-2010 , 05:12   compile error
Reply With Quote #1

i tryed to change some models in bio_random_models.sma , and when i try to compile the sma , it gives this error.


Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/php73UjRl.sma(6) : fatal error 110: assertion failed: Biohazard functions file required!


Compilation aborted.
1 Error.


and this is the sma...

Code:
#include <amxmodx>
#include <fakemeta>
#tryinclude <biohazard>

#if !defined _biohazard_included
        #assert Biohazard functions file required!
#endif

new g_zombie_models[][] =
{
	"models/player/extreme1/extreme1.mdl",
	"models/player/extreme2/extreme2.mdl",
	"models/player/extreme3/extreme3.mdl",
	"models/player/extreme4/extreme4.mdl"
}

new cvar_randommodels
public plugin_precache()
{
	register_plugin("random models", "0.1", "cheap_suit")
	is_biomod_active() ? plugin_precache2() : pause("ad")
}

public plugin_precache2()
{
	cvar_randommodels = register_cvar("bh_random_models", "1")
	for(new i = 0; i < sizeof g_zombie_models; i++)
		precache_model(g_zombie_models[i])
}

public event_infect2(id) if(get_pcvar_num(cvar_randommodels))
{	
	static ent; ent = fm_find_ent_by_owner(-1, "player_model", id)
	if(pev_valid(ent)) engfunc(EngFunc_SetModel, ent, g_zombie_models[random(sizeof g_zombie_models)])
}

stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) 
{
	static strtype[11] = "classname", ent; ent = index
	switch(jghgtype) 
	{
		case 1: strtype = "target"
		case 2: strtype = "targetname"
	}
	while((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
	
	return ent
}
could someone give me the amxx for this sma ? i tryed more different ways to compile this... it doesen't work
danu7y is offline
Send a message via Yahoo to danu7y Send a message via Skype™ to danu7y
FragOwn
Senior Member
Join Date: Jun 2010
Old 11-10-2010 , 05:54   Re: compile error
Reply With Quote #2

Quote:
Biohazard functions file required!
I suggest don't use the online compiler for script files that needs <biohazard>

Here:
Attached Files
File Type: sma Get Plugin or Get Source (bio_random_models.sma - 590 views - 1.3 KB)
__________________
We can't aim, but we can kill.

Last edited by FragOwn; 11-10-2010 at 06:02.
FragOwn is offline
danu7y
BANNED
Join Date: Nov 2010
Location: Bucharest , Romania
Old 11-10-2010 , 06:05   Re: compile error
Reply With Quote #3

and how can i compile it? it doesn't work that you gived me
danu7y is offline
Send a message via Yahoo to danu7y Send a message via Skype™ to danu7y
Leon_12
Senior Member
Join Date: Jul 2010
Location: Bulgaria
Old 11-10-2010 , 06:40   Re: compile error
Reply With Quote #4

try this:
Code:
#include <amxmodx>
#include <fakemeta>
#include <biohazard>
new g_zombie_models[][] =
{
 "models/player/extreme1/extreme1.mdl",
 "models/player/extreme2/extreme2.mdl",
 "models/player/extreme3/extreme3.mdl",
 "models/player/extreme4/extreme4.mdl"
}
new cvar_randommodels
public plugin_precache()
{
 register_plugin("Random Models", "0.1", "Cheap_Suit")
 is_biomod_active() ? plugin_precache2() : pause("ad")
}
public plugin_precache2()
{
 cvar_randommodels = register_cvar("bh_random_models", "1")
 for(new i = 0; i < sizeof g_zombie_models; i++)
  precache_model(g_zombie_models[i])
}
public event_infect2(id) if(get_pcvar_num(cvar_randommodels))
{ 
 static ent; ent = fm_find_ent_by_owner(-1, "player_model", id)
 if(pev_valid(ent)) engfunc(EngFunc_SetModel, ent, g_zombie_models[random(sizeof g_zombie_models)])
}
stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) 
{
 static strtype[11] = "classname", ent; ent = index
 switch(jghgtype) 
 {
  case 1: strtype = "target"
  case 2: strtype = "targetname"
 }
 while((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
 
 return ent
}
you also need .inc file put biohazard.inc in amxmodx/scripting/include/
Attached Files
File Type: inc biohazard.inc (2.1 KB, 143 views)

Last edited by YamiKaitou; 11-10-2010 at 14:42.
Leon_12 is offline
Send a message via Skype™ to Leon_12
danu7y
BANNED
Join Date: Nov 2010
Location: Bucharest , Romania
Old 11-10-2010 , 10:33   Re: compile error
Reply With Quote #5

/home/groups/amxmodx/tmp3/phpJ3y8zV.sma(3) : fatal error 100: cannot read from file: "biohazard"

Compilation aborted.
1 Error.

:-<

Last edited by danu7y; 11-10-2010 at 10:38.
danu7y is offline
Send a message via Yahoo to danu7y Send a message via Skype™ to danu7y
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 11-10-2010 , 10:37   Re: compile error
Reply With Quote #6

Quote:
Originally Posted by danu7y View Post
/home/groups/amxmodx/tmp3/phpJ3y8zV.sma(3) : fatal error 100: cannot read from file: "biohazard"

Compilation aborted.
1 Error.
offf
U need to compile that locally
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
danu7y
BANNED
Join Date: Nov 2010
Location: Bucharest , Romania
Old 11-10-2010 , 11:13   Re: compile error
Reply With Quote #7

doesn't work. it gives another error...
danu7y is offline
Send a message via Yahoo to danu7y Send a message via Skype™ to danu7y
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-10-2010 , 12:39   Re: compile error
Reply With Quote #8

Quote:
Originally Posted by danu7y View Post
doesn't work. it gives another error...
Compiles just fine locally for me using the attached include file.

EDIT: Correction, Leon_12 forgot the '#' at the very beginning of the file, I thought that I had missed it when I copied the code.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Leon_12
Senior Member
Join Date: Jul 2010
Location: Bulgaria
Old 11-10-2010 , 14:22   Re: compile error
Reply With Quote #9

danu7y if you include that file drag the sma file to amxxpc or compile.exe and all will work
BTW yamikatitou thanks for editing
Leon_12 is offline
Send a message via Skype™ to Leon_12
danu7y
BANNED
Join Date: Nov 2010
Location: Bucharest , Romania
Old 11-12-2010 , 12:38   Re: compile error
Reply With Quote #10

done .... thx for the help...
danu7y is offline
Send a message via Yahoo to danu7y Send a message via Skype™ to danu7y
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 12:06.


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