PDA

View Full Version : How to make /enter into a physical key command?


Jamcraftadam
13/08/2013, 03:14 PM
Hello, I want to use the "Enter" key to enter into a building, but it doesn't work, no errors, just not functioning
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED( KEY_SECONDARY_ATTACK ))
{
if(IsPlayerInRangeOfPoint(playerid, 3, 1627.1270,-2248.2031,13.5049))
{
SetPlayerPos(playerid, 246.783996,63.900199,1003.640625);
SetPlayerInterior(playerid, 6);
}
}
return 1;
}

verlaj
13/08/2013, 03:21 PM
use wiki regarding to playerkeystate there you will find info regarding to keys

Jamcraftadam
13/08/2013, 03:23 PM
I have done that, Im just having a problem getting it to work

magnusburton
13/08/2013, 07:10 PM
Show us the 'PRESSED' code, please.

Pottus
13/08/2013, 07:17 PM
Just using.... if(newkeys & KEY_SECONDARY_ATTACK) would work fine but I wouldn't use IsPlayerInRangeOfPoint() if you plan on using a lot of teleport points.