Jump to content
  • 0

Erori pawno (/engine)


Go to solution Solved by Sledgy,

Question

Help pls

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(playerInfo[playerid][pFlyLicense] == 0 && isPlane(GetPlayerVehicleID(playerid)))
        {
            sendPlayerError(playerid, "Nu ai licenta de pilot.");
            ClearAnimations(playerid);
            return true;
        }

        if(playerInfo[playerid][pBoatLicense] == 0 && isBoat(GetPlayerVehicleID(playerid)))
        {
            sendPlayerError(playerid, "Nu ai licenta de navigatie.");
            ClearAnimations(playerid);
            return true;
        }

        if(playerInfo[playerid][pDrivingLicense] == 0 && !isBike(GetPlayerVehicleID(playerid)) && !isBoat(GetPlayerVehicleID(playerid)) && !isPlane(GetPlayerVehicleID(playerid)) && GetPlayerVehicleID(playerid) != playerInfo[playerid][pExamenVehicle])
        {
            sendPlayerError(playerid, "Nu ai licenta de condus.");
            ClearAnimations(playerid);
            return true;
        }

        GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);    
        if[vehicle_engine[GetPlayerVehicleID(playerid)])
            SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);

        if(isBike(GetPlayerVehicleID(playerid)))
        {
            SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
            vehicle_engine[GetPlayerVehicleID(playerid)] = true;
        }
    }
    if(newstate == PLAYER_STATE_ONFOOT || oldstate == PLAYER_STATE_DRIVER)
    {
        if(IsValidVehicle(playerInfo[playerid][pExamenVehicle]))
            examenFail(playerid);
    }
    return 1;
}

 

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_LOOK_BEHIND))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || GetPVarInt(playerid, "engineDeelay") != gettime())
        {
            Command_ReProcess(playerid, "engine", false);
        }
    }

    if(PRESSED(KEY_ACTION))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || !isBoat(GetPlayerVehicleID(playerid)) || !isPlane(GetPlayerVehicleID(playerid)))
        {
            Command_ReProcess(playerid, "lights", false);
        }
    }

    if(PRESSED(KEY_ANALOG_DOWN))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || !isBoat(GetPlayerVehicleID(playerid)) || !isPlane(GetPlayerVehicleID(playerid)))
        {
            GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, objective);
            return true;
        }

            vehicle_boot[GetPlayerVehicleID(playerid)] = true;
            SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, objective);    
            return true;
        }
    }

    if(PRESSED(KEY_ANALOG_UP))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isbike(GetPlayerVehicleID(playerid)) || !isBoat(GetPlayerVehicleID(playerid)) || !isPlane(GetPlayerVehicleID(playerid)))
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);

            if(vehicle_bonnet[GetPlayerVehicleID(playerid)]) == true)
            {
                vehicle_bonnet[GetPlayerVehicleID(playerid)] = false;
                SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, objective);
                return true;
            }

            vehicle_bonnet[GetPlayerVehicleID(playerid)] = true;
            SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, objective)
        }
    }
    return 1;
}

 

Erori: 

C:\Users\Raul\Desktop\Tuts GM\pawno\include\callbacks.inc(865) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\Raul\Desktop\Tuts GM\pawno\include\callbacks.inc(866) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Users\Raul\Desktop\Tuts GM\gamemodes\Tuts.pwn(704) : error 017: undefined symbol "engine"
C:\Users\Raul\Desktop\Tuts GM\gamemodes\Tuts.pwn(705) : error 017: undefined symbol "lights"
C:\Users\Raul\Desktop\Tuts GM\gamemodes\Tuts.pwn(706) : error 029: invalid expression, assumed zero
C:\Users\Raul\Desktop\Tuts GM\gamemodes\Tuts.pwn(706) : error 001: expected token: ";", but found ")"
C:\Users\Raul\Desktop\Tuts GM\gamemodes\Tuts.pwn(706) : error 029: invalid expression, assumed zero
C:\Users\Raul\Desktop\Tuts GM\gamemodes\Tuts.pwn(706) : fatal error 107: too many error messages on one line

Compilation aborted.

Pawn compiler 3.10.8              Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
[Finished in 2.4s with exit code 1]
[cmd: ['pawncc.exe', '-i includes', 'C:\\Users\\Raul\\Desktop\\Tuts GM\\gamemodes\\Tuts.pwn', '-;+']]
[dir: C:\Users\Raul\Desktop\Tuts GM\gamemodes]
[path: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\] 

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 1
  • Solution

Văd ca la OnPlayerStateChange nu ai declarat variabilele engine, lights, doors etc

Dar la OnPlayerKeyStateChange le-ai declarat si ai primit eroare.

Asta inseamna ca variabilele respective au fost declarate mai sus, la inceputul gamemodeului probabil.

Deci scoate "new engine, lights, alarm, doors, bonnet, boot, objective;" de la OnPlayerKeyStateChange

Asta nu o sa iti rezolve toate erorile, sa-mi zici ce erori primesti după ce faci ce am zis

Edited by Sledgy
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.