Posts: 8
Threads: 1
Joined: May 2018
Reputation:
0
Hello,
I'm having issue on my gamemode with delay when entering interiors and exiting.
When I press F or ENTER those are the two keys that are set I need to hold them for 5 sec before it reacts to it.
Now how could I fix that? I tried changing the keys didn't work. I'm using latest plugins and it was compiled with latest includes.
I didn't work on that gamemode from scratch it was downloaded from some website but the guy stoped developing it long time ago.
Posts: 6,242
Threads: 8
Joined: Jun 2008
There'll be a reason why they aren't developing it anymore, it probably has bugs.
Especially if you have to hold the key to enter, and it takes 5 seconds.
Show OnPlayerKeystateChange, and if that's packed full of crappy code, then that'll cause you trouble in more areas than just entering/exiting.
Posts: 8
Threads: 1
Joined: May 2018
Reputation:
0
@Sew_Sumi sent you an PM.
And yea it is crappy code.
Posts: 6,242
Threads: 8
Joined: Jun 2008
What's MAX_HOUSE set to? If it's over 1000, that could have something to do with this.
Posts: 8
Threads: 1
Joined: May 2018
Reputation:
0
Wow, actually it was a simple fix, just deleted the nospam inc. It was causing the trouble..
But I appreciate the help!
Posts: 6,242
Threads: 8
Joined: Jun 2008
I'd be a bit wary of this... Whilst removing the include has stopped the error being shown, I'm sure this will come up again.
That OnPlayerKeystateChange is SOOOOOOOOO overweighted.
Like, that really needs work, indentation is one thing, but that code, is likely to need a severe look at, it looks like it's simply every gamemode scripts OnPlayerKeystateChange merged into one.
I just put uncrustify through it, and the indentation is fixed... You should look at this compared to your code as no doubt, it's a lot easier to read.
https://pastebin.com/jFnC5cNi
Posts: 6,242
Threads: 8
Joined: Jun 2008
Uncrustify is good...
Код:
uncrustify.exe -c ./cfg/defaults.cfg -f opksc.txt > unfopksc.txt
https://github.com/uncrustify/uncrustify
opksc.txt being the input, unfopksc.txt being the output.
I use txt files so I can simply make a new text file in the folder, change the batch file to reflect what files I'm processing, and away it goes, no more headaches.