IsKeyJustDown cmd
#1

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?
Reply
#2

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

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?
Reply
#4

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

Thanks guys working now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)