Drackles Posted January 29, 2022 Posted January 29, 2022 (edited) Hello, after leaving the job, I want the previous skin to be restored, how can I get it? @The_GTAhelp Edited January 29, 2022 by Drackles
SinaAmp Posted January 29, 2022 Posted January 29, 2022 hi if you using database you must wrote the function that update your previous saved skin model data in database after leaving or changing job or faction 1
Drackles Posted January 29, 2022 Author Posted January 29, 2022 Is there a ready-made method for this, such as coding?
βurak Posted January 29, 2022 Posted January 29, 2022 (edited) This varies according to the resource you use. Since you do not show the code, I will explain the logic, but if you have a save system, you may need to write more code than that. you can call the savePlayerDefaultSkin function before the job starts and when the job is finished you can call the loadPlayerDefaultSkin function local playerDefaultSkin = {} -- define storage for player default skins function savePlayerDefaultSkin(player) playerDefaultSkin[player] = getElementModel(player) --save player model to table end function loadPlayerDefaultSkin(player) if(playerDefaultSkin[player]) then setElementModel(player, playerDefaultSkin[player]) -- load skin from table playerDefaultSkin[player] = nil -- remove from table we don't need anymore end end addEventHandler("onPlayerQuit", root, function() playerDefaultSkin[player] = nil --delete player skin from game completely from memory end ) Edited January 29, 2022 by Burak5312 1
Drackles Posted January 29, 2022 Author Posted January 29, 2022 Drackles#3312 can you add i will show you in more detail?
βurak Posted January 29, 2022 Posted January 29, 2022 (edited) send it as a private message Edited January 29, 2022 by Burak5312 1
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