Raised This Month: $ Target: $400
 0% 

CurWeapon and AMMOX problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tolpecek
Member
Join Date: Dec 2018
Old 01-02-2019 , 13:54   CurWeapon and AMMOX problem
Reply With Quote #1

Hello, i have a problem with curweapon and ammox, it crashes server randomly with message
PF_MessageBegin_I: New message started when msg '66' has not been sent yet
PF_MessageBegin_I: New message started when msg '99' has not been sent yet

Code:
register_event("CurWeapon" , "ev_CurWeapon" , "be" , "1=1");
register_event("AmmoX", "ev_AmmoX", "be", "1=1", "1=2", "1=3", "1=4", "1=5", "1=6", "1=7", "1=8", "1=9", "1=10")
Code:
public ev_CurWeapon(id)
{    
	
	if(read_data(2) == CSW_KNIFE)
	{
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			set_pev(id, pev_viewmodel2, KNIFE2)
		} 
	}
	
	if (g_iszombie[id])
	{
		new Float:SPLevel = float(g_unSPLevel[id])
		SPLevel*=5
		set_user_maxspeed(id, 260.0+SPLevel)
	}
	else if (g_item_oma[id])
	{
		static wpnid, clip;
		wpnid = read_data(2);
		clip = read_data(3);
		
		if(wpnid==CSW_C4 || wpnid==CSW_KNIFE || wpnid==CSW_HEGRENADE || wpnid==CSW_SMOKEGRENADE || wpnid==CSW_FLASHBANG )
			return PLUGIN_HANDLED;
		
		if(!clip)
		{
			static weapname[33];
			get_weaponname(wpnid , weapname , 32);
			
			static wpn
			wpn = -1;
			while((wpn = find_ent_by_class(wpn , weapname)) != 0)
			{
				if(id == entity_get_edict(wpn , EV_ENT_owner))
				{
					cs_set_weapon_ammo(wpn , maxclip(wpnid))
					break;
				}
			}
		}
	}
	return PLUGIN_HANDLED
}
Code:
public ev_AmmoX(id)
{
	set_pdata_int(id, AMMO_SLOT + read_data(1), 200, 5)
}
thank u all
tolpecek is offline
tolpecek
Member
Join Date: Dec 2018
Old 01-02-2019 , 14:14   Re: CurWeapon and AMMOX problem
Reply With Quote #2

Last time it crashed while one player was reloading
and it was after i removed ammox event

Last edited by tolpecek; 01-02-2019 at 14:15.
tolpecek is offline
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 07:30.


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