Need help again..
#1

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;
}
Reply
#2

Help!
Reply
#3

Please show us line 273 and read https://sampforum.blast.hk/showthread.php?tid=45235 Rule B
Reply
#4

maybe u have some misstake with that PRESSED try looking ur code closely maybe u will find the error ..
just sugestion
Reply
#5

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); "
Reply
#6

pawn Код:
SendClientMessage(playerid, COLOR_SYSTEM, msg);
Reply
#7

Quote:
Originally Posted by Rafa
Посмотреть сообщение
pawn Код:
SendClientMessage(playerid, COLOR_SYSTEM,  msg);
Fixed 1 error, Thanks!
Reply
#8

"PRESSED(KEY_HANDBRAKE)" change to "newkeys == KEY_HANDBRAKE"
And see if it works.
Reply
#9

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!
Reply
#10

Quote:
Originally Posted by Rafa
Посмотреть сообщение
pawn Код:
SendClientMessage(playerid, COLOR_SYSTEM, msg);
lawl

this was funny
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)