Raised This Month: $ Target: $400
 0% 

Grab plugin (need scripters help).


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
linuxas
Member
Join Date: Sep 2013
Old 10-11-2013 , 13:52   Grab plugin (need scripters help).
Reply With Quote #1

Hi guys. I have a knife server and i want a fully working grab plugin.
I use this plugin. Problem is that when i press grab key (somewhere but not on player) and release that key, it still searches for target untill i move my cursor on player... Then it grab player automaticaly. Can someone rescript it? Thank you very much and sorry for bad english.

Last edited by linuxas; 10-11-2013 at 14:20.
linuxas is offline
bat
Veteran Member
Join Date: Jul 2012
Old 10-11-2013 , 13:59   Re: Grab plugin (need scripters help).
Reply With Quote #2

Code:
public grab_on(id,level,cid)
{
	if(!has_grab[id] && !get_pcvar_num(grab_enabled_cvar) && !cmd_access(id,level,cid,1))
	{
		return PLUGIN_HANDLED
	}
	if(grab[id])
	{
		return PLUGIN_HANDLED
	}
	grab[id]=-1
	static target, trash
	target=0
	get_user_aiming(id,target,trash)
	if(target && is_valid_ent2(target) && target!=id)
	{
		if(target<=maxplayers)
		{
			if(is_user_alive(target) && !(get_user_flags(target) & ADMIN_IMMUNITY))
			{
				client_print(id,print_chat,"[AMXX] Found Target")
				grabem(id,target)
			}
		}
		else if(get_solidity(target)!=4)
		{
			client_print(id,print_chat,"[AMXX] Found Target")
			grabem(id,target)
		}
	}
	else
	{
		client_print(id,print_chat,"[AMXX] Searching for Target")
		set_task(0.1,"grab_on2",id)
	}
	return PLUGIN_HANDLED
}

public grab_on2(id)
{
	if(is_user_connected(id))
	{
		static target, trash
		target=0
		get_user_aiming(id,target,trash)
		if(target && is_valid_ent2(target) && target!=id)
		{
			if(target<=maxplayers)
			{
				if(is_user_alive(target) && !(get_user_flags(target) & ADMIN_IMMUNITY))
				{
					client_print(id,print_chat,"[AMXX] Found Target")
					grabem(id,target)
				}
			}
			else if(get_solidity(target)!=4)
			{
				client_print(id,print_chat,"[AMXX] Found Target")
				grabem(id,target)
			}
		}
		else
		{
			set_task(0.1,"grab_on2",id)
		}
	}
}

Last edited by bat; 10-11-2013 at 14:00.
bat is offline
Send a message via Skype™ to bat
linuxas
Member
Join Date: Sep 2013
Old 10-11-2013 , 14:15   Re: Grab plugin (need scripters help).
Reply With Quote #3

Thank you but it still not working When i press grab and release grab key, it show that target not found. but when i turn my cursor on my friend, it grabs automaticaly because plugin remembers, that i was pressing key before.... I want that when i release keys, it stop to do anything until i press it again

Last edited by linuxas; 10-11-2013 at 14:23.
linuxas is offline
bat
Veteran Member
Join Date: Jul 2012
Old 10-11-2013 , 14:36   Re: Grab plugin (need scripters help).
Reply With Quote #4

Quote:
Originally Posted by linuxas View Post
Thank you but it still not working When i press grab and release grab key, it show that target not found. but when i turn my cursor on my friend, it grabs automaticaly because plugin remembers, that i was pressing key before.... I want that when i release keys, it stop to do anything until i press it again
You first time say line where search target, now you want delete it? o_O
__________________
bat is offline
Send a message via Skype™ to bat
linuxas
Member
Join Date: Sep 2013
Old 10-11-2013 , 14:42   Re: Grab plugin (need scripters help).
Reply With Quote #5

Sorry for that.. bad english... Ok i will try to explain my problem.
Deffault plugin version is very good but it has one trouble. When you press grab not on player (on wall and etc.) and release grab button, it is searching for target (real player) all the time until you move your cursor on player. thet it grab player automaticaly.
Trouble: when i playing accidentally press grab key, later when i move my curson on player it grabs that player... I want that plugin grab player only when i hold grab key.
linuxas 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 19:52.


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