SA-MP Forums Archive
pls help me :/ - 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: pls help me :/ (/showthread.php?tid=94377)



pls help me :/ - neonas6661 - 29.08.2009

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new vehicleid = GetPlayerVehicleID(playerid);
    if(newkeys == KEY_WALK)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
          if(vEngine[vehicleid] == 0)
          {
        vEngine[vehicleid] = 1;
              TogglePlayerControllable(playerid, 1);
              GameTextForPlayer(playerid, "~g~Variklis uzvestas", 3000, 5);
    }
        else if (newkeys == KEY_WALK)
      {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(vEngine[vehicleid] == 1)
          {
        vEngine[vehicleid] = 0;
              TogglePlayerControllable(playerid, 0);
              GameTextForPlayer(playerid, "~r~Variklis uzgesintas", 3000, 5);
       
                return 1;
             }
         }
   }
  }
}
why problem?
start engine work..
fail engine not work

Srry bad english


Re: pls help me :/ - MenaceX^ - 29.08.2009

Fix the identitation..


Re: pls help me :/ - Redgie - 29.08.2009

Fix the indentation
Explain what you want it to do properly
Put it under OnPlayerEnterVehicle


Re: pls help me :/ - SpiderPork - 29.08.2009

KEY_WALK doesn't work in vehicles.