|
BANNED
Join Date: Jul 2007
Location: (#504434)
|

09-15-2007
, 19:50
Compile Errors [FAST HELP]
|
#1
|
I'm trying to remake this sloppy, unsupported plugin that was left behind and i'm going to submit it. It doesn't compile and i've tried everything to get rid of these errors but nothing works, can someone clean up the code so it will compile correctly please?
Code:
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun>
#define PLUGIN "Last Level Boss" #define VERSION "1.0" #define AUTHOR "X-Script"
new player new bossPower new old_mp_autoteambalance new old_mp_roundtime new old_mp_buytime new old_mp_freezetime new old_mp_startmoney
Float:old_mp_roundtime Float:old_mp_buytime Float:old_mp_freezetime Float:old_mp_startmoney
public plugin_init(){ register_plugin(PLUGIN, VERSION, AUTHOR) register_menucmd(register_menuid("Team_Select"),(1<<0)|(1<<1)|(1<<4)|(1<<5),"hook_team_select") register_menucmd(-2,(1<<0)|(1<<1)|(1<<4)|(1<<5),"hook_team_select") register_concmd("amx_setboss", "CreateBoss", ADMIN_KICK, "- Makes a player the big boss") register_concmd("amx_unsetboss", "DestroyBoss", ADMIN_KICK, "- Ends the big boss event") register_concmd("say /bossinfo", "BossInfo", -1, "- Displays information on the boss") register_event("TeamScore", "hook_teamscore", "a") player=0 }
public hook_team_select(id, key) { if (( key==0) && ( player!=0 )) { engclient_cmd(id,"chooseteam") return PLUGIN_HANDLED } return PLUGIN_CONTINUE }
public CreateBoss(id, level, cid) { if (cmd_access(id,level,cid,1)) set_task(5.0,"UnmakeBoss") return PLUGIN_HANDLED }
public hook_teamscore() { new score=read_data(2) if ((score >0) && (player !=0)) UnmakeBoss() return PLUGIN_HANDLED }
public UnmakeBoss() { if (player == 0) return PLUGIN_CONTINUE if (is_user_connected(player)) set_user_rendering(player,kRenderFxGlowShell,0,0,0,kRenderNormal,99) player = 0 set_cvar_float("mp_roundtime",old_mp_roundtime) set_cvar_float("mp_buytime",old_mp_buytime) set_cvar_num("mp_autoteambalance",old_mp_autoteambalance) set_cvar_num("mp_freezetime",old_mp_freezetime) set_cvar_num("mp_startmoney",old_mp_startmoney) set_cvar_num("sv_restart",1) return PLUGIN_HANDLED }
public cmdMakeBoss(id, level, cid) { if (!cmd_access (id, level, cid, 3) ) return PLUGIN_HANDLED if(player!=0) { client_print(id,print_console,"[AMXX] There is already a boss in the game") return PLUGIN_HANDLED } new arg[32] read_argv(1, arg, 31) player = cmd_target(id, arg, 6) if(!player) return PLUGIN_HANDLED read_argv(2,arg,31) bossPower=max(201,min(999,str_to_num(arg))) new players[32] new i [32] get_players(players, num) for(i=0;i<num;i++) if (players[i]!=player) { get_user_team(players[i] ,arg, 31) if (arg[0]!='S') cs_set_user_team (players[i], CS_TEAM_CT) }else{ cs_set_user_team(player,CS_TEAM_T,CS_T_GUERILLA) old_mp_autoteambalance =get_cvar_num("mp_autoteambalance") old_mp_roundtime =get_cvar_float("mp_roundtime") old_mp_buytime =get_cvar_float("mp_buytime") old_mp_startmoney =get_cvar_num("mp_startmoney") old_mp_freezetime =get_cvar_num("mp_freezetime") set_cvar_num("mp_autoteambalance",0) set_cvar_num("mp_roundtime",9) set_cvar_num("mp_startmoney",16000) set_cvar_num("sv_restart",1) set_cvar_float("mp_buytime",0.2) set_cvar_num("mp_freezetime",12) set_task(13.0,"MakeBoss2") } } return PLUGIN_HANDLED }
public MakeBoss2() { if (is_user_connected(player)) { set_user_health(player, bossPower) set_user_armor(player, 100) set_user_rendering(player,kRenderFxGlowShell,255,67,12,kRenderNormal,99) strip_user_weapons(player) give_item(player,"weapon_knife") give_item(player,"weapon_hegrenade") give_item(player,"weapon_m249") new i for(i=0;i<7;i++)give_item(player,"ammo_556natobox") }else{ Unmakeboss() set_hudmessage(241, 100, 87, 1.0, 0.35, 1) show_hudmessage(0, "*DEFEAT THE BOSS*") } return PLUGIN_HANDLED }
Error Message:
Code:
Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
/home/groups/amxmodx/tmp3/textNilJr0.sma(19) : error 010: invalid function or declaration
/home/groups/amxmodx/tmp3/textNilJr0.sma(71) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/textNilJr0.sma(72) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/textNilJr0.sma(103) : error 017: undefined symbol "num"
/home/groups/amxmodx/tmp3/textNilJr0.sma(103 -- 104) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/textNilJr0.sma(104) : error 033: array must be indexed (variable "i")
/home/groups/amxmodx/tmp3/textNilJr0.sma(104) : fatal error 107: too many error messages on one line
Compilation aborted.
5 Errors.
|
|