Jump to content

Problem with skin saving


GuyFromPast

Recommended Posts

  
function ResourceStart() 
executeSQLCreateTable("SkinID", "serial STRING,SkinID INT") 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ResourceStart) 
  
function ClientReady(g_player) 
local serial = getPlayerSerial(g_player) 
local playername = getPlayerName(g_player) 
CheckPlayerChicken = executeSQLSelect ( "valimusID", "serial", "serial = '" .. serial .. "'" ) 
  
if ( type( CheckPlayerChicken ) == "table" and #CheckPlayerChicken == 0 ) or not CheckPlayerchicken then  
executeSQLInsert ( "SkinID", "'"..serial.."','180'" ) 
end 
end 
addEvent("onClientReady",true) 
addEventHandler("onClientReady",getRootElement(),ClientReady) 
  
function skinchange(source,SkinID) 
setElementModel(source, SkinID) 
local playername = getPlayerName(source) 
local serial = getPlayerSerial(source) 
executeSQLUpdate ( "skinchangee", "SkinID = '"..SkinID.."'","serial = '" .. serial .. "'") 
setElementData ( source ,"pla.number",SkinID,true) 
end 
 addEvent("onSkinChange",true) 
 addEventHandler("onSkinChange",getRootElement(),skinchange) 
  

Any ideas how to fix it ? :|

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...