Jump to content
  • 0

Engine Button


MaRiJuAnA

Question

Nick: MaRiJuAnA

Problema: Nu merge Engine Button.

Erori / warnings: Cand dau compile primesc: Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Iar fisierul .amx e gol, 0Kbs.

Lini/script: [pawn]    if ((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP))

    {

        new playerveh = GetPlayerVehicleID(playerid);

    new vehicles = GetVehicleModel(playerveh) - 400;

        new vid = GetPlayerVehicleID(playerid);

        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

        if(EngineSTATE[vid] == 0)

            {

              GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

              SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);

              EngineSTATE[vid] = 1;

              GetPlayerName(playerid, sendername, sizeof(sendername));

              TogglePlayerControllable(playerid, 1);

                        format(string, sizeof(string), "* %s starts the engine of the %s.", sendername,aVehicleNames[vehicles]);

        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

            }

            else

            {

              GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

              SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);

              EngineSTATE[vid] = 0;

              GetPlayerName(playerid, sendername, sizeof(sendername));

              format(string, sizeof(string), "* %s stops the engine of the %s.", sendername,aVehicleNames[vehicles]);

            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

    }

    return 1;

}[/pawn]

Ai incercat sa rezolvi singur ?: Da.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Am rezolvat problema. In caz ca mai are nevoie cineva:

[pawn]new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));

    if (newkeys == KEY_SUBMISSION)

{

  if(IsPlayerConnected(playerid))

    {

if(IsPlayerInAnyVehicle(playerid))

{

    if(!engineOn[GetPlayerVehicleID(playerid)])

        {

        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)

{

return 1;

}

if(pveh == 510 || pveh == 481 || pveh == 509)

{

return 1;

}

                    new playerveh = GetPlayerVehicleID(playerid);

    new vehicles = GetVehicleModel(playerveh) - 400;

    new vid = GetPlayerVehicleID(playerid);

            if(EngineSTATE[vid] == 0)

            {

              GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

              SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);

              EngineSTATE[vid] = 1;

              GetPlayerName(playerid, sendername, sizeof(sendername));

              TogglePlayerControllable(playerid, 1);

                        format(string, sizeof(string), "* %s starts the engine of the %s.", sendername,aVehicleNames[vehicles]);

        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

            }

            else

            {

              GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

              SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);

              EngineSTATE[vid] = 0;

              GetPlayerName(playerid, sendername, sizeof(sendername));

              format(string, sizeof(string), "* %s stops the engine of the %s.", sendername,aVehicleNames[vehicles]);

            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

}

}

}

return 1;

}[/pawn]

Inlocuiti "KEY_SUBMISSION" cu tasta dorita, in caz ca este nevoie.

Se poate da TC!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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.