SA-MP Forums Archive
error 017: undefined symbol "newkeys" - 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: error 017: undefined symbol "newkeys" (/showthread.php?tid=306934)



error 017: undefined symbol "newkeys" - The God - 28.12.2011

error 017: undefined symbol "newkeys"
What's the problem? How do i fix it?

Код:
if( newkeys == KEY_SECONDARY_ATTACK )  
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1555.4877,-1675.7708,16.1953 ) ) 
{
SetPlayerPos( playerid, 246.783996,63.900199,1003.640625 ); 
SetPlayerInterior( playerid, 6 );  
SendClientMessage(playerid,WHITE,"* press ENTER to exit");
return 1; // Baigiame.
}
}
if( newkeys == KEY_SECONDARY_ATTACK ) 
{
if( IsPlayerInRangeOfPoint( playerid,3.0, 1555.4877,-1675.7708,16.1953 ) ) 
{
SetPlayerPos( playerid, 246.783996,63.900199,1003.640625 ); 
SetPlayerInterior( playerid, 0 );
return 1; 
}
}



Re: error 017: undefined symbol "newkeys" - HyperZ - 28.12.2011

Use these codes in OnPlayerKeyStateChange(playerid, newkeys, oldkeys) callback, see the example below:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if( newkeys == KEY_SECONDARY_ATTACK )
    {
        if( IsPlayerInRangeOfPoint( playerid, 3.0, 1555.4877,-1675.7708,16.1953 ) )
        {
            SetPlayerPos( playerid, 246.783996,63.900199,1003.640625 );
            SetPlayerInterior( playerid, 6 );
            SendClientMessage(playerid,WHITE,"* press ENTER to exit");
            return 1; // Baigiame.
        }
    }
    if( newkeys == KEY_SECONDARY_ATTACK )
    {
        if( IsPlayerInRangeOfPoint( playerid,3.0, 1555.4877,-1675.7708,16.1953 ) )
        {
            SetPlayerPos( playerid, 246.783996,63.900199,1003.640625 );
            SetPlayerInterior( playerid, 0 );
            return 1;
        }
    }
    return 1;
}



Re: error 017: undefined symbol "newkeys" - The God - 28.12.2011

Oh man i didn't used this thing at all! Forgot
But then i put it in i get a lot of different errors from data/menu.txt

--------------------------------------------------------------------
Oh i figured it out.
Thanks for the help