OnPlayerKeyStateChange Open gate..
#1

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

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;
}
Reply
#3

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

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

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

Hey i need help pleas....
Reply
#7

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

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

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)