Raised This Month: $32 Target: $400
 8% 

Solved [DOD:s] problem with plugin: weapons hangs in the air


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mewbie222
Senior Member
Join Date: May 2018
Old 11-17-2018 , 16:58   [DOD:s] problem with plugin: weapons hangs in the air
Reply With Quote #1

English
Please help me here with this code , more precisely with the plugin https://forums.alliedmods.net/showthread.php?p=2008510 source https://github.com/zadroot/DoD_Bonus...ng/dod_bres.sp . So I can not understand why it may be a glitch with the "hanging arms." I noticed 2 strange lines - 236,241 . I tried to remove them , but still the bug remains . Can somebody help me with this code and why this began to appear a glitch with the "hanging arms." Here are the screenshots : http://prntscr.com/ljawkn , http://prntscr.com/ljawyb
added:
I would like to see a fresh "corpse" to remove the weapons )
And I just figured out why such a glitch happens in this plugin https://github.com/zadroot/DoD_Bonus...ng/dod_bres.sp ahhh!
here's a screen : http://prntscr.com/ljrw9j , http://prntscr.com/ljrwkh
Russian
Помогите разобраться вот с этим кодом , точнее с плагином https://forums.alliedmods.net/showthread.php?p=2008510, исходник https://github.com/zadroot/DoD_Bonus...ng/dod_bres.sp . Так не могу понять почему может быть такой глюк с "висящим оружием" . Заметил там 2 странные строчки - 236,241 . Попробовал их убрать , но всё равно глюк остался . Может кто нибудь поможет разобраться с данным кодом и почему такой стал появляться глюк с "висящим оружием". Вот скрины : http://prntscr.com/ljawkn , http://prntscr.com/ljawyb
Добавка :
а как со свеженького "трупика" убрать оружие )
А то просто разобрался почему такой глюк происходит в этом плагине https://github.com/zadroot/DoD_Bonus...ng/dod_bres.sp.
вот скрин : http://prntscr.com/ljrw9j , http://prntscr.com/ljrwkh

Last edited by mewbie222; 11-27-2018 at 02:23. Reason: I am Solved.
mewbie222 is offline
mewbie222
Senior Member
Join Date: May 2018
Old 11-19-2018 , 09:23   Re: [DOD:s] problem with plugin: weapons hangs in the air
Reply With Quote #2

Decided to give it a try ,here's the code :
Code:
static const String:melee[][] = { "weapon_spade", "weapon_amerknife" };
.....
.....
	HookEvent("player_hurt", player_hurt, EventHookMode_Pre); 
.....
.....
.....
public player_hurt(Handle:event, const String:name[], bool:silent)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if (client > 0 && client <= MaxClients && IsClientInGame(client))
	{
		if (GetEventInt(event, "health") < 1)
		{
		switch (GetClientTeam(client))
			{
			case Team_Allies:
			{
			// Get the player's team and give proper weapon depends on team
			GetEntPropEnt(Team_Allies-2, Prop_Send, "m_hOwnerEntity");
			RemovePlayerItem(client, Team_Allies-2);
			AcceptEntityInput(Team_Allies-2, "Kill");
			}
			case Team_Axis:
				{
			// Get the player's team and give proper weapon depends on team
			GetEntPropEnt(Team_Axis-2, Prop_Send, "m_hOwnerEntity");
			RemovePlayerItem(client, Team_Axis-2);
			AcceptEntityInput(Team_Axis-2, "Kill");
				}
			}
		}
	}
}
so everything seems OK , the weapon disappears . But why then after you respawn(start new round) it disappears at all and all weapons. Tell me where I could make a mistake ?

Last edited by mewbie222; 11-19-2018 at 09:31.
mewbie222 is offline
mewbie222
Senior Member
Join Date: May 2018
Old 11-27-2018 , 02:19   Re: [DOD:s] problem with plugin: weapons hangs in the air
Reply With Quote #3

Topic closed , [Solved] should be in a condition to add a check for alive or dead player "IsPlayerAlive"
mewbie222 is offline
Reply


Thread Tools
Display Modes

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:07.


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