Raised This Month: $ Target: $400
 0% 

Server crashes in Dodgeball Day


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-26-2014 , 09:06   Re: Server crashes in Dodgeball Day
Reply With Quote #2

Im to lazy to find whats crashing your server. But i think i had the same problem as you when i made the dodgeball in my jailbreak daysmenu. But i fixed the problem by debuging the plugin.
If you dont want to debug your plugin here is my dodgeball functions. (remove the snowball, laserdome functions.)

Code:
public grenade_throw(index,greindex,wId) {
	if( wId != CSW_HEGRENADE ) {
		return PLUGIN_CONTINUE;
	}
	if( g_iCurrentDay == DAY_DODGEBALL )
	{
		
		entity_set_edict(greindex,EV_ENT_euser1,index); 
		entity_set_int(greindex,EV_INT_iuser1,0); 
		entity_set_size(greindex,Float:{-6.0,-6.0,-6.0},Float:{6.0,6.0,6.0}); 
		entity_set_float(greindex,EV_FL_friction,0.6);
		
		static r, b;
		r = random(256)
		b = random(256)
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
		write_byte(22); 
		write_short(greindex);
		write_short(beamspr); 
		write_byte(10); 
		write_byte(5); 
		write_byte(r); 
		write_byte(0); 
		write_byte(b); 
		write_byte(192);
		message_end();
		
		set_rendering(greindex,kRenderFxGlowShell,r,0,b);
		
		set_task(3.0,"stop_roll",greindex);
	}
	if( g_iCurrentDay == DAY_SNOWBALL )
	{
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(TE_BEAMFOLLOW);
		write_short(greindex);
		write_short(Snowballsprite);
		write_byte(10);
		write_byte(5);
		write_byte(0);
		write_byte(25);
		write_byte(25);
		write_byte(200);
		message_end();
	}
	return PLUGIN_CONTINUE;
}

public stop_roll(ent) {
	if(is_valid_ent(ent)) {
		
		if(get_entity_flags(ent) & FL_ONGROUND) {
			remove_entity( ent );
		}
		else {
			set_task(3.0,"stop_roll",ent); 
		}
		
	}
}

public SetModel( ent,const model[ ] )
{	
	if( !pev_valid( ent ) || !equal( model,"models/w_hegrenade.mdl" ) ) 
		return FMRES_IGNORED
	
	if( g_iCurrentDay == DAY_DODGEBALL )
	{
		engfunc( EngFunc_SetModel, ent, g_szDodgeball_World )
		return FMRES_IGNORED
	}
	if( g_iCurrentDay == DAY_SNOWBALL )
	{
		engfunc( EngFunc_SetModel, ent, g_szSnowball_World )
		
		static Float:velocity[3];
		set_pev(ent, pev_dmgtime, get_gametime() + 9999.0);
		set_pev(ent, pev_gravity, 0.3);
		pev(ent, pev_velocity, velocity);
		
		velocity[0] *= 1.5;
		velocity[1] *= 1.5;
		velocity[2] *= 1.5;
		
		set_pev(ent, pev_velocity,velocity);
		return FMRES_IGNORED
	}
	
	return FMRES_SUPERCEDE
}

public Think_Grenade(wId)
{	
	if( wId != CSW_HEGRENADE ) 
	{
		if( g_iCurrentDay == DAY_DODGEBALL || g_iCurrentDay == DAY_SNOWBALL )
			return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

public player_interact(ent,id) {
	if(!is_valid_ent(ent)) {
		return PLUGIN_CONTINUE;	
	}
	
	new classname[32], model[32];
	entity_get_string(ent,EV_SZ_classname,classname,31);
	entity_get_string(ent,EV_SZ_model,model,31);
	
	if(equali(classname,"grenade"))
	{
		if( g_iCurrentDay == DAY_DODGEBALL )
		hit_by_ball(id,ent);
	}
	return PLUGIN_CONTINUE;
}

public ball_interact(ball,ent) {
	if( g_iCurrentDay == DAY_DODGEBALL )
	{
		if(ent == 0) {
			entity_set_int(ball,EV_INT_iuser1,1); 
			set_rendering(ball); 
		}
		else {
			new classname[32];
			entity_get_string(ent,EV_SZ_classname,classname,31);
		
			if(equali(classname,"func_",5)) {
				entity_set_int(ball,EV_INT_iuser1,1); 
				set_rendering(ball); 
			
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public hit_by_ball(id,ball) {	
	if(entity_get_int(ball,EV_INT_iuser1) == 1) {
		return;
	}
	
	new owner = entity_get_edict(ball,EV_ENT_euser1);
	
	if(owner == id) {
		entity_set_int(ball,EV_INT_iuser1,1); 
		set_rendering(ball); 
		return;
	}
	
	if(get_user_godmode(id)) {
		entity_set_int(ball,EV_INT_iuser1,1); 
		set_rendering(ball); 
		return;
	}
	
	new Float:origin[3]
	
	set_task(0.1,"kill",id);
	
	new Float:maxs[3], Float:pOrigin[3], headshot;
	entity_get_vector(id,EV_VEC_maxs,maxs);
	entity_get_vector(id,EV_VEC_origin,pOrigin);
	pOrigin[2] += maxs[2]; 
	
	if(vector_distance(origin,pOrigin) <= HS_DIST) {
		headshot = 1;
	}

	set_user_frags(owner, get_user_frags(owner)+1);
	message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
	write_byte(owner);
	write_short(get_user_frags(owner));
	write_short(cs_get_user_deaths(owner));
	write_short(0);
	write_short(get_user_team(owner));
	message_end();
	
	make_deathmsg(owner,id,headshot,"dodgeball");
	entity_set_int(ball,EV_INT_iuser1,1); 
	set_rendering(ball); 
}

public kill(id) {
	strip_user_weapons(id);
	user_silentkill(id);
	message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
	write_byte(id);
	write_short(get_user_frags(id));
	write_short(cs_get_user_deaths(id));
	write_short(0);
	write_short(1);
	message_end();
}

public msg_textmsg() {
	new szMsg[ 32 ]
	get_msg_arg_string( 2, szMsg, charsmax( szMsg ) )
	
	if( equal( szMsg ,"#Game_teammate_attack" ) || equal( szMsg, "#Killed_Teammate" ) )
	{
		return PLUGIN_HANDLED
	}
	if( g_iCurrentDay == DAY_DODGEBALL || g_iCurrentDay == DAY_SNOWBALL) 
	{	
		if(get_msg_args() != 5 || get_msg_argtype(2) != ARG_STRING || get_msg_argtype(5) != ARG_STRING) {
			return PLUGIN_CONTINUE
		}
		new string[32];
		
		get_msg_arg_string(2,string,31);
		if(equali(string,"#Weapon_Cannot_Be_Dropped")) {
			return PLUGIN_HANDLED;
		}
		
		new arg5[20]
		get_msg_arg_string(5, arg5, 19)
		if(equal(arg5, "#Fire_in_the_hole")) {
			return PLUGIN_HANDLED
		}
	}
	return PLUGIN_CONTINUE;
}

public msg_sendaudio() {
	if( g_iCurrentDay == DAY_DODGEBALL || g_iCurrentDay == DAY_SNOWBALL) 
	{
		if(get_msg_args() != 3 || get_msg_argtype(2) != ARG_STRING) {
			return PLUGIN_CONTINUE
		}
		
		new arg2[20]
		get_msg_arg_string(2, arg2, 19)
		if(equal(arg2[1], "!MRAD_FIREINHOLE"))
		{
			return PLUGIN_HANDLED
		}
	}
	return PLUGIN_CONTINUE
}

public EmitSound (id,channel,sample[],Float:volume,Float:atten,flags,pitch) {
	if( g_iCurrentDay == DAY_DODGEBALL )
	{	
		if(containi(sample,"he_bounce") != -1) {
			if(entity_get_float(id,EV_FL_fuser1) + 0.3 < get_gametime()) {
				entity_set_float(id,EV_FL_fuser1,get_gametime()); 
				emit_sound(id,CHAN_ITEM,"weapons/g_bounce1.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM);
			}
			return FMRES_SUPERCEDE;
		}
	}
	if( g_iCurrentDay == DAY_SNOWBALL )
	{	
		if(containi(sample,"he_bounce") != -1) 
		{
			return FMRES_SUPERCEDE;
		}
	}
	
	if(!is_user_alive(id)) 
		return FMRES_IGNORED
	
	if ( cs_get_user_team ( id ) == CS_TEAM_T )
	{	
		new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
		if( g_iCurrentDay == DAY_BOXING )
		{	
			if(weapon == CSW_KNIFE)
			{
				if(equal(sample,"weapons/knife_hit1.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound1, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_hit2.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound2, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_hit3.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound3, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_hit4.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound4, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_stab.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound5, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_hitwall1.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound6, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_slash1.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound7, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
				else if(equal(sample,"weapons/knife_slash2.wav")) 
				{
					emit_sound(id, CHAN_WEAPON, g_szBoxingSound8, 1.0, ATTN_NORM, 0, PITCH_NORM)
					return FMRES_SUPERCEDE
				}
			}
		}
		if( g_iCurrentDay == DAY_LASERDOME )
		{	
			if(weapon == CSW_DEAGLE)
			{
				if(equal(sample,"weapons/dryfire_pistol.wav")) 
				{
					return FMRES_SUPERCEDE
				}
			}
		}
	}
	return FMRES_IGNORED;
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 12-26-2014 at 09:07.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
 



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 15:24.


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