AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Tons Of Errors (https://forums.alliedmods.net/showthread.php?t=9428)

Dizzy 01-18-2005 18:47

Tons Of Errors
 
I can't find out what's wrong...

Here's The Script

I Get 26 Errors (Invalid Functions, No Header?, and an Azzumed zero)

1 Header
1 Azzumed Zero
and the rest were Invalid Functions

Tell Me If You Find AnyThing Obvious

Thanks!

Code:
 /*****************************************************************  Monster Spawner!  * By: Dizzy  * Created 1/18/05  *All Rights Reserved  *  *DESCRIPTION -  * Summons Monsters On Admin_Level_A Client Command  *  * CVARS -  * sv_ms (0|1) (Off|On)  *  *CLCMDS -  * /agrunt  * /apache  * /barney  * /bigmomma  * /bullsquid  * /hassassin  * /headcrab  * /hgrunt  * /houndeye  * /islave  * /contoller  * /scientist  * /snark  * /zombie  *  *REQUIREMENTS -  *monster_plugin  *****************************************************************/  //INCLUDES  //-------------------------------------------------------------------------------------  #include <amxmodx>  //-------------------------------------------------------------------------------------  //NEWS  //-------------------------------------------------------------------------------------  new gPlayerPosition  //-------------------------------------------------------------------------------------  public plugin_init() {     //-------------------------------------------------------------------------------------     //PLUGIN INFO     //-------------------------------------------------------------------------------------     register_plugin("Monster Spawner","1.0","Dizzy")     //-------------------------------------------------------------------------------------     //CVARS     //-------------------------------------------------------------------------------------     register_cvar("sv_ms","1")     //-------------------------------------------------------------------------------------     //CLCMDS     //-------------------------------------------------------------------------------------     register_clcmd("say /agrunt","agrunt", ADMIN_LEVEL_A)     register_clcmd("say /apache","apache", ADMIN_LEVEL_A)     register_clcmd("say /barney","barney", ADMIN_LEVEL_A)     register_clcmd("say /bigmomma","bigmomma", ADMIN_LEVEL_A)     register_clcmd("say /bullsquid","bullsquid", ADMIN_LEVEL_A)     register_clcmd("say /hassassin","hassassin", ADMIN_LEVEL_A)     register_clcmd("say /headcrab","headcrab", ADMIN_LEVEL_A)     register_clcmd("say /hgrunt","hgrunt", ADMIN_LEVEL_A)     register_clcmd("say /houndeye","houndeye", ADMIN_LEVEL_A)     register_clcmd("say /islave","islave", ADMIN_LEVEL_A)     register_clcmd("say /controller","controller", ADMIN_LEVEL_A)     register_clcmd("say /scientist","scientist", ADMIN_LEVEL_A)     register_clcmd("say /snark","snark", ADMIN_LEVEL_A)     register_clcmd("say /zombie","zombie", ADMIN_LEVEL_A)  }  //-------------------------------------------------------------------------------------  //PLUGIN SPAWN  //-------------------------------------------------------------------------------------  public spawn_monster(id,monstername[]) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster %s",monstername)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //AGRUNT  //-------------------------------------------------------------------------------------  public agrunt(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster agrunt", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //APACHE  //-------------------------------------------------------------------------------------  public apache(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster apache", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //BARNEY  //-------------------------------------------------------------------------------------  public barney(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster barney", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //BIGMOMMA  //-------------------------------------------------------------------------------------  public bigmomma(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster bigmomma", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //BULLSQUID  //-------------------------------------------------------------------------------------  public bullsquid(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster bullsquid", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //HASSASSIN  //-------------------------------------------------------------------------------------  public hassassin(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster hassassin", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //HEADCRAB  //-------------------------------------------------------------------------------------  public headcrab(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster headcrab", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //HGRUNT  //-------------------------------------------------------------------------------------  public hgrunt(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster hgrunt", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //HOUNDEYE  //-------------------------------------------------------------------------------------  public houndeye(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster houndeye", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //ISLAVE  //-------------------------------------------------------------------------------------  public islave(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster islave", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //CONTROLLER  //-------------------------------------------------------------------------------------  public controller(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster controller", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //SCIENTIST  //-------------------------------------------------------------------------------------  public scientist(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster scientist", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //SNARK  //-------------------------------------------------------------------------------------  public snark(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster snark", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------  //ZOMBIE  //-------------------------------------------------------------------------------------  public zombie(id) {     if (get_cvar_num("sv_ms")==0)     return PLUGIN_HANDLED     if (is_user_alive(id)) {         emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         server_cmd("monster zombie", id)     }     return PLUGIN_HANDLED  }  //-------------------------------------------------------------------------------------

Ced 01-18-2005 19:47

Code:
/***************************************************************** Attack Of The Clones! * By: Dizzy * Created 1/18/05 *All Rights Reserved * *DESCRIPTION - * Summons Monsters On Admin_Level_A Client Command * * CVARS - * sv_aotc (0|1) (Off|On) * *CLCMDS - */agrunt */apache */barney */bigmomma */bullsquid */hassassin */headcrab */hgrunt */houndeye */islave */contoller */scientist */snark */zombie * *REQUIREMENTS - *monster_plugin

shouldn't it be

Code:
/***************************************************************** Attack Of The Clones! * By: Dizzy * Created 1/18/05 *All Rights Reserved * *DESCRIPTION - * Summons Monsters On Admin_Level_A Client Command * * CVARS - * sv_aotc (0|1) (Off|On) * *CLCMDS - *agrunt *apache *barney *bigmomma *bullsquid *hassassin *headcrab *hgrunt *houndeye *islave *contoller *scientist *snark *zombie * *REQUIREMENTS - *monster_plugin */

looks like your comment tags were messed up

Peli 01-18-2005 20:29

That's what happens when you use /* */ comments... Fix that and see what happens.

Dizzy 01-19-2005 10:37

K i will try :D

I am at school right now so I will fix it at home :D

Dizzy 01-19-2005 10:40

but why the other errors

someone test compile it. See the errors (at school)

:cry:

Dizzy 01-20-2005 13:47

*BUMP*

(Please Help)

Smokey485 01-20-2005 14:59

Id help u if u actually listened to peli and saw u never put some things down.

Da Bishop 01-20-2005 15:07

Quote:

Originally Posted by Smokey485
Id help u if u actually listened to peli and saw u never put some things down.

well, the no commects caused errors... but heres the main problem

Code:
    register_clcmd("/agrunt","agrunt","ADMIN_LEVEL_A")
As you know this registers this commnad and executes the function called agrunt.

Code:
plugin agrunt(id)

okay, not sure where you got the whole plugin thing from but.... it needs to be a public function and indentical to the called function. The command calls for the function "agrunt" so it appears as so

Code:
public agrunt(id) { //code }

XxAvalanchexX 01-20-2005 18:49

Wow, I didn't notice it until you put that line of code up there, Da Bishop, and I'm surprised you didn't comment on it: he uses the third parameter in register_clcmd as a string, "ADMIN_LEVEL_A", however it takes a constant integer, so remove the quotes, ADMIN_LEVEL_A

Da Bishop 01-20-2005 19:14

Quote:

Originally Posted by XxAvalanchexX
Wow, I didn't notice it until you put that line of code up there, Da Bishop, and I'm surprised you didn't comment on it: he uses the third parameter in register_clcmd as a string, "ADMIN_LEVEL_A", however it takes a constant integer, so remove the quotes, ADMIN_LEVEL_A

O well, glad you caught it. I wan't paying much attention. Lol im still on pain killers. Damn surgery.


All times are GMT -4. The time now is 19:25.

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