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=176564)



OnPlayerKeyStateChange Open gate.. - Ohad1 - 13.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..
I was try this commant it's not working

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){ if( newkeys & KEY_JUMP && GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT && IsPlayerInRangeOfPoint( playerid, 10.0, x, y, z )) //x y z = coords for the gate { // do stuff } return true;}


It's Shutting down all my pawn so pleas help me guys i need it.


Re: OnPlayerKeyStateChange Open gate.. - [XST]O_x - 13.09.2010

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && IsPlayerInRangeOfPoint(playerid,10.0,x,y,z))
        {
            //Do stuff
            return true;
        }
    }
    return true;
}



Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 13.09.2010

Hey man tankes but it's give me this erors...




C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(4502 : error 010: invalid function or declaration
C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(45030) : error 010: invalid function or declaration
C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(45034) : error 010: invalid function or declaration
C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(45037) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4


Re: OnPlayerKeyStateChange Open gate.. - [Lsrcr]Rafa - 13.09.2010

lol where i can find the player state's ?? o_0


Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 13.09.2010

If you don't have the public you can to create it...


Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 14.09.2010

Hey i need help pleas....


Re: OnPlayerKeyStateChange Open gate.. - ahmet257 - 14.09.2010

pawn Код:
if(newkeys == KEY_JUMP)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
//do stuff
}
}
}



Re: OnPlayerKeyStateChange Open gate.. - [XST]O_x - 14.09.2010

Quote:
Originally Posted by ahmet257
Посмотреть сообщение
pawn Код:
if(newkeys == KEY_JUMP)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
//do stuff
}
}
}
Seriously, that had been stated plenty of times before, keys, never get checked with equal signs, you use & for that.

As for the author, which lines has the errors?


Re: OnPlayerKeyStateChange Open gate.. - ahmet257 - 14.09.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Seriously, that had been stated plenty of times before, keys, never get checked with equal signs, you use & for that.

As for the author, which lines has the errors?
I've given them the right is a separate component.


Re: OnPlayerKeyStateChange Open gate.. - Ohad1 - 14.09.2010

Tankes a lot man but it's give me this error

C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(45020) : error 010: invalid function or declaration
C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(45022) : error 010: invalid function or declaration
C:\DOCUME~1\ADMINI~1\F245~1\RP1195~1\GAMEMO~1\rp6. pwn(45024) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

You now what it's this??