OnPlayerKeyStateChange
#1

im useing OnPlayerKeyStateChange to jail i got cmd all working good its perfect the only thing is that it dosent work when in cars ive tried

pawn Код:
if (IsPlayerConnected(playerid) || IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_SPAWNED)
       
//or

      if (IsPlayerConnected(playerid) || IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_SPAWNED)
       
//or

      if (IsPlayerConnected(playerid) || IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_SPAWNED)
        {
and i still cant get it working it only works when im on foot.
Reply
#2

Try adding a

pawn Код:
new PlayerState = GetPlayerState(playerid);
Above your "if" thingy, and then use this "if" thingy:

pawn Код:
if(IsPlayerConnected(playerid) || IsPlayerInAnyVehicle(playerid) && PlayerState == PLAYER_STATE_DRIVER || PlayerState == PLAYER_STATE_SPAWNED)
Reply
#3

eddy, it's same if you store player's state to variable or not.
Reply
#4

Keys are different by walking/in vehicle,
which key are you bond?
Reply
#5

Quote:
Originally Posted by еddy
Try adding a

pawn Код:
new PlayerState = GetPlayerState(playerid);
Above your "if" thingy, and then use this "if" thingy:

pawn Код:
if(IsPlayerConnected(playerid) || IsPlayerInAnyVehicle(playerid) && PlayerState == PLAYER_STATE_DRIVER || PlayerState == PLAYER_STATE_SPAWNED)
i Tried it still no luck thanks for trying to help tho any other idear's of how to?
Reply
#6

Quote:
Originally Posted by Don Correlli
eddy, it's same if you store player's state to variable or not.
It's just because I did that at once, and it didn't work. I might have done something wrong then...
Reply
#7

Quote:
Originally Posted by yezizhu
Keys are different by walking/in vehicle,
which key are you bond?
ive set both in vehicle and mouse to same button and still no luck

dsoe anyone else no any other way's?
Reply
#8

Quote:
Originally Posted by Top_Shoter
Quote:
Originally Posted by yezizhu
Keys are different by walking/in vehicle,
which key are you bond?
ive set both in vehicle and mouse to same button and still no luck

dsoe anyone else no any other way's?
Code?
Reply
#9

CODE REMOVED.
Reply
#10

Quote:

if(newkeys == KEY_LOOK_BEHIND)

This is what I need.
Edit to
Код:
printf("newkeys:%d,key:%d",newkeys,KEY_LOOK_BEHIND);
if(newkeys&KEY_LOOK_BEHIND)
When newkeys has same value with key(at least), it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)