SA-MP Forums Archive
Sorry if this is spam :( - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sorry if this is spam :( (/showthread.php?tid=261350)



Sorry if this is spam :( - Cenation - 13.06.2011

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1130.7203,-2029.2191,69.0078))
   	if (PRESSED(KEY_FIRE))
    {
   		new name[MAX_PLAYER_NAME], string[44];
   	 	GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "Welcome, %s.",name);
        SendClientMessage(playerid,0xFFFFFFFF,string);
    }
	return 1;
}
i have created this command... and its showing 1 error
Код:
C:\Users\sovy\Desktop\Tushar^#$.@(DANGER)\CnRPatrol\samp03csvr_R2-2_win32\gamemodes\HellzoneStuntages.pwn(3249) : error 017: undefined symbol "PRESSED"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Sorry if this is spam :( - Bmxerlmao5288 - 13.06.2011

No This Isnt Spam Its Asking For Help. I Cant Give You Much Answer For This But I Can Give You Help.

Quote:

The error occurs when a piece of code references a variable, constant or function that the compiler cannot find. Often, this error is encountered by scripters who recklessly copy and paste code from one script to another, not realizing that the code in question depends on other code in the original script. Another, more common mistake made by even the most experienced scripters, is misspelling symbols.
That Means That The Input either Dosnt Exist, Or It Dosnt Belong There


Re: Sorry if this is spam :( - Cenation - 13.06.2011

thankz can anyone fix it and give script?...
thank u BMX


Re: Sorry if this is spam :( - cessil - 13.06.2011

#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))


Re: Sorry if this is spam :( - Firzendxiw - 13.06.2011

Damn beat me to it Cessil...

pawn Код:
// PRESSED(keys)
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
This should fix it, if you need help with OnPlayerKeyStateChange https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange


Re: Sorry if this is spam :( - Cenation - 13.06.2011

lol thankz everyone