help..?
#1

PHP код:
#include <a_samp>
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_SUBMISSION))
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            new 
vehid;
            
vehid GetPlayerVehicleID(playerid);
            new
            
iEngineiLightsiAlarm,
            
iDoorsiBonnetiBoot,
            
iObjective;
            
GetVehicleParamsEx(vehidiEngineiLightsiAlarmiDoorsiBonnetiBootiObjective);
            if(
iEngine == 1// Engine is on
            
{
                
SetVehicleParamsEx(vehid0iLightsiAlarmiDoorsiBonnetiBootiObjective); // Turn it off
                
return 1;
            }
            else 
// Engine is off
            
{
                
SetVehicleParamsEx(vehid1iLightsiAlarmiDoorsiBonnetiBootiObjective); // Turn it on
                
return 1;
            }
        }
    }
    return 
1;



i have this code for engine system to turn on with number 2

But , it is showing me one problem when i compile..
Код:
undefined symbol "PRESSED"
How to fix it ?
Reply
#2

Add this line on the top of the script:
PHP код:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
Reply
#3

thanks +rep
Reply
#4

You're welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)