/* AMX Mod script. * * (c) Copyright 2003, Gevurah * * This file is provided as is (no warranties). * * Thanks for some of the code to the creators of: * Gore Plugin * AMX wounded * Admin Fire * Lugwigs Jetpack */ /* * AMX REALMOD V 1.4.1 * * Requires Fun Module and CSStats Module and admin_vote plugin * * Makes mods like CS more "realistic" * Adds bleeding effects like Gore Plugin (removed decals: caused lag on slower machines) * Slows Players down depending on how many times they've been hit in the legs * Decreases health depending on how many times they've been hit (bleeding) * If you are hit by a HE grenade you light on fire * If you stand too close to someone whos on fire, you catch fire * If you are slashed by a knife you bleed a lot * * Bandages can only be bought at the beginning of the round until the buytime * for the server is reached. also, you must be in the buyzone to buy them. * * Same goes for fire extinguishers. * * You may buy as many bandages as you want. A bandage can be used to stop the * bleeding of a single wound. You may use as many as you have bought. If you * die you lose all of your bandages. * * Same rules apply for fire extinguishers. * * If you are on fire you can use a fire extinguisher to put yourself out. * * Console Commands: realmod_buy - buys a bandage. costs $100. * Can be used to stop bleeding * realmod_use - uses a bought bandage. * will stop wound that is * bleeding the most * my_wounds - reports your wounds * realmod_help - brings up realmod info * realmod_menu - opens menu (YAY) * * Admin Commands: amx_realmod : turns Realmod on or off * * Server Commands: set_realmod : turns Realmod on or off * * CVARS: realmod - if set to 1 plugin on, if set to 0 plugin off * realmod_blood - if set to 1 blood effects on, if set to 0 blood effects off * realmod_speed - if set to 0, speed effects off. the higher you set it, the less * your max speed is each time you're hit in the legs * realmod_damage - if set to 0 bleeding does not cause damage. the higher u set * realmod_damage the more damage bleeding does. * realmod_fire - if 1 fire is enabled. if 0 fire is off * realmod_fireothers - if 1 players can be lit on fire by other players if they * they stand too close to a player thats on fire. 0 is off * realmod_knife - if set to 0, knife hits have no effects. the higher you set it * the more damage bleeding from knife wounds does. * realmod_vote - if set to 1, voting enabled. if 0 voting disabled * * say /voterealmod - starts a vote to start Realmod * * contact me with suggestions or bugs */ /************************************************************ * INCLUDES ************************************************************/ #include #include #include #include #include #include /************************************************************ * DEFINES ************************************************************/ #define TE_BLOODSTREAM 101 /************************************************************ * GLOBALS ************************************************************/ new playerbody[32][8] new bool:playerbuy[32] new bandages[32] new Float:speedpercent[32]=100.0 new gmsgDamage new onfire[32] new knifed[32] new leghits[32] new option[2] //vote new extinguisher[32] new exhaust new smoke1 /************************************************************ * CLIENT CONNECT - GOOD ************************************************************/ public client_connect(id) { new i for(i=0;i<8;i++) playerbody[id][i]=0 bandages[id]=0 onfire[id]=0 knifed[id]=0 leghits[id]=0 extinguisher[id]=0 speedpercent[id]=100.0 return PLUGIN_CONTINUE } public client_putinserver(id){ if(!get_cvar_num("realmod")) return PLUGIN_CONTINUE help(id) return PLUGIN_CONTINUE } /************************************************************ * ROUND START/END - GOOD ************************************************************/ public round_start(){ set_task(get_cvar_float("mp_buytime")*60.0,"buy_time_up",51) set_cvar_num("amx_buytimeup",0) return PLUGIN_CONTINUE } public new_round(id){ if(!get_cvar_num("realmod")) return PLUGIN_CONTINUE new i for(i=0;i<8;i++) playerbody[id][i]=0 playerbuy[id]=true speedpercent[id]=100.0 onfire[id]=0 knifed[id]=0 leghits[id]=0 set_user_maxspeed(id,240.0) return PLUGIN_CONTINUE } public round_end(){ remove_task(51) return PLUGIN_CONTINUE } /************************************************************ * BUY ZONE - GOOD ************************************************************/ public buy_zone_func(id){ if(!get_cvar_num("realmod")) return PLUGIN_CONTINUE if(get_cvar_num("amx_buytimeup")) return PLUGIN_CONTINUE if (read_data(1)) playerbuy[id] = true else playerbuy[id] = false return PLUGIN_CONTINUE } public buy_time_up(){ set_cvar_num("amx_buytimeup",1) new plrs[32],nbr,i get_players(plrs,nbr) for(i=0;i") return PLUGIN_CONTINUE } if(equal("on",msg)&&get_cvar_num("realmod")) console_print(id,"Realmod is already enabled") else{ if(equal("off",msg)&&(get_cvar_num("realmod")==0)) console_print(id,"Realmod is already disabled") else{ server_cmd("set_realmod %s",msg) console_print(id,"Realmod has been turned %s",msg) } } return PLUGIN_CONTINUE } public realmod_func(){ new msg[8] read_argv(1,msg,7) set_cvar_num("realmod",equal("on",msg)) realmod_init() client_print(0,print_chat,"* Realmod has been %s",get_cvar_num("realmod") ? "enabled. Type realmod_menu in console for commands." : "disabled") } /************************************************************ * VOTING ************************************************************/ public vote_realmod(id){ if(!get_cvar_num("realmod_vote")) client_print(id,print_chat,"* Voting has been disabled") new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()){ client_print(id,print_chat,"* There is already one voting...") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { client_print(id,print_chat,"* Voting not allowed at this time...") return PLUGIN_HANDLED } new menu_msg[256] format(menu_msg,255,"\yAMX %s Realmod?\w^n^n1. Yes^n2. No",get_cvar_num("realmod") ? "Disable" : "Enable") new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time ) show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(vote_time)) set_task(vote_time,"check_votes") client_print(0,print_chat,"* Voting has started...") option[0]=option[1]=0 return PLUGIN_HANDLED } public vote_count(id,key){ if ( get_cvar_float("amx_vote_answers") ) { new name[32] get_user_name(id,name,31) client_print(0,print_chat,"* %s voted %s", name, key ? "against" : "for" ) } ++option[key] return PLUGIN_HANDLED } public check_votes(id){ if (option[0] > option[1]){ server_cmd("set_realmod %s",get_cvar_num("realmod") ? "off" : "on" ) client_print(0,print_chat,"* Voting successful (yes ^"%d^") (no ^"%d^").",option[0],option[1]) } else{ client_print(0,print_chat,"* Voting failed (yes ^"%d^") (no ^"%d^").",option[0],option[1]) } return PLUGIN_HANDLED } /************************************************************ * SPEED EFFECTS ************************************************************/ public setup_speed(){ if(!get_cvar_num("realmod")) return PLUGIN_CONTINUE if(!get_cvar_num("realmod_speed")) return PLUGIN_CONTINUE new plrs[32],nbr,i get_players(plrs,nbr,"a") for(i=0;i92.4) speedpercent[plrs[i]]+=1.5 else if(speedpercent[plrs[i]]<92.5&&speedpercent[plrs[i]]>80.4) speedpercent[plrs[i]]+=3 else if(speedpercent[plrs[i]]<80.5) speedpercent[plrs[i]]+=3.5 set_user_maxspeed(plrs[i],(240-(leghits[plrs[i]]*get_cvar_num("realmod_speed")))*0.01*speedpercent[plrs[i]]) } return PLUGIN_CONTINUE } public weapon_speed(id){ if(!get_cvar_num("realmod")) return PLUGIN_CONTINUE if(!get_cvar_num("realmod_speed")) return PLUGIN_CONTINUE set_user_maxspeed(id,(240-(leghits[id]*get_cvar_num("realmod_speed")))*0.01*speedpercent[id]) return PLUGIN_CONTINUE } /************************************************************ * BLEEDING DAMAGE ************************************************************/ public setup_head(){ if(!get_cvar_num("realmod")) return PLUGIN_CONTINUE new plrs[32],nbr,i,hits get_players(plrs,nbr,"a") for(i=0;i - uses a bandage or fire extinguisher") //buys a bandage register_concmd("realmod_buy","realmod_buy",0," - buys a bandage or fire extinguisher") //uses a bandage register_concmd("realmod_help","help",0,"- Shows Realmod help") register_concmd("realmod_menu","realmod_menu",0,"- opens the realmod menu") register_concmd("say /voterealmod","vote_realmod",0,"- starts a vote to enable/disable realmod") register_concmd("amx_realmod","realmod_on",ADMIN_CVAR," - turns realmod on and off") register_srvcmd("set_realmod","realmod_func") //set_realmod : turns realmod on and off register_event("ResetHUD","new_round","be") register_event("SendAudio","round_start","b","2=%!MRAD_GO","2=%!MRAD_MOVEOUT","2=%!MRAD_LETSGO","2=%!MRAD_LOCKNLOAD") register_event("StatusIcon","buy_zone_func","be","2=buyzone") register_event("DeathMsg","death","a") register_event("Damage","damage_event","be","2!0","3=0","4!0") register_event("SendAudio","round_end","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") register_event("CurWeapon","weapon_speed","be","1=1") register_cvar("realmod","1",FCVAR_SERVER) //set to one to enable plugin register_cvar("amx_buytimeup","0") register_cvar("realmod_blood","1") //1 on/0 off register_cvar("realmod_damage","1")//higher the more damage bleed does register_cvar("realmod_speed","5") //higher the less your max speed is each time your hit register_cvar("realmod_fireothers","0") //1 on/0 off register_cvar("realmod_fire","0") //1 on/0 off register_cvar("realmod_knife","1") //higher the more damage knife bleed does register_cvar("realmod_vote","1") //if 1 voting for realmod enabled. if 0 disabled gmsgDamage = get_user_msgid("Damage") }