Jump to content

screenshot detector


drowned_and

Recommended Posts

Ok guys,

In race mod, when you press the button for a screenshot, it causes something like lag so ppls can use it at wars etc to cause this lag and its kinda cheating in my eyes and I tried to make something like a screenshot detector. I made it like when you press F12 it shows me in the console that Player A made a screenshot but lal I didnt thought at that, that some ppl got screenkey on a different key than F12. Someone can tell me a way to solve this cause I couldnt find a shit in the wiki.

thanks a lot :)

Link to comment

well if you check https://wiki.multitheftauto.com/wiki/Control_names page, you'll see that it's a built-in MTA command "screenshot".

bindKey doesn't work here (as wiki says) and addCommandHandler doesn't seem to work here also (despite the wiki saying it should).

but you can do it the other way around (client-side):

addEventHandler("onClientKey", root, function(key, pressed) 
  if key == getKeyBoundToCommand("screenshot") and pressed then 
    -- do your stuff when someone presses a screenshot key 
  end 
end) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...