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



PAWN Issue - Dresden - 19.10.2009

I'm not sure where to post about PAWN crashes so I appologize in advance. Basically my issue is that ever since I added the OnPlayerKeyStateChange callback to my script the compiler crashes. Maybe I'm too tired to notice my errors but here's the code that's doing it:
Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys);
{
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE)
	{
	  new msg[25];
    if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE))
		{
		  new drunklvl = GetPlayerDrunkLevel(playerid);
			format(msg,sizeof(msg),"Drunk: %d",drunklvl);
			SendClientMessage(playerid,COLOR_YELLOW,msg);
		}
	}
	return 1;
}
Formating is horrible and I suck at using forums, sorry about that.


Re: PAWN Issue - cyber_punk - 19.10.2009

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)[;] - Remove this


Re: PAWN Issue - Dresden - 19.10.2009

Quote:
Originally Posted by cyber_punk
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)[;] - Remove this
Thanks, it was too late at night to be scripting.