Dr Emixam Posted July 7, 2017 Share Posted July 7, 2017 Hi there, I'm currently trying to make a script to send to my server the mugshot/headshot of the player. I started using this very useful topic : http://gtaforums.com/topic/885580-ped-headshotmugshot-txd/ Displaying the mugshot onscreen (like in notifications) works great but I don't know how to get the image data of the headshot, I think I need to access this data to be able to send it to my server. (Sending it is not an issue, the format is not an issue either I can convert on the server side) I think I may start with the native GET_TEXTURE_RESOLUTION and then read each pixel value to make a bitmap-like structure I will be able to send to the server ? I don't know if it is possible to read pixel values in a texture If anyone got an idea… Link to comment https://gtaforums.com/topic/891299-send-ped-headshot-to-server/ Share on other sites More sharing options...
ins1de Posted July 8, 2017 Share Posted July 8, 2017 (edited) Why would you even bother to send it over the network? Assuming you're working with FiveM, you need two scripts and at least one event. client-side -> draw the notification with pedheadshot server-side -> send the ped network handle to a player with an event Note : by "all clients", I mean the players you want to have the mugshot created. Follow these steps, if your selected ped is NOT A PLAYER, ignore step 1 & 2 : Set your ped as a mission entity SET_ENTITY_AS_MISSION_ENTITY, this will stop any unexpected ped behaviour such as disappearing in the middle of the process Get the network ped ID with NETWORK_GET_NETWORK_ID_FROM_ENTITY Send the network ped ID to the selected online players (you need to create an event for this, like TriggerEvent("thisScript:sendpedID",source, destination/player, netPedId) Request ped mugshot/headshot on all clients Not necessary but better for sync : wait for all clients to have the ped mugshot loaded on all clients. Call the function where you need to display the mugshot (for example : drawNotification, etc).on all clients. Eventually, make the ped available for game deletion with SET_ENTITY_AS_NO_LONGER_NEEDED from server-side. Remember, the mugshot is stored as a string variable and can be used to create a temporary texture file. This means you can not send the texture to other clients because their game won't know what it means as the texture has not been loaded/created on their own computer.. This is why you use an event to say "Hey, I want you to create a mugshot for this ped for thoses players". In GTA V, there are something like ~34 available ped mugshots that can be requested/created at once (source : scaleforms). Edited July 8, 2017 by ins1de Link to comment https://gtaforums.com/topic/891299-send-ped-headshot-to-server/#findComment-1069708984 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now