Need help again.. - 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: Need help again.. (
/showthread.php?tid=271823)
Need help again.. -
Jmarr - 26.07.2011
I'm trying to make a timed ignition system, and I keep getting this error:
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\carsystem.pwn(253) : error 017: undefined symbol "PRESSED"
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\carsystem.pwn(273) : warning 202: number of arguments does not match definition
1 Error.
The code is:
pawn Код:
forward engine(playerid, msg[]);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_HANDBRAKE))
{
if (IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_SYSTEM, "Your engine is starting..");
SetTimerEx("engine", 2000, 2, "s", "Engine Started.");
}
else
{
SendClientMessage(playerid, COLOR_SYSTEM, "You are not in the drivers seat.");
}
}
}
return 1;
}
public engine(playerid, msg[])
{
SendClientMessage(playerid, COLOR_SYSTEM, "%s", msg);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, 1, 0, 0, 0, 0, 0);
return 1;
}
Re: Need help again.. -
Jmarr - 26.07.2011
Help!
Re: Need help again.. -
Shockey HD - 26.07.2011
Please show us line 273 and read
https://sampforum.blast.hk/showthread.php?tid=45235 Rule B
Re: Need help again.. -
Rafa - 26.07.2011
maybe u have some misstake with that PRESSED try looking ur code closely maybe u will find the error ..
just sugestion
Re: Need help again.. -
Jmarr - 26.07.2011
1. Sorry, didn't see that, like most people (however I can admit it) I didn't read the rules. I will now.
2. This is line 273:
" SendClientMessage(playerid, COLOR_SYSTEM, "%s", msg); "
Re: Need help again.. -
Rafa - 26.07.2011
pawn Код:
SendClientMessage(playerid, COLOR_SYSTEM, msg);
Re: Need help again.. -
Jmarr - 26.07.2011
Quote:
Originally Posted by Rafa
pawn Код:
SendClientMessage(playerid, COLOR_SYSTEM, msg);
|
Fixed 1 error, Thanks!
Re: Need help again.. -
a32112365445 - 26.07.2011
"PRESSED(KEY_HANDBRAKE)" change to "newkeys == KEY_HANDBRAKE"
And see if it works.
Re: Need help again.. -
Jmarr - 26.07.2011
Quote:
Originally Posted by a32112365445
"PRESSED(KEY_HANDBRAKE)" change to "newkeys == KEY_HANDBRAKE"
And see if it works.
|
I already found a fix for this:
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Thanks for helping though!
Re: Need help again.. -
emokidx - 27.07.2011
Quote:
Originally Posted by Rafa
pawn Код:
SendClientMessage(playerid, COLOR_SYSTEM, msg);
|
lawl
this was funny