SA-MP Forums Archive
IsKeyJustDown cmd - 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: IsKeyJustDown cmd (/showthread.php?tid=179712)



IsKeyJustDown cmd - FrankC - 28.09.2010

Im trying to change this code to a command
Код:
if(IsKeyJustDown(KEY_CROUCH, newkeys, oldkeys) )
	{
	    if( Player[playerid][PrisonDuration] >= 1 )
	    {
	        SendClientMessage( playerid, WHITE, "This feature isn't available whilst you're prisoned / jailed." );
	    }
	    else
	    {
			if(IsPlayerInRangeOfPoint( playerid, 3, BankIntX, BankIntY, BankIntZ) )
			{
			    SetPlayerInterior( playerid, 0 );
			    TextDrawHideForPlayer( playerid, ExitTextdraw);
			    SetPlayerPos( playerid, BankExtX, BankExtY, BankExtZ);
			}
I got this but it doesnt work

Код:
command(enter, playerid, params[])  // <-- Changed that
	{
	    if( Player[playerid][PrisonDuration] >= 1 )
	    {
	        SendClientMessage( playerid, WHITE, "This feature isn't available whilst you're prisoned / jailed." );
	    }
	    else
	    {
			if(IsPlayerInRangeOfPoint( playerid, 3, BankIntX, BankIntY, BankIntZ) )
			{
			    SetPlayerInterior( playerid, 0 );
			    TextDrawHideForPlayer( playerid, ExitTextdraw);
			    SetPlayerPos( playerid, BankExtX, BankExtY, BankExtZ);
			}
the code is placed under
Код:
public OnPlayerKeyStateChange // <-- Should i place it somewhere else?



Re: IsKeyJustDown cmd - Retardedwolf - 28.09.2010

Instead of using IsKeyJustDown you could use GetPlayerSpecialAction because its more accurate.


Re: IsKeyJustDown cmd - FrankC - 28.09.2010

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
Instead of using IsKeyJustDown you could use GetPlayerSpecialAction because its more accurate.
Yes, but i wanna change the KEY_CROUCH to a command?


Re: IsKeyJustDown cmd - Desert - 28.09.2010

If your gonna make it a command, it should be under OnPlayerCommandText


Re: IsKeyJustDown cmd - FrankC - 28.09.2010

Thanks guys working now