Hallo liebe Community
Ich habe ein Problem mit dem Tactic Script, und zwar wird der Waffenshop angezeigt, jedoch wen ich auf SkinShop gehe
dann bleibt es schwarz, also es kommen keine Skins.
Debugscript zeigt Zeile an: 107 , 120
Lua
Skinshop = {}
local screenW, screenH = guiGetScreenSize()
Skinshop.Window = guiCreateWindow((screenW - 454) / 2, (screenH - 546) / 2, 454, 546, "Skinshop", false)
guiWindowSetMovable(Skinshop.Window, false)
guiWindowSetSizable(Skinshop.Window, false)
Skinshop.Button11 = guiCreateButton(41, 218, 163, 55, "Kaufen \n 7500 Points", false, Skinshop.Window)
Skinshop.Button12 = guiCreateButton(245, 218, 163, 55, "Kaufen \n 20000 Points", false, Skinshop.Window)
Skinshop.Button21 = guiCreateButton(41, 470, 163, 55, "Kaufen \n 7500 Points", false, Skinshop.Window)
Skinshop.Button22 = guiCreateButton(245, 470, 163, 55, "Kaufen \n 20000 Points", false, Skinshop.Window)
Skinshop.Image11 = guiCreateStaticImage(44, 30, 154, 184, ":Admins/Skinshop/Team1-1.png", false, Skinshop.Window)
Skinshop.Image12 = guiCreateStaticImage(249, 30, 154, 184, ":Admins/Skinshop/Team1-2.png", false, Skinshop.Window)
Skinshop.Image21 = guiCreateStaticImage(46, 283, 154, 184, ":Admins/Skinshop/Team2-1.png", false, Skinshop.Window)
Skinshop.Image22 = guiCreateStaticImage(250, 283, 154, 184, ":Admins/Skinshop/Team2-2.png", false, Skinshop.Window)
Skinshop.CloseButton = guiCreateButton(422, 24, 22, 23, "X", false, Skinshop.Window)
guiSetVisible( Skinshop.Window, false )
function openSkin()
guiSetVisible( Skinshop.Window, ( not guiGetVisible( Skinshop.Window) ))
showCursor( guiGetVisible( Skinshop.Window ) )
guiSetText( Skinshop.Button11, "Kaufen \n 7500 Points")
guiSetText( Skinshop.Button12, "Kaufen \n 20000 Points")
guiSetText( Skinshop.Button21, "Kaufen \n 7500 Points")
guiSetText( Skinshop.Button22, "Kaufen \n 20000 Points")
if getElementModel( localPlayer ) ~= 107 then
if ( tonumber(getElementData( localPlayer, "skin1" ) ) > 0 ) then
guiSetText( Skinshop.Button11, "Benutzen" )
end
else
if tostring( guiGetText( Skinshop.Button11 ) ) ~= "Ablegen" then
guiSetText( Skinshop.Button11, "Ablegen")
else
guiSetText( Skinshop.Button11, "Benutzen")
end
end
if getElementModel( localPlayer ) ~= 293 then
if ( tonumber( getElementData( localPlayer, "skin2" ) ) > 0 ) then
guiSetText( Skinshop.Button12, "Benutzen" )
end
else
if tostring( guiGetText( Skinshop.Button12 ) ) ~= "Ablegen" then
guiSetText( Skinshop.Button12, "Ablegen")
else
guiSetText( Skinshop.Button12, "Benutzen")
end
end
if getElementModel( localPlayer ) ~= 114 then
if ( tonumber( getElementData( localPlayer, "skin3" ) ) > 0 ) then
guiSetText( Skinshop.Button21, "Benutzen" )
end
else
if tostring( guiGetText( Skinshop.Button21 ) ) ~= "Ablegen" then
guiSetText( Skinshop.Button21, "Ablegen")
else
guiSetText( Skinshop.Button21, "Benutzen")
end
end
if getElementModel( localPlayer ) ~= 115 then
if ( tonumber( getElementData( localPlayer, "skin4" ) ) > 0 ) then
guiSetText( Skinshop.Button22, "Benutzen" )
end
else
if tostring( guiGetText( Skinshop.Button22 ) ) ~= "Ablegen" then
guiSetText( Skinshop.Button22, "Ablegen")
else
guiSetText( Skinshop.Button22, "Benutzen")
end
end
end
function closeSkin()
showCursor( false )
guiSetVisible(Skinshop.Window, false)
end
addEvent("Skinshop:Close", true)
addEventHandler("Skinshop:Close", localPlayer, closeSkin)
addEventHandler("onClientGUIClick", Skinshop.CloseButton, closeSkin, false )
function buySkin11()
local skin = 107
if tostring(guiGetText(Skinshop.Button11)) ~= "Benutzen" and tostring(guiGetText(Skinshop.Button11)) ~= "Ablegen" then
triggerServerEvent("Skinshop:Buy", localPlayer, localPlayer, tonumber( 7500 ), skin )
else
if tostring(guiGetText(Skinshop.Button11)) ~= "Ablegen" then
if getPlayerTeam( localPlayer ) ~= getTeamFromName("Gast") then
setElementModel( localPlayer, skin )
guiSetText( Skinshop.Button11, "Ablegen" )
else
outputChatBox("Skin zurzeit nicht verfügbar!", 125, 0, 0)
end
else
setElementData( localPlayer, "skin", 0 )
outputChatBox("#89FF00[INFO] #FFFFFFSkin wurde abgelegt!", 0, 0, 0, true )
guiSetText( Skinshop.Button11, "Benutzen" )
end
end
end
function buySkin12()
local skin = 293
if tostring(guiGetText( Skinshop.Button12 ) ) ~= "Benutzen" and tostring(guiGetText(Skinshop.Button12)) ~= "Ablegen" then
triggerServerEvent("Skinshop:Buy", localPlayer, localPlayer, tonumber( 20000 ), skin )
else
if tostring(guiGetText(Skinshop.Button12)) ~= "Ablegen" then
if getPlayerTeam( localPlayer ) ~= getTeamFromName("Gast") then
setElementModel( localPlayer, skin )
guiSetText( Skinshop.Button12, "Ablegen" )
else
outputChatBox("Skin zurzeit nicht verfügbar!", 125, 0, 0)
end
else
setElementData( localPlayer, "skin", 0 )
outputChatBox("#89FF00[INFO] #FFFFFFSkin wurde abgelegt!", 0, 0, 0, true )
guiSetText( Skinshop.Button12, "Benutzen" )
end
end
end
function buySkin21()
local skin = 114
if tostring(guiGetText( Skinshop.Button21 ) ) ~= "Benutzen" and tostring(guiGetText(Skinshop.Button21)) ~= "Ablegen" then
triggerServerEvent("Skinshop:Buy", localPlayer, localPlayer, tonumber( 7500 ), skin )
else
if tostring(guiGetText(Skinshop.Button21)) ~= "Ablegen" then
if getPlayerTeam( localPlayer ) == getTeamFromName("Gast") then
setElementModel( localPlayer, skin )
guiSetText( Skinshop.Button21, "Ablegen" )
else
outputChatBox("Skin zurzeit nicht verfügbar!", 125, 0, 0)
end
else
setElementData( localPlayer, "skin", 0 )
outputChatBox("#89FF00[INFO] #FFFFFFSkin wurde abgelegt!", 0, 0, 0, true )
guiSetText( Skinshop.Button21, "Benutzen" )
end
end
end
function buySkin22()
local skin = 115
if tostring(guiGetText( Skinshop.Button22 ) ) ~= "Benutzen" and tostring(guiGetText(Skinshop.Button22)) ~= "Ablegen" then
triggerServerEvent("Skinshop:Buy", localPlayer, localPlayer, tonumber( 20000 ), skin )
else
if tostring(guiGetText(Skinshop.Button22)) ~= "Ablegen" then
if getPlayerTeam( localPlayer ) == getTeamFromName("Gast") then
setElementModel( localPlayer, skin )
guiSetText( Skinshop.Button22, "Ablegen" )
else
outputChatBox("Skin zurzeit nicht verfügbar!", 125, 0, 0)
end
else
setElementData( localPlayer, "skin", 0 )
outputChatBox("#89FF00[INFO] #FFFFFFSkin wurde abgelegt!", 0, 0, 0, true )
guiSetText( Skinshop.Button22, "Benutzen" )
end
end
end
addEventHandler("onClientGUIClick", Skinshop.Button11, buySkin11, false )
addEventHandler("onClientGUIClick", Skinshop.Button12, buySkin12, false )
addEventHandler("onClientGUIClick", Skinshop.Button21, buySkin21, false )
addEventHandler("onClientGUIClick", Skinshop.Button22, buySkin22, false )
Alles anzeigen
Hoffe ihr könnt mir iwie helfen!
Mfg