[BUG]Keybindings stop working atfer some time.

Started by NicusorN5, Aug 30, 2017, 05:20 PM

Previous topic - Next topic

NicusorN5

Description: Key bindings don't work anymore atfer some days of running the server.

When this happends:Always

What you were doing when the bug happened: Playing on my server, I observed that my Nos system wasn't working anymore, maybe because OnKeyDown and OnKeyUp functions can't be called anymore?

NOS system snippet:
function onKeyDown( player, key )
{
 local vehicle = player.Vehicle;
 if (key == x)
 { 
  if (vehicle != null) {
  local Nos = ReadIniInteger("NOS.ini","NOS",vehicle.ID.tostring());
        if (Nos == null) Nos = 0;
  if (Nos > 0)
  {
  PlaySound( 1, 65, vehicle.Pos );
  if (vehicle.Model < 4000)
  {
  vehicle.SetHandlingData(14, vehicle.GetHandlingData(14) + 100.0);
  vehicle.SetHandlingData(13,vehicle.GetHandlingData(13)+100);
  }
  if (vehicle.Model >= 4000)
  {
  vehicle.RelativeSpeed *= 1.1;
  }
  vehicle.Lights = true
  Nos--;
  WriteIniInteger("NOS.ini","NOS",player.Vehicle.ID.tostring(),Nos);
  }
  else NMessagePlayer("[#ff0000]You don't have any more NO2!",player,"[#ff0000]Nu mai ai NO2!");
  } 
}
}


Xenon


NicusorN5

Yeah, my friend Angelo22 used it, he said that it was still was not working.

Xenon

I ask you, did you use ReloadScripts() before this happened. Binds stop responding after scripts reload. :P

NicusorN5

Quote from: Xenon on Aug 31, 2017, 05:07 PMI ask you, did you use ReloadScripts() before this happened. Binds stop responding after scripts reload. :P
Angelo22 reloaded the script, I have no idea when. Is there a way to make them respond again except restarting the server?

EK.IceFlake

Use client-side keybinds. I'm guessing server side ones would be deprecated as well, though don't take my word for it.

NicusorN5

Quote from: EK.IceFlake on Aug 31, 2017, 08:05 PMUse client-side keybinds. I'm guessing server side ones would be deprecated as well, though don't take my word for it.
My script main.nut on store/scripts does not even load.

NicusorN5

Quote from: Xenon on Aug 31, 2017, 05:07 PMI ask you, did you use ReloadScripts() before this happened. Binds stop responding after scripts reload. :P
Reloaded the script, NOS still working. What the f*? So KeyBindings stop responding atfer a number of uses?

EK.IceFlake

Quote from: NicusorN5 on Aug 31, 2017, 08:32 PM
Quote from: EK.IceFlake on Aug 31, 2017, 08:05 PMUse client-side keybinds. I'm guessing server side ones would be deprecated as well, though don't take my word for it.
My script main.nut on store/scripts does not even load.
Yeah it should be in store/script not store/scripts