Raised This Month: $ Target: $400
 0% 

[REQ] remove armor and guns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dote
Member
Join Date: Jan 2018
Old 07-10-2018 , 01:51   [REQ] remove armor and guns
Reply With Quote #1

hi guys i need a plugin for my zombie plague server when the round will be end and new round started armors transfer to 0 and weapons remove and give knife to player because is not balance can u help me pls?
Dote is offline
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 07-10-2018 , 04:45   Re: [REQ] remove armor and guns
Reply With Quote #2

On your .sma add this:
HTML Code:
public StripPlayerWeapons(id) 
{ 
	if(is_user_alive(id))
	{	
		ham_strip_weapon(id) 
		give_item(id, "weapon_knife");
	}
} 


stock ham_strip_weapon(id,weapon[])
{
	if(!equal(weapon,"weapon_",7)) return 0;
	
	new wId = get_weaponid(weapon);
	if(!wId) return 0;
	
	new wEnt;
	while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
	if(!wEnt) return 0;
	
	if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
	
	if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
	ExecuteHamB(Ham_Item_Kill,wEnt);
	
	set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
	
	return 1;
}
I hope it works. (I didn't test it so there must be a error! )
__________________
Just an impractical signature
nothing to see here.

Last edited by MagNNusS; 07-10-2018 at 04:46. Reason: Bad Grammar!
MagNNusS is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-10-2018 , 06:50   Re: [REQ] remove armor and guns
Reply With Quote #3

Next time give fulll plugin
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Dote
Member
Join Date: Jan 2018
Old 07-10-2018 , 09:16   Re: [REQ] remove armor and guns
Reply With Quote #4

Quote:
Originally Posted by MagNNusS View Post
On your .sma add this:
HTML Code:
public StripPlayerWeapons(id) 
{ 
	if(is_user_alive(id))
	{	
		ham_strip_weapon(id) 
		give_item(id, "weapon_knife");
	}
} 


stock ham_strip_weapon(id,weapon[])
{
	if(!equal(weapon,"weapon_",7)) return 0;
	
	new wId = get_weaponid(weapon);
	if(!wId) return 0;
	
	new wEnt;
	while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
	if(!wEnt) return 0;
	
	if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
	
	if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
	ExecuteHamB(Ham_Item_Kill,wEnt);
	
	set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
	
	return 1;
}
I hope it works. (I didn't test it so there must be a error! )
didn,t work
Dote is offline
Dote
Member
Join Date: Jan 2018
Old 07-10-2018 , 09:16   Re: [REQ] remove armor and guns
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Next time give fulll plugin
can u help me pls
Dote is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 07-10-2018 , 12:54   Re: [REQ] remove armor and guns
Reply With Quote #6

Quote:
Originally Posted by Dote View Post
can u help me pls
Give your code that we'll add the option in your code.
__________________
Қазақстан Республикасы
Snitch is offline
Send a message via Skype™ to Snitch
Dote
Member
Join Date: Jan 2018
Old 07-10-2018 , 15:08   Re: [REQ] remove armor and guns
Reply With Quote #7

Quote:
Originally Posted by Snitch View Post
Give your code that we'll add the option in your code.
i add this code on zp50_core.sma and compiled but it didnt work
Dote 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 15:28.


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