SA-MP Forums Archive
OnPlayerKeyStateChange Open gate.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerKeyStateChange Open gate.. (/showthread.php?tid=175602)



OnPlayerKeyStateChange Open gate.. - Ohad1 - 10.09.2010

Hey guys if sombody can help me i will be happy so this is the problem i want to do like this,to open my gate in the button like JUMP button so i hope you guys wiil help me thanks..


Re: OnPlayerKeyStateChange Open gate.. - mick88 - 10.09.2010

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_JUMP) && IsPlayerInRangeOfPoint(playerid, x, y ,z)) //insert your gate coordinates instead of x y z
	{
	    MoveObject(gateid, movex, movey, movez, 0.5) //put new gate coordinates instead of movex, movey...
	}
}
This code will open gate but it will not close it afterwards, you'd have to add timer that closes gate after few seconds


Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 10.09.2010

Woo tankes man but i attempt this in my pawn but it's shuting down my pawn and it's stick my computer your command looking good but is not working you can help me?.


Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 10.09.2010

Sorry on the duble but guys sombody can help me it's not work me the way he give so pleas somebody.


Re: OnPlayerKeyStateChange Open gate.. - mick88 - 10.09.2010

How is it not working? It's not a copy-paste, you have to edit it for your own script, if you don't know how, then you should learn some basic scripting before you even think about the gates.


Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 11.09.2010

Help me pleas....


Re: OnPlayerKeyStateChange Open gate.. - [UG]Scripter - 11.09.2010

STOP BUMPING YOUR TOPIC!!

b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 12 hours old, and it needs to have useful information about your problem.


Reference: Read Before Posting Post.