#1

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

Really?
You put it inside OnPlayerStateChange..
Reply
#3

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;

Reply
#4

:P, What was i thinking, Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)