SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=599401)



Help - Champagne - 25.01.2016

Alright im using OnPlayerKeyStateChange to make a bind that has the player hit a certain button to replace /enter, I have already defined "pressed" with the code below:

Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Here is my /enter replacement script:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if (PRESSED(KEY_YES))
	{
		if (IsPlayerInRangeOfPoint(playerid, 7.0, 9634.5996, 5616.8052, 4.7742 ))
		{
			SetPlayerPos(playerid, 2233.8032, 1712.2303, 1011.7632);
		}
	}
	return 1;
}
Here is the opcode is returns:

Код:
C:\Users\User\Desktop\LSRP\gamemodes\new.pwn(281) : error 017: undefined symbol "newkeys"
Help would be gladly appreciated and rep will be given.


Re: Help - Richie© - 25.01.2016

Really?
You put it inside OnPlayerStateChange..


Re: Help - TwinkiDaBoss - 25.01.2016

Exactly what Richie said, you are using wrong public for it mate.

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys) {
    if (
PRESSED(KEY_YES))
    {
        if (
IsPlayerInRangeOfPoint(playerid7.09634.59965616.80524.7742 ))
        {
            
SetPlayerPos(playerid2233.80321712.23031011.7632);
        }
    }
    return 
1;




Re: Help - Champagne - 25.01.2016

:P, What was i thinking, Thanks!