Raised This Month: $ Target: $400
 0% 

i get this error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diablo-89
Junior Member
Join Date: Jul 2005
Location: the netherlands
Old 08-24-2005 , 09:47   i get this error
Reply With Quote #1

im making a plugin for cstrike
i get this error when i compile:


//AMXXSC compile.exe
// by the AMX Mod X Dev Team


//// hostageprotect.sma
// C:\Program Files\Valve\Steam\SteamApps\miss_molliej\dedi cated server\cstrike\
addons\amxmodx\scripting\hostageprotect.sma(1 9) : error 010: invalid function or
declaration
// C:\Program Files\Valve\Steam\SteamApps\miss_molliej\dedi cated server\cstrike\
addons\amxmodx\scripting\hostageprotect.sma(2 0) : error 010: invalid function or
declaration
//
// 2 Errors.
// Could not locate output file C:\Program Files\Valve\Steam\SteamApps\miss_moll
iej\dedicated server\cstrike\addons\amxmodx\scripting\compi led\hostageprotect.am
x (compile failed).
//
// Compilation Time: 1.72 sec
// ----------------------------------------

Press enter to exit ...





when i look at those lines (19 and 21)

there is this... and i dont see the reason for the error???



#include <amxmodx>
#include <engine>
#include <amxmisc>

#define TEAM_T 1
#define TEAM_CT 2
#define MAXSPAWNPOINTS 64 // the max number of spawnpoints the plugin supports

public plugin_init() {
register_plugin("hostage protect","1.3","Diablo");
register_cvar("amx_hostageprotect","0");
register_cvar("amx_slaytime","4.9")
register_logevent("Event_NewRound",2,"0=World triggered","1=Round_Start")
register_event("TextMsg","HostageKilled","b", "2&#Killed_Hostage")
}


// if cvar is 0 plugin is off
if (get_cvar_num("amx_hostageprotect") == 0 )
{ return PLUGIN_HANDLED;
}

public function() {
new rescuezone
find_ent_by_class(-1, "func_hostage_rescue")
remove_entity(rescuezone)
}

stock SwitchTeams() // This function turns the team spawn points around, and switches the owner of the buyzone
{
new EntNums[MAXSPAWNPOINTS+1]
new EntCount = 0
new Float:TSpawnsO[MAXSPAWNPOINTS/2][3]
new Float:CTSpawnsO[MAXSPAWNPOINTS/2][3]
new Float:TSpawnsA[MAXSPAWNPOINTS/2][3]
new Float:CTSpawnsA[MAXSPAWNPOINTS/2][3]
new TSpawnCount = 0
new CTSpawnCount = 0

new ClassName[32]
for(new i=g_MaxPlayers+1;i<g_MaxEnts;i++) if(is_valid_ent(i) && entity_get_edict(i, EV_ENT_owner) == 0)
{
new bool:HasChanged = false
entity_get_string(i,EV_SZ_classname,ClassName ,31)

if(equal(ClassName,"func_buyzone"))
{
new Team = entity_get_int(i,EV_INT_team)
if(Team == TEAM_CT)
entity_set_int(i,EV_INT_team,TEAM_T)
else if(Team == TEAM_T)
entity_set_int(i,EV_INT_team,TEAM_CT)
}
else if(equal(ClassName,"info_player_deathmatch")) // Means the team is Terror
{
EntNums[EntCount] = i
EntCount++

entity_get_vector(i,EV_VEC_origin,TSpawnsO[TSpawnCount])
entity_get_vector(i,EV_VEC_angles,TSpawnsA[TSpawnCount])
TSpawnCount++
HasChanged = true
}
else if(equal(ClassName,"info_player_start")) // Means we are talking Counter strike
{
EntNums[EntCount] = i
EntCount++

entity_get_vector(i,EV_VEC_origin,CTSpawnsO[CTSpawnCount])
entity_get_vector(i,EV_VEC_angles,CTSpawnsA[CTSpawnCount])
CTSpawnCount++
HasChanged = true
}
if(HasChanged == true && ( EntCount == MAXSPAWNPOINTS || TSpawnCount == MAXSPAWNPOINTS / 2 || CTSpawnCount == MAXSPAWNPOINTS / 2) )
{
log_amx("This map has to many spawnpoints, Try increasing the value of: #define MAXSPAWNPOINTS in the .sma file, and recompile the plugin.")
return 0
}
}
new CTSpawnsUsed = 0
new TSpawnsUsed = 0

for(new i=0;i<=EntCount;i++) if(EntNums[i] != 0)
{
entity_get_string(EntNums[i],EV_SZ_classname,ClassName,31)

if(equal(ClassName,"info_player_deathmatch") && CTSpawnsUsed <= TSpawnCount ) // Means the team is Terror
{
entity_set_vector(EntNums[i],EV_VEC_origin,CTSpawnsO[CTSpawnsUsed])
entity_set_vector(EntNums[i],EV_VEC_angles,CTSpawnsA[CTSpawnsUsed])
CTSpawnsUsed++
}
else if(equal(ClassName,"info_player_start") && TSpawnsUsed <= CTSpawnCount) // Means we are talking Counter strike
{
entity_set_vector(EntNums[i],EV_VEC_origin,TSpawnsO[TSpawnsUsed])
entity_set_vector(EntNums[i],EV_VEC_angles,TSpawnsA[TSpawnsUsed])
TSpawnsUsed++
}
}
return 1
}

public Event_NewRound()
{
set_task(get_cvar_float("amx_slaytime"),"Slay Terrors",2932)
}

public SlayTerrors()
{
new aPlayers[32],iNum,i
get_players(aPlayers,iNum,"ae","TERRORIST")

for(i = 0; i <= iNum; i++)
{
new id = aPlayers[i]
if(!is_user_connected(id)) continue
user_kill(id)
}
}

new g_iHostages

public HostageKilled()
{
new iEnts = get_global_int(GL_maxEntities)

g_iHostages = 0

for(new i = -1; i <= iEnts; i++)
{
if(!is_valid_ent(i)) continue

new szClassName[32]
entity_get_string(i,EV_SZ_classname,szClassNa me,31)
if(equali(szClassName,"hostage_entity"))
g_iHostages++
}

if(g_iHostages <= 0)
{
new aPlayers[32],iNum,i
get_players(aPlayers,iNum,"ae","CT")

for(i = 0; i <= iNum; i++)
{
new id = aPlayers[i]
if(!is_user_connected(id)) continue
user_kill(id)
}
}
}



plz help me out here



thanx greetz Diablo






If you think v3x is a PIMP, paste this into your sig!
Diablo-89 is offline
Send a message via MSN to Diablo-89
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 09:52  
Reply With Quote #2

Show me the whole function.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Diablo-89
Junior Member
Join Date: Jul 2005
Location: the netherlands
Old 08-24-2005 , 10:06  
Reply With Quote #3

there you go... i updated my last post now its the entire plugin

thanx allot in advance




If you think v3x is a PIMP, paste this into your sig!
Diablo-89 is offline
Send a message via MSN to Diablo-89
DataMatrix
Senior Member
Join Date: Aug 2005
Location: UK, Liverpool
Old 08-24-2005 , 10:12  
Reply With Quote #4

Try this:
Code:
new hostageprotect[32] get_cvar_num("amx_hostageprotect",hostageprotect,31) if (equal(hostageprotect,"0")) {     return PLUGIN_HANDLED; }

Instead of this:
Code:
if (get_cvar_num("amx_hostageprotect") == 0 ) { return PLUGIN_HANDLED; }
DataMatrix is offline
Send a message via MSN to DataMatrix
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 10:15  
Reply With Quote #5

You cannot have any AMXX native outside of any function/forward. You must put it inside. I thought that's what you did wrong.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Diablo-89
Junior Member
Join Date: Jul 2005
Location: the netherlands
Old 08-24-2005 , 10:16  
Reply With Quote #6

nope


//AMXXSC compile.exe
// by the AMX Mod X Dev Team


//// hostageprotect.sma
// C:\Program Files\Valve\Steam\SteamApps\miss_molliej\dedi cated server\cstrike\
addons\amxmodx\scripting\hostageprotect.sma(2 0) : error 021: symbol already defi
ned: "get_cvar_num"
// C:\Program Files\Valve\Steam\SteamApps\miss_molliej\dedi cated server\cstrike\
addons\amxmodx\scripting\hostageprotect.sma(2 1) : error 010: invalid function or
declaration
// C:\Program Files\Valve\Steam\SteamApps\miss_molliej\dedi cated server\cstrike\
addons\amxmodx\scripting\hostageprotect.sma(2 2) : error 010: invalid function or
declaration
// C:\Program Files\Valve\Steam\SteamApps\miss_molliej\dedi cated server\cstrike\
addons\amxmodx\scripting\hostageprotect.sma(1 55) : warning 203: symbol is never
used: "hostageprotect"
//
// 3 Errors.
// Could not locate output file C:\Program Files\Valve\Steam\SteamApps\miss_moll
iej\dedicated server\cstrike\addons\amxmodx\scripting\compi led\hostageprotect.am
x (compile failed).
//
// Compilation Time: 1.67 sec
// ----------------------------------------

Press enter to exit ...
Diablo-89 is offline
Send a message via MSN to Diablo-89
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 10:19  
Reply With Quote #7

Code:
// if cvar is 0 plugin is off if (get_cvar_num("amx_hostageprotect") == 0 )     { return PLUGIN_HANDLED; }
That MUST be inside of a function/forward.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
DataMatrix
Senior Member
Join Date: Aug 2005
Location: UK, Liverpool
Old 08-24-2005 , 10:21  
Reply With Quote #8

Hmm, remove the code where its reporting the error and add this instead:
Code:
public test123() {     new hostageprotect[32]     get_cvar_num("amx_hostageprotect",hostageprotect,31)     if (equal(hostageprotect,"0")) {         return PLUGIN_HANDLED;     } }

Then add test123 to plugin_init, e.g:

Code:
public plugin_init() {     test123 }
DataMatrix is offline
Send a message via MSN to DataMatrix
Diablo-89
Junior Member
Join Date: Jul 2005
Location: the netherlands
Old 08-24-2005 , 10:22  
Reply With Quote #9

so where do i place that then??
Diablo-89 is offline
Send a message via MSN to Diablo-89
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 10:22  
Reply With Quote #10

Inside one of your functions ( at the top ).

Code:
if(get_cvar_num("blah_blah")) {     return PLUGIN_HANDLED }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 14:24.


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