Raised This Month: $ Target: $400
 0% 

Light flicker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThomasNguyen
Senior Member
Join Date: May 2006
Old 06-29-2006 , 20:10   Re: Light flicker
Reply With Quote #1

Quote:
Originally Posted by ThomasNguyen
Can someone tell me how to make the lights flicker like zombie mod. because i play cz and i took the zbot .sma and me and a friend fixed the errors so it would work and changed some of the code. We called it AlienSwarm and changed the models to the monster models from half-life. Anyways, I leave the darkness set on set_lights("b") but i want it on A with lights flickering. I was looking at hawks new zombie mod code but i couldnt find out where the flicker part was. if anyone can fix/edit this code for me to make lights flicker, it would be much appreciated.

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine> 
#include <fun>

public plugin_init() {
	register_plugin("Alien Swarm", "1.0", "Mini_midget//Thomas")
	register_dictionary("AlienSwarm.txt")
	
	register_cvar("amx_aswarm" , "1")
	register_cvar("amx_aswarm_hp" , "450")
	register_cvar("amx_aswarm_ap" , "300")
	register_cvar("amx_aswarm_speed" , "550.0")
	register_cvar("amx_aswarm_steps" , "1")
	register_cvar("amx_aswarm_backspeed" , "175.0")
	register_cvar("amx_aswarm_sidespeed" , "175.0")
	register_cvar("amx_aswarm_msg" , "1")
	
	register_concmd("amx_aswarm_dark", "admin_dark", ADMIN_KICK, " ")
	
	register_event("CurWeapon","ctspeed","be","1=1") 
	register_event("WeapPickup", "WeaponPickedUp", "be", "1!29")
	
	register_logevent("round_start",2,"0=World triggered","1=Round_Start")
}

public plugin_precache() {
	precache_model("models/player/alien3/islaveT.mdl")
}

public client_putinserver() {
	if (get_playersnum() == 1) {
		set_cvar_num("mp_buytime", 10)
		set_cvar_num("mp_roundtime", 4)
		set_cvar_num("sv_restartround", 10)
		set_cvar_num("sv_maxspeed", get_cvar_num("amx_aswarm_speed"))
	}
}

public client_connect(id){  
	new newName[33]  
	get_user_info(id,"name",newName,32)  
	
	if(is_user_bot(id) && containi(newName,"-[A]lien[S]warm |") == -1)  
		{  
		format(newName,32,"-[A]lien[S]warm | %s",newName)  
		set_user_info(id,"name",newName)     
	}  
}  

public round_start() {
	set_task(0.1,"BotNumber")
	set_task(0.3,"TeamCheck")
	set_task(0.6,"TeamSet")
	set_task(1.0,"MakeBots")
	set_task(2.5,"StartMsg")
	set_task(3.0,"SetKnife")
}

public BotNumber() {
	new player_num, bot_num, rplayer_num
	player_num = get_playersnum()
	bot_num = get_cvar_num("bot_quota")
	rplayer_num = player_num - bot_num
	
	if (rplayer_num > 0 && rplayer_num < 3) {
		set_cvar_num("bot_quota", 2)
	}
	if (rplayer_num > 2 && rplayer_num < 5) {
		set_cvar_num("bot_quota", 4)
	}
	if (rplayer_num > 4 && rplayer_num < 7) {
		set_cvar_num("bot_quota", 6)
	}
	if (rplayer_num > 6 && rplayer_num < 9) {
		set_cvar_num("bot_quota", 8)
	}
	if (rplayer_num > 8 && rplayer_num < 11) {
		set_cvar_num("bot_quota", 10)
	}
	if (rplayer_num > 10 && rplayer_num < 13) {
		set_cvar_num("bot_quota", 12)
	}
	if (rplayer_num > 12 && rplayer_num < 15) {
		set_cvar_num("bot_quota", 14)
	}
	if (rplayer_num > 14 && rplayer_num < 17) {
		set_cvar_num("bot_quota", 16)
	}
	return PLUGIN_CONTINUE
}

public MakeBots(players[]) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	new players[32],num,i,id,CsArmorType:ArmorType = CS_ARMOR_VESTHELM
	get_players(players,num) 
	for(i = 0; i <= num; i++) {
		id = players[i]
		if (is_user_alive(id) && is_user_bot(id)) {
			set_user_maxspeed(id,float(get_cvar_num("amx_aswarm_speed")))
			set_user_health(id,get_cvar_num("amx_aswarm_hp"))
			set_user_footsteps(id,get_cvar_num("amx_aswarm_steps"))
			cs_set_user_armor(id,get_cvar_num("amx_aswarm_ap"),ArmorType)
			cs_set_user_model(id,"islave")
		}
	}
	return PLUGIN_CONTINUE
}  

public TeamSet(players[]) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	new players[32],num,i,id
	get_players(players,num) 
	for(i = 0; i < num; i++) {
		id = players[i]
		if (is_user_bot(id) && is_user_alive(id)) {
			cs_set_user_team(id,CS_TEAM_T)
			cs_set_user_model(id,"islave")
			} else {
			if (is_user_alive(id)) {
				cs_set_user_team(id,CS_TEAM_CT)
			}
		}
	}
	return PLUGIN_CONTINUE
}

public TeamCheck(players[]) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	new players[32],num,i,id
	get_players(players,num) 
	for(i = 0; i < num; i++) {
		id = players[i]
		if (is_user_alive(id)) {
			if (is_user_bot(id) && cs_get_user_team(id) == CS_TEAM_CT) {
				set_cvar_num("sv_restartround", 1)
			}
		}
	}
	return PLUGIN_CONTINUE
}

public StartMsg() {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	client_print(0,print_chat,"%L",LANG_PLAYER,"ALIENSWARM_HEALTHMSG",get_cvar_num("amx_aswarm_hp"))
	client_print(0,print_chat,"%L",LANG_PLAYER,"ALIENSWARM_ARMOURMSG",get_cvar_num("amx_aswarm_ap"))
	client_print(0,print_chat,"%L",LANG_PLAYER,"ALIENSWARM_SPEEDMSG",get_cvar_num("amx_aswarm_speed"))
	client_print(0,print_chat,"%L",LANG_PLAYER,"ALIENSWARM_NUMBER",get_cvar_num("bot_quota"))
	client_print(0,print_chat,"%L",LANG_PLAYER,"ALIENSWARM_MSG",get_cvar_num("amx_aswarm_msg"))
	return PLUGIN_CONTINUE
}

public SetKnife(index) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	new players[32],num,i
	get_players(players,num) 
	for(i = 0; i <= num; i++) {
		new id = players[i]
		if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T) {
			strip_user_weapons(id)
			give_item(id,"weapon_knife")
		}
	}
	return PLUGIN_HANDLED
}

public ctspeed(id) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	new CsTeams:team = cs_get_user_team(id)
	if (is_user_alive(id) && team == CS_TEAM_CT) {
		client_cmd(id, "cl_backspeed %d" , get_cvar_num("amx_aswarm_backspeed"))
		client_cmd(id, "cl_sidespeed %d" , get_cvar_num("amx_aswarm_sidespeed"))
	}
	return PLUGIN_CONTINUE
} 

public RemovePickedWeapon(id) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	if (is_user_alive(id) && get_user_team(id) == 1) {
		strip_user_weapons(id)
		give_item(id, "weapon_knife")
	}
	return PLUGIN_HANDLED
} 

public WeaponPickedUp(id) {
	set_task(0.1, "RemovePickedWeapon", id)
}

public client_death(killer,victim) {
	if( get_cvar_num("amx_aswarm") != 1 ) {
		return PLUGIN_HANDLED
	}
	new victimname[32]
	get_user_name(victim,victimname,31)
	if (cs_get_user_team(killer) == CS_TEAM_T) {		
		set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 4.0)
		show_hudmessage(0,"%L",LANG_PLAYER,"ALIENSWARM_ALIENKILL",victimname)
	}
	return PLUGIN_CONTINUE
}

public admin_dark(id, level, cid) {
	if (!cmd_access(id, level, cid, 2))
		{
		return PLUGIN_HANDLED
	}
	
	new arg[32]; 
	read_argv(1,arg,31); 
	if(arg[0] == '1') {	
		set_hudmessage(0, 255, 0, -1.0, 0.2, 0, 6.0, 4.0)
		show_hudmessage(0, "Dark Mode ENABLED")
		set_lights("b")	
	}
	
	else if(arg[0] == '0') {
		set_hudmessage(0, 255, 0, -1.0, 0.2, 0, 6.0, 4.0)
		show_hudmessage(0, "Dark Mode DISABLED")
		set_lights("#OFF")
	}
	return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang5129\\ f0\\ fs16 \n\\ par }
*/


================--------------------------------================
Another thing...
================--------------------------------================

Is there a way to make it so that there are different types on aliens. Like sometimes there would be all normal aliens [islaves] or all aliengrunts[garg] (not using the real agrunt because it floats) and sometimes mixed. the aliengrunts would be stronger than the normal aliens [health, speed, armor]
Any possible way to do this please let me know
__________________
ThomasNguyen is offline
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 06-29-2006 , 20:21   Re: Light flicker
Reply With Quote #2

Lights flicker? Like making a TE_DLIGHT tempentity?
__________________
+karma if I am helpful to you.
I am one in a few million.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
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 08:09.


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