Jump to content

x[Help]x in event onPlayerScreenShot


Recommended Posts

Hi Guys, I have a question about onPlayerScreenShot Event

How to get the name of the player who took the screenshot of another player?

and the name of player that the screenshot has been taken from

getPlayerName(???)

 

Thanks ❤️

Link to comment
Posted (edited)
here is an example onPlayerScreenShot event does not carry who took the screenshot
addCommandHandler("takess",
   function(player,_,targetName)
      if not targetName then return end
      local targetPlayer = getPlayerFromName(targetName)
      if not targetPlayer then return end
      local isScreenShot = takePlayerScreenShot(targetPlayer, 1920, 1080)
      if isScreenShot then
         outputChatBox(getPlayerName(player).." taked screenshot to "..targetName)
      end         
   end)
Edited by Burak5312
Link to comment
1 hour ago, Burak5312 said:
here is an example onPlayerScreenShot event does not carry who took the screenshot
addCommandHandler("takess",
   function(player,_,targetName)
      if not targetName then return end
      local targetPlayer = getPlayerFromName(targetName)
      if not targetPlayer then return end
      local isScreenShot = takePlayerScreenShot(targetPlayer, 1920, 1080)
      if isScreenShot then
         outputChatBox(getPlayerName(player).." taked screenshot to "..targetName)
      end         
   end)

Thx,  but I have another question if i took the screenshot by admin panel can I use this code to get target player? 

targetPlayer = getPlayerFromName(targetName)

Or it won't work? 

Link to comment
Posted (edited)
6 minutes ago, Avir14 said:

Thx,  but I have another question if i took the screenshot by admin panel can I use this code to get target player? 

No, this is a code sample, it will not work directly, you need to edit the admin panel.
Edited by Burak5312
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...