|
Junior Member
|

05-14-2012
, 21:47
I Need some help with edited bio hazzard
|
#1
|
hello ! i tried to edit the 1.93 sma of biohazzard ( http://forums.alliedmods.net/showthr...zzard#previous)
here :
PHP Code:
#define VERSION "1.93"
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <cstrike> #include <hamsandwich> #include <xs>
#define MAX_SPAWNS 128
#define OFFSET_DEATH 444 #define OFFSET_TEAM 114 #define OFFSET_PRIMARYWEAPON 116
#define TASKID_STRIPNGIVE 698 #define TASKID_STARTROUND 153 #define TASKID_NEWROUND 641 #define TASKID_BALANCETEAM 375 #define TASKID_UPDATESCR 264 #define TASKID_SETZOMBIE 635 #define TASKID_SPAWNDELAY 786
#define cs_get_user_team(%1) CsTeams:get_pdata_int(%1, OFFSET_TEAM) #define cs_get_user_deaths(%1) get_pdata_int(%1, OFFSET_DEATH) #define reset_user_primary(%1) set_pdata_int(%1, OFFSET_PRIMARYWEAPON, 0) #define set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, EXTRAOFFSET_WEAPONS) #define set_user_deaths(%1,%2) set_pdata_int(%1, OFFSET_DEATH, %2) #define is_player_alive(%1) ((1 <= %1 <= g_maxplayers) && is_user_alive(%1)) #define _random(%1) random_num(0, %1 - 1)
new cvar_regen_dly1, cvar_regen_dly2, cvar_randomspawn, cvar_zombie_spd, cvar_skyname, cvar_autobalance[2], cvar_starttime, cvar_lights, cvar_zombie_def, cvar_zombie_hp, cvar_blocknightvision, cvar_killbonus, cvar_gamedescription, cvar_enabled, cvar_autonvg, cvar_maxzombies, cvar_customsounds, cvar_hpbonus, cvar_knockback_hp, cvar_flashbang, cvar_weaponsmenu, cvar_zombie_atk, cvar_knockback_duck, cvar_hedmg_multi, cvar_zombie_regen, cvar_zombie_resist, cvar_buytime, cvar_ammo, cvar_zombie_instant, cvar_winsounds, cvar_botquota new bool:g_brestorevel, Float:g_vecvel[3], bool:g_roundstarted, g_maxplayers, g_spawncount, bool:g_infecting, bool:g_gamestarted, Float:g_spawns[MAX_SPAWNS+1][9], g_zombieoftheround, g_fwd_spawn, bool:g_usingknifemodel, bool:g_usingplayermodel, g_equipmenu, g_primmenu, g_secmenu, g_fwd_result, g_fwd_infect, g_fwd_teamwin, g_fwd_gamestart, g_fwd_infect2, CsTeams:g_winningteam, g_radiofix, bool:g_czero, g_netclient_pdata, g_botclient_pdata, g_buyzone, Float:g_buytime
new bool:g_zombie[33], Float:g_regendelay[33], g_victim[33], bool:g_showmenu[33], g_weapons[33][2], bool:g_falling[33], g_lastteam[33], g_modelent[33], g_weaponent[33]
public cmd_infectuser(id, level, cid) { if(!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED_MAIN static arg1[32], target read_argv(1, arg1, 31) target = cmd_target(id, arg1, 0) if(!is_user_alive(target)) { console_print(id, "%L", id, "CMD_INVALIDUSER") return PLUGIN_HANDLED_MAIN } if(!allow_infection()) { console_print(id, "%L", id, "CMD_MAXZOMBIES") return PLUGIN_HANDLED_MAIN } if(!g_gamestarted) { console_print(id, "%L", id, "CMD_NOTSTARTED") return PLUGIN_HANDLED_MAIN } if(!g_zombie[target]) { infect_user(target) static name[32]; get_user_name(target, name, 31) console_print(id, "%L", id, "CMD_INFECTED", name) } return PLUGIN_HANDLED_MAIN }
public msg_teaminfo(msgid, dest, id) { id = get_msg_arg_int(1) if(is_user_alive(id) || !g_gamestarted) return PLUGIN_CONTINUE
if(g_lastteam[id] == -1) return PLUGIN_CONTINUE static team[4]; get_msg_arg_string(2, team, 3) if(team[0] != 'U' || team[1] != 'N' || team[2] != 'A') return PLUGIN_CONTINUE
id = randomly_pick_zombie() if(id) { if(!g_zombie[id]) { infect_user(id) static name[32] get_user_name(id, name, 31)
set_hudmessage(_, _, _, _, _, 1) show_hudmessage(0, "%L", LANG_PLAYER, "INFECTED_HUD", name) } else { cs_set_user_team2(id, CS_TEAM_CT) set_pev(id, pev_deadflag, DEAD_DISCARDBODY) } return PLUGIN_HANDLED } return PLUGIN_CONTINUE }
public msg_screenfade(msgid, dest, id) { if(!get_pcvar_num(cvar_flashbang) || !is_user_connected(id)) return PLUGIN_CONTINUE if(!g_zombie[id] ||!is_user_alive(id)) { static data[4] data[0] = get_msg_arg_int(4); data[1] = get_msg_arg_int(5) data[2] = get_msg_arg_int(6); data[3] = get_msg_arg_int(7) if(data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199) return PLUGIN_HANDLED } return PLUGIN_CONTINUE }
public logevent_round_end() { g_gamestarted = false, g_roundstarted = false remove_task(TASKID_BALANCETEAM), remove_task(TASKID_STARTROUND) set_task(1.5, "task_balanceteam", TASKID_BALANCETEAM) if(g_winningteam > CS_TEAM_UNASSIGNED) { ExecuteForward(g_fwd_teamwin, g_fwd_result, g_winningteam) g_winningteam = CS_TEAM_UNASSIGNED } }
public event_textmsg() { static seconds[5]; read_data(3, seconds, 4) static Float:tasktime; tasktime = float(str_to_num(seconds)) - 0.5 remove_task(TASKID_BALANCETEAM), set_task(tasktime, "task_balanceteam", TASKID_BALANCETEAM) }
public event_newround() { static buytime; buytime = get_pcvar_num(cvar_buytime) if(buytime) g_buytime = buytime + get_gametime() g_gamestarted = false, g_roundstarted = false remove_task(TASKID_NEWROUND), remove_task(TASKID_STARTROUND) set_task(0.1, "task_newround", TASKID_NEWROUND) set_task(get_pcvar_float(cvar_starttime), "task_startround", TASKID_STARTROUND) }
public event_damage(victim) { if(!is_user_alive(victim) || !g_gamestarted) return PLUGIN_CONTINUE if(g_zombie[victim]) { g_regendelay[victim] = get_gametime() + get_pcvar_float(cvar_regen_dly1) return PLUGIN_CONTINUE } static attacker; attacker = get_user_attacker(victim) if(!is_user_alive(attacker) || !g_zombie[attacker] || g_infecting) return PLUGIN_CONTINUE g_infecting = true if(g_victim[attacker] == victim) { static Float:frags; pev(attacker, pev_frags, frags) static deaths; deaths = cs_get_user_deaths(victim) set_pev(attacker, pev_frags, frags + 1.0) set_user_deaths(victim, deaths + 1) static _msg_deathmsg if(!_msg_deathmsg) _msg_deathmsg = get_user_msgid("DeathMsg") message_begin(MSG_ALL, _msg_deathmsg) write_byte(attacker) write_byte(victim) write_byte(0) write_string("infection") message_end() infect_user(victim) ExecuteForward(g_fwd_infect, g_fwd_result, attacker, victim)
static params[2]; params[0] = attacker, params[1] = victim set_task(0.2, "task_updatescore", TASKID_UPDATESCR, params, 2) g_victim[attacker] = 0 } g_infecting = false return PLUGIN_CONTINUE }
public fwd_playerprethink(id) { if(!is_user_alive(id)) return FMRES_IGNORED static flag; flag = pev(id, pev_flags) if(get_pcvar_num(cvar_zombie_resist)) { if(flag & FL_ONGROUND) { pev(id, pev_velocity, g_vecvel) g_brestorevel = true } }
if(g_zombie[id]) { if(!(flag & FL_ONGROUND)) { static Float:fallvelocity; pev(id, pev_flFallVelocity, fallvelocity) g_falling[id] = fallvelocity >= 350.0 ? true : false } if(get_pcvar_num(cvar_zombie_regen)) { static Float:health; pev(id, pev_health, health) static Float:zombiehp; zombiehp = float(get_pcvar_num(cvar_zombie_hp)) if(health < zombiehp) { static Float:gametime; gametime = get_gametime() if(g_regendelay[id] < gametime) { set_pev(id, pev_health, health + 1.0) g_regendelay[id] = gametime + get_pcvar_float(cvar_regen_dly2) } } } static ent; ent = g_modelent[id] if(pev_valid(ent)) { if(!(pev(ent, pev_effects) & EF_NODRAW)) { if(pev(id, pev_rendermode) != kRenderTransTexture) set_pev(id, pev_rendermode, kRenderTransTexture) if(pev(id, pev_renderamt) != 0.0) set_pev(id, pev_renderamt, 0.0) } } } return FMRES_IGNORED }
public fwd_playerprethink_post(id) { if(!g_brestorevel) return FMRES_IGNORED
g_brestorevel = false static flag; flag = pev(id, pev_flags) if(!(flag & FL_ONTRAIN)) { static ent; ent = pev(id, pev_groundentity) if(pev_valid(ent) && (flag & FL_CONVEYOR)) { static Float:vectemp[3] pev(id, pev_basevelocity, vectemp) xs_vec_add(g_vecvel, vectemp, g_vecvel) } if(g_zombie[id]) { static Float:health; pev(id, pev_health, health) static Float:kbhp; kbhp = float(get_pcvar_num(cvar_knockback_hp)) if(get_pcvar_num(cvar_knockback_duck)) { if(pev(id, pev_flags) & FL_DUCKING) set_pev(id, pev_velocity, g_vecvel) else if(health > kbhp) set_pev(id, pev_velocity, g_vecvel) } else if(health > kbhp) set_pev(id, pev_velocity, g_vecvel) } return FMRES_HANDLED } return FMRES_IGNORED }
public fwd_playerpostthink(id) { if(!is_user_alive(id)) return FMRES_IGNORED if(g_falling[id] && pev(id, pev_flags) & FL_ONGROUND) set_pev(id, pev_watertype, CONTENTS_WATER), g_falling[id] = false if(get_pcvar_num(cvar_buytime)) { if(g_buytime > get_gametime() && pev_valid(g_buyzone) && !g_zombie[id]) dllfunc(DLLFunc_Touch, g_buyzone, id) } return FMRES_IGNORED }
public fwd_spawn(ent) { if(!pev_valid(ent)) return FMRES_IGNORED static objective_ents[][] = { "func_bomb_target", "info_bomb_target", "hostage_entity", "monster_scientist", "func_hostage_rescue", "info_hostage_rescue", "info_vip_start", "func_vip_safetyzone", "func_escapezone" }
static classname[32], i pev(ent, pev_classname, classname, 31) if(equal(classname, "func_buyzone")) { set_pev(ent, pev_solid, SOLID_NOT) return FMRES_SUPERCEDE } for(i = 0; i < sizeof objective_ents; ++i) { if(equal(classname, objective_ents[i])) { engfunc(EngFunc_RemoveEntity, ent) return FMRES_SUPERCEDE } } return FMRES_IGNORED }
public fwd_gamedescription() { static gamename[32] get_pcvar_string(cvar_gamedescription, gamename, 31) forward_return(FMV_STRING, gamename) return FMRES_SUPERCEDE }
public fwd_traceline_post(Float:start[3], Float:end[3], nomonsters, id, trace) { if(!is_player_alive(id) || g_gamestarted) return FMRES_IGNORED static target; target = get_tr2(trace, TR_pHit) if(is_player_alive(target)) set_tr2(trace, TR_flFraction, 1.0)
return FMRES_IGNORED }
public fwd_tracehull_post(Float:start[3], Float:end[3], nomonsters, hull, id, trace) { if(!is_player_alive(id) || g_gamestarted) return FMRES_IGNORED
static target; target = get_tr2(trace, TR_pHit) if(is_player_alive(target)) set_tr2(trace, TR_flFraction, 1.0) return FMRES_IGNORED }
public fwd_createnamedentity(entclassname) { static classname[10]; engfunc(EngFunc_SzFromIndex, entclassname, classname, 9) return (classname[7] == 'c' && classname[8] == '4') ? FMRES_SUPERCEDE : FMRES_IGNORED }
public bacon_use(ent, caller, activator, use_type, Float:value) return (use_type == 2 && is_player_alive(caller) && g_zombie[caller]) ? HAM_SUPERCEDE : HAM_IGNORED
public bacon_touch_weapon(ent, id) return (is_player_alive(id) && g_zombie[id]) ? HAM_SUPERCEDE : HAM_IGNORED
public task_spawned(taskid) { static id; id = taskid - TASKID_SPAWNDELAY if(is_user_alive(id)) { if(pev(id, pev_body)) set_pev(id, pev_body, 0) if(g_gamestarted) { static CsTeams:team; team = cs_get_user_team(id) if(team == CS_TEAM_T) cs_set_user_team2(id, CS_TEAM_CT) } if(get_pcvar_num(cvar_weaponsmenu) && g_roundstarted && g_showmenu[id]) menu_display(id, g_equipmenu, 0) } }
public task_lights() { static light[2] get_pcvar_string(cvar_lights, light, 1) engfunc(EngFunc_LightStyle, 0, light) }
public task_updatescore(params[]) { if(!g_gamestarted) return static attacker; attacker = params[0] static victim; victim = params[1] if(!is_user_connected(attacker)) return static frags, deaths, team frags = get_user_frags(attacker) deaths = cs_get_user_deaths(attacker) team = get_user_team(attacker) static msg_scoreinfo if(!msg_scoreinfo) msg_scoreinfo = get_user_msgid("ScoreInfo") message_begin(MSG_ALL, msg_scoreinfo) write_byte(attacker) write_short(frags) write_short(deaths) write_short(0) write_short(team) message_end() if(!is_user_connected(victim)) return frags = get_user_frags(victim) deaths = cs_get_user_deaths(victim) team = get_user_team(victim) message_begin(MSG_ALL, msg_scoreinfo) write_byte(victim) write_short(frags) write_short(deaths) write_short(0) write_short(team) message_end() }
public task_stripngive(taskid) { static id; id = taskid - TASKID_STRIPNGIVE if(is_user_alive(id)) { fm_strip_user_weapons(id), reset_user_primary(id) bacon_give_weapon(id, "weapon_knife") } }
public task_newround() { static players[32], num, i, id, newzombie get_players(players, num, "a")
newzombie = players[_random(num)] if(num > 2 && is_user_connected(g_zombieoftheround)) { while(g_zombieoftheround == newzombie) newzombie = players[_random(num)] } g_zombieoftheround = newzombie
for(i = 0; i < num; i++) { id = players[i] client_print(id, print_chat, "%L %L", id, "SCAN_RESULTS", id, g_zombieoftheround == id ? "SCAN_INFECTED" : "SCAN_CLEAN") } if(get_pcvar_num(cvar_randomspawn)) randomly_place_everyone() }
public task_startround() { static players[32], num, i, id, newzombie get_players(players, num, "a") if(num > 2 && !is_user_alive(g_zombieoftheround)) { newzombie = players[_random(num)] while(g_zombieoftheround == newzombie) newzombie = players[_random(num)] g_zombieoftheround = newzombie } if(!g_zombieoftheround) return for(i = 0; i < num; i++) { id = players[i] id == g_zombieoftheround ? infect_user(id) : cs_set_user_team2(id, CS_TEAM_CT) } static name[32] get_user_name(g_zombieoftheround, name, 31)
set_hudmessage(_, _, _, _, _, 1) show_hudmessage(0, "%L", LANG_PLAYER, "INFECTED_HUD", name) client_print(0, print_chat, "%L", LANG_PLAYER, "INFECTED_TXT", name) g_gamestarted = true, ExecuteForward(g_fwd_gamestart, g_fwd_result) }
public task_balanceteam() { static players[CsTeams:3][32], count[CsTeams:3], i, id, CsTeams:team get_players(players[CS_TEAM_UNASSIGNED], count[CS_TEAM_UNASSIGNED]) count[CS_TEAM_T] = 0, count[CS_TEAM_CT] = 0 for(i = 0; i < count[CS_TEAM_UNASSIGNED]; i++) { id = players[CS_TEAM_UNASSIGNED][i], team = cs_get_user_team(id) if(team == CS_TEAM_T || team == CS_TEAM_CT) players[team][count[team]++] = id }
if(abs(count[CS_TEAM_T] - count[CS_TEAM_CT]) <= 1) return
static maxplayers; maxplayers = (count[CS_TEAM_T] + count[CS_TEAM_CT]) / 2 if(count[CS_TEAM_T] > maxplayers) { for(i = 0; i < (count[CS_TEAM_T] - maxplayers); i++) cs_set_user_team(players[CS_TEAM_T][i], CS_TEAM_CT) } else { for(i = 0; i < (count[CS_TEAM_CT] - maxplayers); i++) cs_set_user_team(players[CS_TEAM_CT][i], CS_TEAM_T) } }
public infect_user(id) { if(!is_user_alive(id)) return
static _msg_scoreattrib if(!_msg_scoreattrib) _msg_scoreattrib = get_user_msgid("ScoreAttrib") message_begin(MSG_ALL, _msg_scoreattrib) write_byte(id) write_byte(0) message_end() menu_cancel(id), cs_set_user_team2(id, CS_TEAM_T) set_task(0.1, "task_setzombie", TASKID_SETZOMBIE + id) }
public randomly_place_everyone() { if(g_spawncount <= 0) return static players[32], num, id, i, CsTeams:team get_players(players, num, "a")
for(i = 0; i < num; i++) { id = players[i] team = cs_get_user_team(id) if(team != CS_TEAM_T && team != CS_TEAM_CT || pev(id, pev_iuser1)) continue static spawn_index spawn_index = _random(g_spawncount) static Float:spawndata[3] spawndata[0] = g_spawns[spawn_index][0] spawndata[1] = g_spawns[spawn_index][1] spawndata[2] = g_spawns[spawn_index][2] if(!fm_is_hull_vacant(spawndata, HULL_HUMAN)) { static i for(i = spawn_index + 1; i != spawn_index; i++) { if(i >= g_spawncount) i = 0
spawndata[0] = g_spawns[i][0] spawndata[1] = g_spawns[i][1] spawndata[2] = g_spawns[i][2]
if(fm_is_hull_vacant(spawndata, HULL_HUMAN)) { spawn_index = i break } } }
spawndata[0] = g_spawns[spawn_index][0] spawndata[1] = g_spawns[spawn_index][1] spawndata[2] = g_spawns[spawn_index][2] engfunc(EngFunc_SetOrigin, id, spawndata)
spawndata[0] = g_spawns[spawn_index][3] spawndata[1] = g_spawns[spawn_index][4] spawndata[2] = g_spawns[spawn_index][5] set_pev(id, pev_angles, spawndata)
spawndata[0] = g_spawns[spawn_index][6] spawndata[1] = g_spawns[spawn_index][7] spawndata[2] = g_spawns[spawn_index][8] set_pev(id, pev_v_angle, spawndata)
set_pev(id, pev_fixangle, 1) } }
public get_spawnpoints() { static configdir[32]; get_configsdir(configdir, 31) static mapname[32]; get_mapname(mapname, 31) static csdmfile[64], line[64], data[10][6] formatex(csdmfile, 63, "%s/csdm/%s.spawns.cfg", configdir, mapname)
if(file_exists(csdmfile)) { static file; file = fopen(csdmfile, "rt") while(file && !feof(file)) { fgets(file, line, 63) if(!line[0] || str_count(line,' ') < 2) continue
parse(line, data[0], 5, data[1], 5, data[2], 5, data[3], 5, data[4], 5, data[5], 5, data[6], 5, data[7], 5, data[8], 5, data[9], 5)
g_spawns[g_spawncount][0] = floatstr(data[0]), g_spawns[g_spawncount][1] = floatstr(data[1]) g_spawns[g_spawncount][2] = floatstr(data[2]), g_spawns[g_spawncount][3] = floatstr(data[3]) g_spawns[g_spawncount][4] = floatstr(data[4]), g_spawns[g_spawncount][5] = floatstr(data[5]) g_spawns[g_spawncount][6] = floatstr(data[7]), g_spawns[g_spawncount][7] = floatstr(data[8]) g_spawns[g_spawncount][8] = floatstr(data[9]) if(g_spawncount++ >= MAX_SPAWNS) break } if(file) fclose(file) } }
public native_is_user_zombie(plugin, params) { if(params != 1) return 0 static index; index = get_param(1) if(!index) return 0 return g_zombie[index] == true ? 1 : 0 }
public native_infect_user(plugin, params) { if(params != 1) return 0 static index; index = get_param(1) if(is_user_alive(index) && allow_infection() && g_gamestarted) { infect_user(index) return 1 } return 0 }
public native_is_user_firstzombie(plugin, params) { if(params != 1) return 0 static index; index = get_param(1) return index == g_zombieoftheround ? 1 : 0 }
public native_first_zombie(plugin) return g_zombieoftheround
public native_game_started(plugin) return g_gamestarted
stock bool:fm_is_hull_vacant(const Float:origin[3], hull) { static tr; tr = 0; engfunc(EngFunc_TraceHull, origin, origin, 0, hull, 0, tr) return (!get_tr2(tr, TR_StartSolid) && !get_tr2(tr, TR_AllSolid) && get_tr2(tr, TR_InOpen)) ? true : false }
stock fm_set_kvd(entity, const key[], const value[], const classname[] = "") { set_kvd(0, KV_ClassName, classname), set_kvd(0, KV_KeyName, key) set_kvd(0, KV_Value, value), set_kvd(0, KV_fHandled, 0)
return dllfunc(DLLFunc_KeyValue, entity, 0) }
stock fm_strip_user_weapons(index) { static stripent if(!pev_valid(stripent)) { stripent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip")) dllfunc(DLLFunc_Spawn, stripent) set_pev(stripent, pev_solid, SOLID_NOT) } dllfunc(DLLFunc_Use, stripent, index) return 1 }
stock fm_set_entity_visibility(index, visible = 1) set_pev(index, pev_effects, visible == 1 ? pev(index, pev_effects) & ~EF_NODRAW : pev(index, pev_effects) | EF_NODRAW)
stock fm_find_ent_by_owner(index, const classname[], owner) { static ent; ent = index while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", classname)) && pev(ent, pev_owner) != owner) {} return ent }
stock bacon_give_weapon(index, weapon[]) { if(!equal(weapon,"weapon_", 7)) return 0
static ent; ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, weapon)) if(!pev_valid(ent)) return 0 set_pev(ent, pev_spawnflags, SF_NORESPAWN) dllfunc(DLLFunc_Spawn, ent) if(!ExecuteHamB(Ham_AddPlayerItem, index, ent)) { if(pev_valid(ent)) set_pev(ent, pev_flags, pev(ent, pev_flags) | FL_KILLME) return 0 } ExecuteHamB(Ham_Item_AttachToPlayer, ent, index)
return 1 }
stock cs_set_user_team2(index, {CsTeams,_}:team, update = 1) { set_pdata_int(index, OFFSET_TEAM, _:team) set_pev(index, pev_team, _:team)
if(update) { static _msg_teaminfo; if(!_msg_teaminfo) _msg_teaminfo = get_user_msgid("TeamInfo") static teaminfo[][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" } message_begin(MSG_ALL, _msg_teaminfo) write_byte(index) write_string(teaminfo[_:team]) message_end() } return 1 }
stock str_count(str[], searchchar) { static maxlen; maxlen = strlen(str) static i, count; count = 0 for(i = 0; i <= maxlen; i++) if(str[i] == searchchar) count++
return count }
stock reset_user_model(index) { set_pev(index, pev_rendermode, kRenderNormal) set_pev(index, pev_renderamt, 0.0)
if(pev_valid(g_modelent[index])) { fm_set_entity_visibility(g_modelent[index], 0) set_pev(g_modelent[index], pev_movetype, MOVETYPE_NONE) set_pev(g_modelent[index], pev_aiment, 0) } }
stock randomly_pick_zombie() { static index, players[2][32], data[4] data[0] = 0, data[1] = 0, data[2] = 0, data[3] = 0 for(index = 1; index <= g_maxplayers; index++) { if(!is_user_alive(index)) continue if(g_zombie[index]) data[0]++, players[0][data[2]++] = index else data[1]++, players[1][data[3]++] = index } if(data[0] > 1 && data[1] < 1) return players[0][_random(data[2])] return (data[0] < 1 && data[1] > 1) ? players[1][_random(data[3])] : 0 }
and when i compiled i get this
Code:
//// zombie.sma
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(61) : error 017
: undefined symbol "allow_infection"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(684) : error 01
7: undefined symbol "allow_infection"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_ammo"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_autobalance"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_autonvg"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_blocknightvision"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_botquota"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_customsounds"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_enabled"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_hedmg_multi"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_hpbonus"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_killbonus"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_maxzombies"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_skyname"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_winsounds"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_zombie_atk"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_zombie_def"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_zombie_instant"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "cvar_zombie_spd"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(83 : warning
203: symbol is never used: "g_botclient_pdata"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_czero"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_fwd_infect2"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_fwd_spawn"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_netclient_pdata"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_primmenu"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ): warning
203: symbol is never used: "g_radiofix"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_secmenu"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_usingknifemodel"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_usingplayermodel"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ) : warning
203: symbol is never used: "g_weaponent"
// C:\Users\Jonathan\Desktop\addons\amxmodx\scripting\zombie.sma(838 ): warning
203: symbol is never used: "g_weapons"
//
// 2 Errors.
// Could not locate output file compiled\zombie.amx (compile failed).
//
// Compilation Time: 0,36 sec
// ----------------------------------------
Press enter to exit ...
please what i need to do?? im trying to remove zombie models , weapons for cts , menus etc...
Last edited by Exolent[jNr]; 05-15-2012 at 16:27.
Reason: Added [php] and [code] tags.
|
|