Hello mates, after CSF scripts shared, I've downloaded there Group skins script, I wanna add for it when player reconnect the skin will be saved, You can help me guys? Client Side:
addEventHandler( "onClientResourceStart", resourceRoot,
function()
for i,val in ipairs(groups) do
perfectname = val.name..""..val.num
textures[perfectname] = dxCreateTexture ( val.texture )
shaders[perfectname] = dxCreateShader( val.shader,999999, 0, false, "ped" )
names[perfectname] = val.worldname
dxSetShaderValue ( shaders[perfectname], "Tex0", textures[perfectname] )
-- engineApplyShaderToWorldTexture ( shaders[perfectname], val.worldname )
--bit of sanity checking
if not shaders[perfectname] then
outputDebugString( "Could not create shader. Please use debugscript 3" )
destroyElement( textures[perfectname] )
return
elseif not textures[perfectname] then
outputDebugString( "loading texture failed" )
destroyElement ( shaders[perfectname] )
tec = nil
return
end
end
end
)
function groupskinapply(cmd,num)
local grp = getElementData(localPlayer,"Group")
local perfectname = grp..""..num
if grp and grp ~= "" and shaders[perfectname] then
if applied[perfectname] then
triggerServerEvent("SunApplyToAllServer", root, perfectname, theplayer)
applied[perfectname] = nil
return end
theplayer = localPlayer
val = groups[1]
applied[perfectname] = true
triggerServerEvent("SonApplyToAllServer", root, perfectname, theplayer)
exports.dendxmsg:createNewDxMessage("Group Skin : On ",0,255,0)
end
end
addCommandHandler("customskin", groupskinapply)
addEvent("onApplyToAllServer", true )
function applyitdude(val, player)
bool1 = engineApplyShaderToWorldTexture ( shaders[val], names[val], player )
--- if not bool1 then outputChatBox("CIS <3",255,0,0) end
end
addEventHandler("onApplyToAllServer", root, applyitdude)
addEvent("unApplyToAllServer", true )
function unapplyitdude(val, player)
bool1 = engineRemoveShaderFromWorldTexture ( shaders[val], names[val], player )
if not bool1 then outputChatBox("CIS <3",255,0,0) end
end
addEventHandler("unApplyToAllServer", root, unapplyitdude)