SA-MP Forums Archive
How to make /enter into a physical key command? - 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)
+--- Thread: How to make /enter into a physical key command? (/showthread.php?tid=457832)



How to make /enter into a physical key command? - Jamcraftadam - 13.08.2013

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;
}



Re: How to make /enter into a physical key command? - verlaj - 13.08.2013

use wiki regarding to playerkeystate there you will find info regarding to keys


Re: How to make /enter into a physical key command? - Jamcraftadam - 13.08.2013

I have done that, Im just having a problem getting it to work


Re: How to make /enter into a physical key command? - magnusburton - 13.08.2013

Show us the 'PRESSED' code, please.


Re: How to make /enter into a physical key command? - Pottus - 13.08.2013

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.