Hi Leute,
habe da mal wieder ein Problem..
Debugscript 3:
Externer Inhalt
s7.directupload.net
Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
| Script: AG Userpanel
Code:
Lua
local me = getLocalPlayer()
local maxStreamedPlayers = 16
sx,sy = guiGetScreenSize()
enabled = false
g_showTooltip = false
g_tooltipText = ""
g_tooltipPosY = 0
g_tooltipTimer = nil
function showTooltip(text)
if g_tooltipTimer ~= nil then
killTimer(g_tooltipTimer)
end
g_tooltipText = text
g_showTooltip = true
g_tooltipTimer = setTimer(function() g_showTooltip = false g_tooltipTimer = nil end, 10000, 1)
end
addEvent( "showTooltip", true )
addEventHandler( "showTooltip", getRootElement(), showTooltip )
function mapwindowa()
deltaTime = (getTickCount()) - startTimess
if deltaTime <= 1000 then
beta = sy - ((deltaTime/1000)*100)
elseif (deltaTime > 1000) and (deltaTime < 4000) then
beta = sy-100
elseif (deltaTime >= 4000) and (deltaTime <= 6000) then
beta = sy-((1-((deltaTime-4000)/800))*100)
else
removeEventHandler("onClientRender",getRootElement(),mapwindowa)
end
dxDrawRectangle((sx-400)/2,beta,400,110,tocolor ( 0, 255, 0, 100 ))
dxDrawText("Spectators",125+(sx-400)/2,beta+15,((sx-400)/2)+400,beta+55,tocolor(255,255,255),2,"default-bold","left","top",true)
dxDrawText("Enabled",165+(sx-400)/2,beta+60,((sx-400)/2)+400,beta+85,tocolor(255,255,255),1.7,"default","left","top",true)
end
function mapwindowda()
deltaTime = (getTickCount()) - startTimess
if deltaTime <= 1000 then
beta = sy - ((deltaTime/1000)*100)
elseif (deltaTime > 1000) and (deltaTime < 4000) then
beta = sy-100
elseif (deltaTime >= 4000) and (deltaTime <= 6000) then
beta = sy-((1-((deltaTime-4000)/800))*100)
else
removeEventHandler("onClientRender",getRootElement(),mapwindowda)
end
dxDrawRectangle((sx-400)/2,beta,400,110,tocolor ( 255, 0, 0, 100 ))
dxDrawText("Spectators",125+(sx-400)/2,beta+15,((sx-400)/2)+400,beta+55,tocolor(255,255,255),2,"default-bold","left","top",true)
dxDrawText("Disabled",165+(sx-400)/2,beta+60,((sx-400)/2)+400,beta+85,tocolor(255,255,255),1.7,"default","left","top",true)
end
gIsGuiShown = false
gShowTooltip = false
gSelected = 0
gAlpha = 0.0
gGuiErrorText = false
gSelectedMapTab = 0
local windowWidth = 640
local windowHeight = 480
gGuiTable = {
[1] = {name = "Stats", icon="files/stats.png", hovericon="files/stats_h.png" },
[2] = {name = "Achievements", icon="files/arch.png", hovericon="files/arch_h.png"},
[3] = {name = "Apps", icon="files/apps.png", hovericon="files/apps_h.png"},
[4] = {name = "Donator", icon="files/donator.png", hovericon="files/donator_h.png"},
[5] = {name = "Settings", icon="files/settings.png", hovericon="files/settings_h.png"},
}
gWinsounds = {
[0] = "None",
[1] = "Hey Hallo Camper",
[2] = "Du Labersack",
[3] = "We are the Champion",
[4] = "An Tagen wie diesen",
[5] = "Black and Yellow",
[6] = "I am Sexy",
[7] = "Lila Wolke",
[8] = "Move like Jagger",
[9] = "Ich will ein Spiel spielen"
}
gJoinsounds = {
[0] = "None",
[1] = "Hey Hallo Camper",
[2] = "Ich bin Carlo",
[3] = "We gonna dance",
[4] = "Call me maybe",
[5] = "Just say Hello",
[6] = "Summerjam"
}
--Stats
function initialiseGui ()
gWindowGui = {}
gWindowGui[1] = guiCreateStaticImage ( sx/2+640/2-70, sy/2-480/2+5, 64, 32, "files/closen.png", false )
guiSetVisible(gWindowGui[1], false)
addEventHandler ( "onClientGUIClick", gWindowGui[1], function() gSelected = 0 end, false )
--Settings
Settings_BTNS = {}
Settings_BTNS["water"] = guiCreateButton(sx/2- windowWidth/2 + 67,sy/2 - windowHeight/2 + 56,115,39,"Water effect",false)
Settings_BTNS["carpaint"] = guiCreateButton(sx/2- windowWidth/2 + 193,sy/2 - windowHeight/2 + 56,115,39,"Carpaint effect",false)
Settings_BTNS["roadshine"] = guiCreateButton(sx/2- windowWidth/2 + 317,sy/2 - windowHeight/2 + 56,115,39,"Roadshine effect",false)
Settings_BTNS["hdr"] = guiCreateButton(sx/2- windowWidth/2 + 436,sy/2 - windowHeight/2 + 56,115,39,"HD effect",false)
Settings_BTNS["infernus"] = guiCreateButton(sx/2- windowWidth/2 + 65,sy/2 - windowHeight/2 + 107,119,39,"Infernus-Mod",false)
Settings_BTNS["avatars"] = guiCreateButton(sx/2- windowWidth/2 + 193,sy/2 - windowHeight/2 + 107,115,39,"Avatars",false)
addEventHandler ( "onClientGUIClick", Settings_BTNS["water"] , enableShaders,false )
addEventHandler ( "onClientGUIClick", Settings_BTNS["carpaint"] , enableShaders,false )
addEventHandler ( "onClientGUIClick", Settings_BTNS["roadshine"] , enableShaders,false )
addEventHandler ( "onClientGUIClick", Settings_BTNS["hdr"] , enableShaders,false )
addEventHandler ( "onClientGUIClick", Settings_BTNS["infernus"] , infernusMod,false )
addEventHandler ( "onClientGUIClick", Settings_BTNS["avatars"] , function() gGuiErrorText = "Showing Avatars: "..(tostring(not getElementData(getLocalPlayer(), "isAvatars"))) callServerFunction("setPlayerData", getLocalPlayer(), "isAvatars", not getElementData(getLocalPlayer(), "isAvatars")) end,false )
for i,v in pairs(Settings_BTNS) do
guiSetVisible(Settings_BTNS[i], false)
end
pvpGui = {}
pvpGui["nameText"] = guiCreateLabel(sx/2 + windowWidth/2 - 490,sy/2-20,500,292,"Playername (or parts):",false)
pvpGui["nameEdit"] = guiCreateEdit ( sx/2 + windowWidth/2 - 490,sy/2, 150, 30, "", false )
pvpGui["moneyText"] = guiCreateLabel(sx/2 + windowWidth/2 - 330,sy/2-20,500,292,"Money:",false)
pvpGui["moneyEdit"] = guiCreateEdit ( sx/2 + windowWidth/2 - 330,sy/2, 60, 30, "", false )
pvpGui["roundsText"] = guiCreateLabel(sx/2 + windowWidth/2 - 260,sy/2-20,500,292,"Rounds:",false)
pvpGui["roundsEdit"] = guiCreateEdit ( sx/2 + windowWidth/2 - 260,sy/2, 50, 30, "", false )
pvpGui["pvpstart"] = guiCreateButton(sx/2 + windowWidth/2 - 180,sy/2,150,30,"Start PVP",false)
pvpGui["accept"] = guiCreateButton(sx/2 + windowWidth/2 - 180,sy/2 + windowHeight/2 - 60,150,20,"Accept PVP",false)
pvpGui["decline"] = guiCreateButton(sx/2 + windowWidth/2 - 180,sy/2 + windowHeight/2 - 30,150,20,"Decline PVP",false)
pvpGui["text"] = guiCreateLabel(sx/2- windowWidth/2 + 10, sy/2 + windowHeight/2 - 50,500,292,"[No]Buss wants to do a PVP war with you.\nRounds: 88 | Money: 1337 Noro",false)
addEventHandler ( "onClientGUIClick", pvpGui["pvpstart"], function() triggerServerEvent ( "pvp", getLocalPlayer(), guiGetText(pvpGui["nameEdit"]), guiGetText(pvpGui["moneyEdit"]), guiGetText(pvpGui["roundsEdit"])) end,false )
addEventHandler ( "onClientGUIClick", pvpGui["accept"], function() triggerServerEvent ( "acceptpvp", getLocalPlayer() ) end,false )
addEventHandler ( "onClientGUIClick", pvpGui["decline"], function() triggerServerEvent ( "declinepvp", getLocalPlayer() ) end,false )
for i,v in pairs(pvpGui) do
guiSetVisible(v, false)
end
Shop_btns = {}
--tabs[6] = guiCreateTab("Shop",tabsnew[1])
Shop_btns[1] = guiCreateButton(sx/2- windowWidth/2 +32,sy/2 - windowHeight/2 +50 +17,154,42,"Buy Wintext \n 10000$",false)
function buyWintext ()
if tonumber(getElementData(getLocalPlayer(),"cash") ) >= 10000 then
createQuestion("WinText","Please Enter your Wintext" )
--guiSetVisible(window,false)
else
gGuiErrorText = "You dont have enough money!"
outputChatBox("You dont have enough money!",255,0,0,true)
function Spec()
startTimess = getTickCount()
if enabled == false then
removeEventHandler("onClientRender",getRootElement(),mapwindowa)
removeEventHandler("onClientRender",getRootElement(),carclose)
removeEventHandler("onClientRender",getRootElement(),caropen)
removeEventHandler("onClientRender",getRootElement(),wateropen)
removeEventHandler("onClientRender",getRootElement(),waterclose)
addEventHandler("onClientRender",getRootElement(),mapwindowda)
else
removeEventHandler("onClientRender",getRootElement(),mapwindowda)
removeEventHandler("onClientRender",getRootElement(),carclose)
removeEventHandler("onClientRender",getRootElement(),caropen)
removeEventHandler("onClientRender",getRootElement(),wateropen)
removeEventHandler("onClientRender",getRootElement(),waterclose)
addEventHandler("onClientRender",getRootElement(),mapwindowa)
end
enabled = not enabled
end
end
end
addEventHandler("onClientGUIClick",Shop_btns[1],buyWintext,false)
Shop_btns[2] = guiCreateButton(sx/2- windowWidth/2 +32,sy/2 - windowHeight/2 +66 +50,154,42,"Buy Joinmsg \n 7500$",false)
function buyJoinmsg ()
if tonumber(getElementData(getLocalPlayer(),"cash") ) >= 7500 then
createQuestion("Joinmsg","Please Enter your Joinmsg" )
guiSetVisible(window,false)
else
outputChatBox("You dont have enough money!",255,0,0,true)
gGuiErrorText = "You dont have enough money!"
end
end
addEventHandler("onClientGUIClick",Shop_btns[2],buyJoinmsg,false)
wheels_panel = guiCreateTabPanel(sx/2- windowWidth/2 +361,sy/2 - windowHeight/2 +14 +50,229,309,false)
wheels_panel_Tab = guiCreateTab("Wheels",wheels_panel)
wheels_grid = guiCreateGridList(1,1,225,220,false,wheels_panel_Tab)
guiGridListSetSelectionMode(wheels_grid,2)
wheels_column = guiGridListAddColumn(wheels_grid,"Wheels",0.6)
Shop_btns[3] = guiCreateButton(43,236 ,150,41,"Buy Wheels \n9000$",false,wheels_panel_Tab)
function buyWheels ()
if tonumber(getElementData(getLocalPlayer(),"cash") ) >= 9000 then
local wheels = guiGridListGetItemText ( wheels_grid, guiGridListGetSelectedItem ( wheels_grid ), 1 )
triggerServerEvent("setWheels",getLocalPlayer(),wheels)
else
outputChatBox("You dont have enough money!",255,0,0,true)
gGuiErrorText = "You dont have enough money!"
end
end
addEventHandler("onClientGUIClick",Shop_btns[3],buyWheels,false)
Shop_btns[4] = guiCreateButton(sx/2- windowWidth/2 +33,sy/2 - windowHeight/2 +115 +50,154,42,"Buy Vehicle Color \n 7500$",false)
function buyVehColor ()
if tonumber(getElementData(getLocalPlayer(),"cash") ) >= 7500 then
openPicker("veh1")
guiSetVisible(window,false)
else
outputChatBox("You dont have enough money!",255,0,0,true)
gGuiErrorText = "You dont have enough money!"
end
end
addEventHandler("onClientGUIClick",Shop_btns[4],buyVehColor ,false)
Shop_btns[5] = guiCreateButton(sx/2- windowWidth/2 +33,sy/2 - windowHeight/2 +166 +50,154,42,"Buy Rainbow Color \n 10000$",false)
function buyRainbowColor ()
triggerServerEvent("setRainBowColor",getLocalPlayer())
end
addEventHandler("onClientGUIClick",Shop_btns[5],buyRainbowColor,false)
Shop_btns[6] = guiCreateButton(sx/2- windowWidth/2 +33,sy/2 - windowHeight/2 +214 +50,154,42,"Buy Pulsaiting Headlights \n 5000$",false)
function buyHeadlights ()
if tonumber(getElementData(getLocalPlayer(),"cash") ) >= 5000 then
openPicker("light")
guiSetVisible(window,false)
else
outputChatBox("You dont have enough money!",255,0,0,true)
gGuiErrorText = "You dont have enough money!"
end
end
addEventHandler("onClientGUIClick",Shop_btns[6],buyHeadlights ,false)
Shop_Rows = {}
Shop_Rows[301] = guiGridListAddRow (wheels_grid)
Shop_Rows[302] = guiGridListAddRow (wheels_grid)
Shop_Rows[303] = guiGridListAddRow (wheels_grid)
Shop_Rows[304] = guiGridListAddRow (wheels_grid)
Shop_Rows[305] = guiGridListAddRow (wheels_grid)
Shop_Rows[306] = guiGridListAddRow (wheels_grid)
Shop_Rows[307] = guiGridListAddRow (wheels_grid)
Shop_Rows[308] = guiGridListAddRow (wheels_grid)
Shop_Rows[309] = guiGridListAddRow (wheels_grid)
Shop_Rows[310] = guiGridListAddRow (wheels_grid)
Shop_Rows[311] = guiGridListAddRow (wheels_grid)
Shop_Rows[312] = guiGridListAddRow (wheels_grid)
Shop_Rows[313] = guiGridListAddRow (wheels_grid)
Shop_Rows[314] = guiGridListAddRow (wheels_grid)
Shop_Rows[315] = guiGridListAddRow (wheels_grid)
Shop_Rows[316] = guiGridListAddRow (wheels_grid)
Shop_Rows[317] = guiGridListAddRow (wheels_grid)
guiGridListSetItemText ( wheels_grid, Shop_Rows[301], wheels_column, "Shadow", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[302], wheels_column, "Mega", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[303], wheels_column, "Rimshine", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[304], wheels_column, "Wires", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[305], wheels_column, "Classic", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[306], wheels_column, "Twist", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[307], wheels_column, "Cutter", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[308], wheels_column, "Switch", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[309], wheels_column, "Grove", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[310], wheels_column, "Import", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[311], wheels_column, "Dollar", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[312], wheels_column, "Trance", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[313], wheels_column, "Atomic", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[314], wheels_column, "Ahab", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[315], wheels_column, "Virtual", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[316], wheels_column, "Access", false, false )
guiGridListSetItemText ( wheels_grid, Shop_Rows[317], wheels_column, "Offroad", false, false )
--Stats
function loadPlayersToGridlist( )
guiGridListClear(stats_grid)
for id, playeritem in ipairs(getElementsByType("player")) do
if getElementData(playeritem,"isLoggedIn") then
if getElementData(playeritem,"isLoggedIn") == true then
local row = guiGridListAddRow ( stats_grid )
guiGridListSetItemText ( stats_grid, row, stats_p, getPlayerRightName ( playeritem ), false, false )
guiGridListSetItemData(stats_grid,row,stats_p,getPlayerName(playeritem))
end
end
end
end
Stats = {}
--Stats["tab"] = guiCreateTab("Stats",tabs[1])
stats_grid = guiCreateGridList(sx/2- windowWidth/2 +15,sy/2 - windowHeight/2 +45,202,318,false)
guiGridListSetSelectionMode(stats_grid,2)
function setPlayerInfoToInfo ( )
local rowindex, columnindex = guiGridListGetSelectedItem ( stats_grid )
local selectedText = guiGridListGetItemText (stats_grid, rowindex, aname )
if selectedText then
local player = getPlayerFromName(guiGridListGetItemData ( stats_grid, rowindex, columnindex ))
if player then
triggerServerEvent("requestArchievmentsForPanel",player,player)
local p = player
local cash = getElementData(p,"cash")
local rank = getElementData(p,"rank")
local deaths = getElementData(p,"deaths")
local points = getElementData(p,"points")
local ddswon = getElementData(p,"ddswon")
local playtime = getElementData(p,"playtime")
local ddsplayed = getElementData(p,"ddsplayed")
local Status = getElementData(p,"Status")
playtime = math.floor ( playtime / 60 )..":"..( playtime - math.floor ( playtime / 60 ) * 60 )
--Archievments--------
local Starter = getElementData(p,"Starter")
if Starter == 1 then
Starter = "[X]"
else
Starter = "[_]"
end
local Noob = getElementData(p,"Noob Racer")
if Noob == 1 then
Noob = "[X]"
else
Noob = "[_]"
end
local Pro = getElementData(p,"Pro Racer")
if Pro == 1 then
Pro = "[X]"
else
Pro = "[_]"
end
local FuckNoob = getElementData(p,"Fucking Noob")
if FuckNoob == 1 then
FuckNoob = "[X]"
else
FuckNoob = "[_]"
end
local Swimming = getElementData(p,"Swimming Prof.")
if Swimming == 1 then
Swimming = "[X]"
else
Swimming = "[_]"
end
local DRLOVER = getElementData(p,"~DR~ Lover")
if DRLOVER == 1 then
DRLOVER = "[X]"
else
DRLOVER = "[_]"
end
local Rich = getElementData(p,"Rich")
if Rich == 1 then
Rich = "[X]"
else
Rich = "[_]"
end
local Millonare = getElementData(p,"Millonare")
if Millonare == 1 then
Millonare = "[X]"
else
Millonare = "[_]"
end
local EXPJunky = getElementData(p,"EXP Junky")
if EXPJunky == 1 then
EXPJunky = "[X]"
else
EXPJunky = "[_]"
end
local EXPProf = getElementData(p,"EXP Prof.")
if EXPProf == 1 then
EXPProf = "[X]"
else
EXPProf = "[_]"
end
local toptimes = getElementData(p,"toptimes")
if not toptimes then
toptimes = "0"
end
local huntertimes = getElementData(p,"huntertimes")
if not huntertimes then
huntertimes = "0"
end
guiLabelSetColor(stats_info1,255,255,255,true)
guiSetText(stats_info1,"Playername: "..selectedText.."\n\n\nWin Ratio "..calcRatio(ddswon,ddsplayed).."%\n\nWins: "..ddswon.."\n\nDeaths: "..deaths.."\n\nPlayed maps: "..ddsplayed.."\n\nLevel: "..rank.."\n\nEXP: "..points.."\n\nCash : "..cash.."$\n\nPlaytime:" ..playtime.."\n\nStatus: "..Status)
guiSetText(stats_info2,"Huntertimes : "..huntertimes.." \n TopTimes : "..toptimes)
end
end
end
addEventHandler("onClientGUIClick",stats_grid,setPlayerInfoToInfo,false)
stats_p = guiGridListAddColumn(stats_grid,"Player",0.6)
stats_info1 = guiCreateLabel(sx/2- windowWidth/2 +232,sy/2 - windowHeight/2 +53,192,292,"",false)
stats_info2 = guiCreateLabel(sx/2- windowWidth/2 +426,sy/2 - windowHeight/2 +53,174,292,"",false)
guiSetText(stats_info1,"Playername: -\n\n\nWin Ratio -\n\nWins:-\n\nDeaths: -\n\nPlayed maps: -\n\nLevel: -\n\nEXP: -\n\nCash : -\n\nPlaytime:-\n\nStatus: -")
guiSetText(stats_info2,"Huntertimes : - \n TopTimes : -")
guiLabelSetColor(stats_info1,255,255,255,true)
for i,v in pairs(Stats) do
guiSetVisible(v, false)
end
guiSetVisible(stats_grid, false)
guiSetVisible(stats_info1, false)
guiSetVisible(stats_info2, false)
--buttonOpenMapshop = guiCreateButton(sx/2 - 100,sy/2 - 30 ,200,20,"Map Shop",false)
--buttonOpenNormalshop = guiCreateButton(sx/2 - 100,sy/2 ,200,20,"Normal Shop",false)
buttonOpenMapshop = guiCreateStaticImage(sx/2-256,sy/2,128,128,"files/maps.png",false)
buttonOpenNormalshop = guiCreateStaticImage(sx/2-128,sy/2,128,128,"files/shop.png",false)
buttonOpenPVP = guiCreateStaticImage(sx/2-0,sy/2,128,128,"files/pvp.png",false)
buttonOpenWIP = guiCreateStaticImage(sx/2+128,sy/2,128,128,"files/stop.png",false)
guiSetVisible(buttonOpenMapshop, false)
guiSetVisible(buttonOpenNormalshop, false)
guiSetVisible(buttonOpenPVP, false)
guiSetVisible(buttonOpenWIP, false)
addEventHandler("onClientGUIClick",buttonOpenMapshop,function() gSelectedMapTab = 1 end,false)
addEventHandler("onClientGUIClick",buttonOpenNormalshop,function() gSelectedMapTab = 2 end,false)
addEventHandler("onClientGUIClick",buttonOpenPVP,function() gSelectedMapTab = 3 end,false)
addEventHandler("onClientGUIClick",buttonOpenWIP,function() gGuiErrorText = "Error: This application is still in work!" end,false)
gridMaps = guiCreateGridList(sx/2- windowWidth/2 +17,sy/2 - windowHeight/2 +91,315,285,false)
guiGridListSetSortingEnabled(gridMaps,false)
guiGridListAddColumn(gridMaps,"~DR~ Server Map List",0.9)
lblMapsInfo = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +250,245,45,"",false)
guiLabelSetVerticalAlign(lblMapsInfo,"center")
guiLabelSetHorizontalAlign(lblMapsInfo,"center",true)
guiSetFont(lblMapsInfo,"default-bold-small")
lblTotalMapsOnServer = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +68,193,19,"Total maps on the server: N/A",false)
guiSetFont(lblTotalMapsOnServer,"default-bold-small")
guiLabelSetColor(lblTotalMapsOnServer,255,153,0)
lblTotalDmMaps = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +87,193,19,"Total DM maps: N/A",false)
guiSetFont(lblTotalDmMaps,"default-bold-small")
guiLabelSetColor(lblTotalDmMaps,255,255,255)
lblTotalDdMaps = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +102,193,19,"Total DD maps: N/A",false)
guiSetFont(lblTotalDdMaps,"default-bold-small")
guiLabelSetColor(lblTotalDdMaps,255,153,0)
lblSelectedMapNameTitlesss = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +270,193,19," ",false)
guiSetFont(lblSelectedMapNameTitlesss,"default-bold-small")
guiLabelSetColor(lblSelectedMapNameTitlesss,255,255,255)
lblSelectedMapNameTitlexz = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +270,193,19," ",false)
guiSetFont(lblSelectedMapNameTitlexz,"default-bold-small")
guiLabelSetColor(lblSelectedMapNameTitlexz,111,111,111)
lblSelectedMapNameTitlex = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +270,220,20," ",false)
guiSetFont(lblSelectedMapNameTitlex,"default-bold-small")
guiLabelSetColor(lblSelectedMapNameTitlex,255,153,0)
lblSetNextMapTitle = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +229,245,16,"Set a next map",false)
guiLabelSetColor(lblSetNextMapTitle,255,153,0)
guiLabelSetVerticalAlign(lblSetNextMapTitle,"center")
guiLabelSetHorizontalAlign(lblSetNextMapTitle,"center",false)
guiSetFont(lblSetNextMapTitle,"default-bold-small")
lblSearchForMaps = guiCreateLabel(sx/2- windowWidth/2 +25,sy/2 - windowHeight/2 +65,101,14,"Search for maps:",false)
guiLabelSetColor(lblSearchForMaps,255,153,0)
guiLabelSetVerticalAlign(lblSearchForMaps,"center")
guiSetFont(lblSearchForMaps,"default-bold-small")
lblSelectedMapNameTitle = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +137,245,16,"Selected map name:",false)
guiLabelSetColor(lblSelectedMapNameTitle,255,153,0)
guiSetFont(lblSelectedMapNameTitle,"default-bold-small")
lblSelectedMapAuthorTitle = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +176,245,16,"Map type:",false)
guiLabelSetColor(lblSelectedMapAuthorTitle,255,153,0)
guiSetFont(lblSelectedMapAuthorTitle,"default-bold-small")
lblSelectedMapName = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +153,245,16,"N/A",false)
lblSelectedMapAuthor = guiCreateLabel(sx/2- windowWidth/2 +342,sy/2 - windowHeight/2 +192,245,16,"N/A",false)
editMapSearch = guiCreateEdit(sx/2- windowWidth/2 +129,sy/2 - windowHeight/2 +63,198,21,"",false)
btnBuyNextMap = guiCreateButton(sx/2- windowWidth/2 +380,sy/2 - windowHeight/2 +305,169,44,"Buy as next map - $3.000",false)
guiSetVisible(gridMaps, false)
guiSetVisible(lblMapsInfo, false)
guiSetVisible(lblTotalMapsOnServer, false)
guiSetVisible(lblTotalDmMaps, false)
guiSetVisible(lblTotalDdMaps, false)
guiSetVisible(lblSelectedMapNameTitlesss, false)
guiSetVisible(lblSelectedMapNameTitlexz, false)
guiSetVisible(lblSelectedMapNameTitlex, false)
guiSetVisible(lblSetNextMapTitle, false)
guiSetVisible(lblSearchForMaps, false)
guiSetVisible(lblSelectedMapNameTitle, false)
guiSetVisible(lblSelectedMapAuthorTitle, false)
guiSetVisible(lblSelectedMapName, false)
guiSetVisible(lblSelectedMapAuthor, false)
guiSetVisible(editMapSearch, false)
guiSetVisible(btnBuyNextMap, false)
addEventHandler ( "onClientGUIClick", gridMaps, updateMapLabels, false )
addEventHandler ( "onClientGUIClick", btnBuyNextMap, buyNextMap, false )
addEventHandler ( "onClientGUIChanged", editMapSearch, mapSearch, false )
---VIP
Vip_btns = {}
Vip_btns[1] = guiCreateButton(sx/2- windowWidth/2 +44,sy/2 - windowHeight/2 +11+50,156,33,"Set Chatcolor",false)
function buyChatVipColor ()
guiSetVisible(window,false)
openPicker("chatcolor")
end
addEventHandler("onClientGUIClick",Vip_btns[1],buyChatVipColor,false )
Vip_btns[2] = guiCreateButton(sx/2- windowWidth/2 +46,sy/2 - windowHeight/2 +54+50,156,33,"Set Vehiclecolor",false)
function buyVehVipColor ()
guiSetVisible(window,false)
openPicker("veh1")
end
addEventHandler("onClientGUIClick",Vip_btns[2],buyVehVipColor,false )
vip_bild = guiCreateStaticImage(sx/2- windowWidth/2 +411,sy/2 - windowHeight/2 +14+50,166,95,"avatars/alien.png",false)
Vip_btns["grid"] = guiCreateGridList(sx/2- windowWidth/2 +230,sy/2 - windowHeight/2 +20+50,169,208,false)
vip_column = guiGridListAddColumn(Vip_btns["grid"],"Wheels",0.6)
guiGridListSetSelectionMode(Vip_btns["grid"],2)
Vip_btns[3] = guiCreateButton(sx/2- windowWidth/2 +233,sy/2 - windowHeight/2 +240+50,161,35,"Set Avatar",false)
function setNewAvatar(button, state)
if button == "left" and state == "up" then
local avatar = guiGridListGetItemText ( Vip_btns["grid"], guiGridListGetSelectedItem ( Vip_btns["grid"] ), 1 )
if avatar then
showTooltip("New avatar successfully set.")
callServerFunction("playerSetAvatar", getLocalPlayer(), avatar)
end
end
end
addEventHandler("onClientGUIClick",Vip_btns[3],setNewAvatar,false)
function setPreviewAvatar (button,state)
if button == "left" and state == "up" then
local avatar = guiGridListGetItemText ( Vip_btns["grid"], guiGridListGetSelectedItem ( Vip_btns["grid"] ), 1 )
guiStaticImageLoadImage(vip_bild,"avatars/"..avatar)
end
end
addEventHandler("onClientGUIClick",Vip_btns["grid"],setPreviewAvatar,false)
Vip_btns["winsounds"] = guiCreateGridList ( sx/2- windowWidth/2 +46,sy/2 - windowHeight/2 +54+50+50,156,200, false )
guiGridListAddColumn( Vip_btns["winsounds"], "Name", 1)
Vip_btns[4] = guiCreateButton(sx/2- windowWidth/2 +46,sy/2 - windowHeight/2 +54+50+50+210,156,33,"Set Winsound",false)
Vip_btns[5] = guiCreateButton(sx/2- windowWidth/2 +46,sy/2 - windowHeight/2 +54+50+50+210+50,156,33,"Preview Winsound",false)
addEventHandler("onClientGUIClick",Vip_btns[4],function()
local row, column = guiGridListGetSelectedItem ( Vip_btns["winsounds"] )
if guiGridListGetItemData (Vip_btns["winsounds"], row, column ) then
callServerFunction("setPlayerData", getLocalPlayer(), "winsound", guiGridListGetItemData (Vip_btns["winsounds"], row, column ))
showTooltip("New winsound was successfully set.")
end
end, false)
addEventHandler("onClientGUIClick",Vip_btns[5],function()
local row, column = guiGridListGetSelectedItem ( Vip_btns["winsounds"] )
if guiGridListGetItemData (Vip_btns["winsounds"], row, column ) then
playSound ( "files/winsounds/"..guiGridListGetItemData (Vip_btns["winsounds"], row, column )..".mp3" )
end
end, false)
for num = 0, #gWinsounds do
local row = guiGridListAddRow ( Vip_btns["winsounds"] )
guiGridListSetItemText ( Vip_btns["winsounds"], row, 1, gWinsounds[num], false, false )
guiGridListSetItemData ( Vip_btns["winsounds"], row, 1, tostring(num) )
end
Vip_btns["joinsounds"] = guiCreateGridList ( sx/2- windowWidth/2 +46+400,sy/2 - windowHeight/2 +54+50+50+50,156,150, false )
guiGridListAddColumn( Vip_btns["joinsounds"], "Name", 1)
Vip_btns[6] = guiCreateButton(sx/2- windowWidth/2 +46+400,sy/2 - windowHeight/2 +54+50+50+210,156,33,"Set Joinsound",false)
Vip_btns[7] = guiCreateButton(sx/2- windowWidth/2 +46+400,sy/2 - windowHeight/2 +54+50+50+210+50,156,33,"Preview Joinsound",false)
addEventHandler("onClientGUIClick",Vip_btns[6],function()
local row, column = guiGridListGetSelectedItem ( Vip_btns["joinsounds"] )
if guiGridListGetItemData (Vip_btns["joinsounds"], row, column ) then
callServerFunction("setPlayerData", getLocalPlayer(), "joinsound", guiGridListGetItemData (Vip_btns["joinsounds"], row, column ))
showTooltip("New joinsound was successfully set.")
end
end, false)
addEventHandler("onClientGUIClick",Vip_btns[7],function()
local row, column = guiGridListGetSelectedItem ( Vip_btns["joinsounds"] )
if guiGridListGetItemData (Vip_btns["joinsounds"], row, column ) then
playSound ( "files/joinsounds/"..guiGridListGetItemData (Vip_btns["joinsounds"], row, column )..".mp3" )
end
end, false)
for num = 0, #gJoinsounds do
local row = guiGridListAddRow ( Vip_btns["joinsounds"] )
guiGridListSetItemText ( Vip_btns["joinsounds"], row, 1, gJoinsounds[num], false, false )
guiGridListSetItemData ( Vip_btns["joinsounds"], row, 1, tostring(num) )
end
for id,avatar in pairs (avatarPfad) do
local row = guiGridListAddRow ( Vip_btns["grid"] )
guiGridListSetItemText ( Vip_btns["grid"], row, vip_column, string.gsub(avatar, "avatars/",""), false, false )
end
for i,v in pairs(Vip_btns) do
guiSetVisible(v, false)
end
guiSetVisible(vip_bild, false)
--Achievements
arch = {}
arch["grid"] = guiCreateGridList(sx/2- windowWidth/2 +34,sy/2 - windowHeight/2 +62,310,270,false)
guiGridListSetSelectionMode(arch["grid"],2)
aname = guiGridListAddColumn(arch["grid"],"Achievements",0.5)
alocked = guiGridListAddColumn(arch["grid"],"Unlocked",0.2)
arch["btn"] = guiCreateButton(sx/2- windowWidth/2 +372,sy/2 - windowHeight/2 +278,117,37,"Set as Status",false)
arch["info"] = guiCreateLabel(sx/2- windowWidth/2 +359,sy/2 - windowHeight/2 +50,240,204,"",false)
function setInfoTextToArch ( )
local rowindex, columnindex = guiGridListGetSelectedItem ( arch["grid"] )
local selectedText = guiGridListGetItemText ( arch["grid"], rowindex, aname )
if selectedText == "Starter" then
guiSetText(arch["info"],"To Unlock this archivment you must\n win 1 map.")
elseif selectedText == "Noob Racer" then
guiSetText(arch["info"],"To Unlock this archivments you must\n win 25 maps.")
elseif selectedText == "Pro Racer" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have played 800 maps.")
elseif selectedText == "Fucking Noob" then
guiSetText(arch["info"],"To Unlock this archivments you must\n die in 25 maps.")
elseif selectedText == "Swimming Prof." then
guiSetText(arch["info"],"To Unlock this archivments you must\n die in 100 maps.")
elseif selectedText == "~DR~ Lover" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 26 hours playtime.")
elseif selectedText == "Rich" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 50.000$ ingame cash.")
elseif selectedText == "Millonare" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 1.000.000$ ingame cash.")
elseif selectedText == "EXP Beginner" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 1.000 EXP.")
elseif selectedText == "EXP Experte" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 10.000 EXP.")
elseif selectedText == "DR Prof." then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 65 hours playtime.")
elseif selectedText == "Gamer" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 90 hours playtime.")
elseif selectedText == "DR Junky" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 130 hours playtime.")
elseif selectedText == "Old as Bastard" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have 180 hours playtime.")
elseif selectedText == "Bad Driver" then
guiSetText(arch["info"],"To Unlock this archivments you must\n die in 1000 maps.")
elseif selectedText == "Even worse Driver" then
guiSetText(arch["info"],"To Unlock this archivments you must\n die in 5000 maps.")
elseif selectedText == "worst driver" then
guiSetText(arch["info"],"To Unlock this archivments you must\n die in 10000 maps.")
elseif selectedText == "Beginner" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have played 80 maps.")
elseif selectedText == "Amateur" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have played 200 maps.")
elseif selectedText == "Legend" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have played 2000 maps.")
elseif selectedText == "Hardcore Driver" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have played 5000 maps.")
elseif selectedText == "Ganster" then
guiSetText(arch["info"],"To Unlock this archivments you must\n have played 10000 maps.")
end
end
addEventHandler("onClientGUIClick",arch["grid"],setInfoTextToArch,false)
addEventHandler("onClientGUIClick", arch["btn"],
function ( btn, state )
if state == "up" then
local rowindex, columnindex = guiGridListGetSelectedItem ( arch["grid"] )
local selectedText = guiGridListGetItemText ( arch["grid"], rowindex, aname )
local selectedTextAvailable = guiGridListGetItemText ( arch["grid"], rowindex, alocked )
if selectedText then
if selectedTextAvailable == "[x]" then
triggerServerEvent("setNewStatusToPlayer",getLocalPlayer(),getLocalPlayer(),selectedText)
gGuiErrorText = "Your New Status is "..selectedText
else
gGuiErrorText = "The Status is locked for you!"
end
end
end
end, false)
for i,v in pairs(arch) do
guiSetVisible(v, false)
end
for i,v in ipairs(gGuiTable) do
local ix = i-1
if sy < 750 then
v.gui = guiCreateStaticImage ( 0, 25+(ix*64), 64, 64, v.icon, false )
else
v.gui = guiCreateStaticImage ( 0, 25+(ix*128), 128, 128, v.icon, false )
end
guiSetVisible(v.gui, false)
setElementData(v.gui, "guiTooltip", v.name)
setElementData(v.gui, "guiIcon", v.icon)
setElementData(v.gui, "guiHoverIcon", v.hovericon)
setElementData(v.gui, "guiID", i)
addEventHandler ( "onClientGUIClick", v.gui, function() gSelected = getElementData(source, "guiID") gGuiErrorText = false gSelectedMapTab = 0 end, false )
end
end
addEventHandler( "onClientResourceStart", getResourceRootElement(), initialiseGui )
function drawGUI ()
if gIsGuiShown == true then
if gAlpha < 1 then
gAlpha = gAlpha + 0.1
else
gAlpha = 1
end
else
if gAlpha > 0 then
gAlpha = gAlpha - 0.1
else
gAlpha = 0
end
end
for i,v in pairs(Vip_btns) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
for i,v in pairs(Vip_btns) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
guiSetVisible(vip_bild, false)
guiSetAlpha(vip_bild, gAlpha)
for i,v in pairs(pvpGui) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
for i,v in pairs(Shop_btns) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
guiSetVisible(wheels_panel, false)
guiSetAlpha(wheels_panel, gAlpha)
for i,v in pairs(Stats) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
guiSetVisible(stats_grid, false)
guiSetAlpha(stats_grid, gAlpha)
guiSetVisible(stats_info1, false)
guiSetAlpha(stats_info1, gAlpha)
guiSetVisible(stats_info2, false)
guiSetAlpha(stats_info2, gAlpha)
guiSetVisible(gridMaps, false)
guiSetVisible(lblMapsInfo, false)
guiSetVisible(lblTotalMapsOnServer, false)
guiSetVisible(lblTotalDmMaps, false)
guiSetVisible(lblTotalDdMaps, false)
guiSetVisible(lblSelectedMapNameTitlesss, false)
guiSetVisible(lblSelectedMapNameTitlexz, false)
guiSetVisible(lblSelectedMapNameTitlex, false)
guiSetVisible(lblSetNextMapTitle, false)
guiSetVisible(lblSearchForMaps, false)
guiSetVisible(lblSelectedMapNameTitle, false)
guiSetVisible(lblSelectedMapAuthorTitle, false)
guiSetVisible(lblSelectedMapName, false)
guiSetVisible(lblSelectedMapAuthor, false)
guiSetVisible(editMapSearch, false)
guiSetVisible(btnBuyNextMap, false)
guiSetAlpha(gridMaps, gAlpha)
guiSetAlpha(lblMapsInfo, gAlpha)
guiSetAlpha(lblTotalMapsOnServer, gAlpha)
guiSetAlpha(lblTotalDmMaps, gAlpha)
guiSetAlpha(lblTotalDdMaps, gAlpha)
guiSetAlpha(lblSelectedMapNameTitlesss, gAlpha)
guiSetAlpha(lblSelectedMapNameTitlexz, gAlpha)
guiSetAlpha(lblSelectedMapNameTitlex, gAlpha)
guiSetAlpha(lblSetNextMapTitle, gAlpha)
guiSetAlpha(lblSearchForMaps, gAlpha)
guiSetAlpha(lblSelectedMapNameTitle, gAlpha)
guiSetAlpha(lblSelectedMapAuthorTitle, gAlpha)
guiSetAlpha(lblSelectedMapName, gAlpha)
guiSetAlpha(lblSelectedMapAuthor, gAlpha)
guiSetAlpha(editMapSearch, gAlpha)
guiSetAlpha(btnBuyNextMap, gAlpha)
guiSetVisible(buttonOpenMapshop, false)
guiSetAlpha(buttonOpenMapshop, gAlpha)
guiSetVisible(buttonOpenNormalshop, false)
guiSetAlpha(buttonOpenNormalshop, gAlpha)
guiSetVisible(buttonOpenPVP, false)
guiSetAlpha(buttonOpenPVP, gAlpha)
guiSetVisible(buttonOpenWIP, false)
guiSetAlpha(buttonOpenWIP, gAlpha)
for i,v in ipairs(gWindowGui) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
for i,v in pairs(Settings_BTNS) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
for i,v in pairs(arch) do
guiSetVisible(v, false)
guiSetAlpha(v, gAlpha)
end
if getElementData(getLocalPlayer(), "Vip") == true then
guiSetText(btnBuyNextMap, "Buy as next map - $1.500")
guiSetText(Shop_btns[1], "Buy Wintext \n 5000$" )
guiSetText(Shop_btns[2], "Buy Joinmsg \n 3750$")
guiSetText(Shop_btns[3], "Buy Wheels \n4500$")
guiSetText(Shop_btns[4], "Buy Vehicle Color \n 3750$")
guiSetText(Shop_btns[5], "Buy Rainbow Color \n 5000$")
guiSetText(Shop_btns[6], "Buy Pulsaiting Headlights \n 2500$")
else
guiSetText(btnBuyNextMap, "Buy as next map - $3.000")
guiSetText(Shop_btns[1], "Buy Wintext \n 10000$" )
guiSetText(Shop_btns[2], "Buy Joinmsg \n 7500$")
guiSetText(Shop_btns[3], "Buy Wheels \n9000$")
guiSetText(Shop_btns[4], "Buy Vehicle Color \n 7500$")
guiSetText(Shop_btns[5], "Buy Rainbow Color \n 10000$")
guiSetText(Shop_btns[6], "Buy Pulsaiting Headlights \n 5000$")
end
if gAlpha ~= 0 then
for i,v in ipairs(gGuiTable) do
guiSetVisible(v.gui, true)
guiSetAlpha(v.gui, gAlpha)
end
local realTime = getRealTime()
if realTime.hour < 10 then realTime.hour = "0"..realTime.hour end
if realTime.minute < 10 then realTime.minute = "0"..realTime.minute end
if realTime.second < 10 then realTime.second = "0"..realTime.second end
dxDrawRectangle(0, 0, 128, sy, tocolor(0,0,0,150*gAlpha))
dxDrawText(realTime.hour..":"..realTime.minute..":"..realTime.second, 0, 5, 128, 10, tocolor(255,255,255,gAlpha*255), 1, "default-bold", "center")
dxDrawLine(128,0,128,sy, tocolor(255,255,255,150*gAlpha))
if gShowTooltip ~= false then
local gx, gy = guiGetPosition(gShowTooltip, false)
local gsx,gsy = guiGetSize(gShowTooltip, false)
dxDrawText(getElementData(gShowTooltip, "guiTooltip"), 140, gy+gsy/2,500,gy+gsy, tocolor(255,255,255,gAlpha*255),1.5, "default-bold", "left", "center", false, false, true)
end
if gSelected ~= 0 then
dxDrawImage(sx/2-640/2, sy/2-480/2, 640, 480, "files/window1.png",0,0,0,tocolor(255,255,255,255*gAlpha))
dxDrawText(gGuiTable[gSelected].name.." ~ Teamspeak: 134.255.234.189", sx/2-640/2+5, sy/2-480/2+15 ,640,480, tocolor(255,255,255,gAlpha*255),1.2, "default-bold", "left", "top", false, false, true)
if gGuiErrorText ~= false then
dxDrawText(gGuiErrorText, sx/2-640/2+5, sy/2+480/2-30 ,640,480, tocolor(255,255,255,gAlpha*255),1.2, "default", "left", "top", false, false, true)
end
for i,v in ipairs(gWindowGui) do
guiSetVisible(v, true)
end
if gGuiTable[gSelected].name == "Stats" then
for i,v in pairs(Stats) do
guiSetVisible(v, true)
end
guiSetVisible(stats_grid, true)
guiSetVisible(stats_info1, true)
guiSetVisible(stats_info2, true)
end
if gGuiTable[gSelected].name == "Settings" then
for i,v in pairs(Settings_BTNS) do
guiSetVisible(v, true)
end
end
if gGuiTable[gSelected].name == "Achievements" then
for i,v in pairs(arch) do
guiSetVisible(v, true)
end
end
if gGuiTable[gSelected].name == "Donator" then
if getElementData(getLocalPlayer(),"Vip") == false then
dxDrawText("You must be Donator to see this page", sx/2-640/2, sy/2-480/2 ,sx/2+640/2,sy/2 , tocolor(255,255,255,gAlpha*255),1.2, "clear", "center", "center", false, false, true)
else
for i,v in pairs(Vip_btns) do
guiSetVisible(v, true)
end
guiSetVisible(vip_bild, true)
end
end
if gGuiTable[gSelected].name == "Apps" then
if gSelectedMapTab == 1 then
guiSetVisible(gridMaps, true)
guiSetVisible(lblMapsInfo, true)
guiSetVisible(lblTotalMapsOnServer, true)
guiSetVisible(lblTotalDmMaps, true)
guiSetVisible(lblTotalDdMaps, true)
guiSetVisible(lblSelectedMapNameTitlesss, true)
guiSetVisible(lblSelectedMapNameTitlexz, true)
guiSetVisible(lblSelectedMapNameTitlex, true)
guiSetVisible(lblSetNextMapTitle, true)
guiSetVisible(lblSearchForMaps, true)
guiSetVisible(lblSelectedMapNameTitle, true)
guiSetVisible(lblSelectedMapAuthorTitle, true)
guiSetVisible(lblSelectedMapName, true)
guiSetVisible(lblSelectedMapAuthor, true)
guiSetVisible(editMapSearch, true)
guiSetVisible(btnBuyNextMap, true)
elseif gSelectedMapTab == 2 then
for i,v in pairs(Shop_btns) do
guiSetVisible(v, true)
end
guiSetVisible(wheels_panel, true)
local wheels = guiGridListGetItemText ( wheels_grid, guiGridListGetSelectedItem ( wheels_grid ), 1 )
if wheels ~= "" then
local wheelID
if wheels == "Shadow" then
wheelID = 1073
elseif wheels == "Mega" then
wheelID = 1074
elseif wheels == "Offroad" then
wheelID = 1025
elseif wheels == "Rimshine" then
wheelID = 1075
elseif wheels == "Wires" then
wheelID = 1076
elseif wheels == "Classic" then
wheelID = 1077
elseif wheels == "Twist" then
wheelID = 1078
elseif wheels == "Cutter" then
wheelID = 1079
elseif wheels == "Switch" then
wheelID = 1080
elseif wheels == "Grove" then
wheelID = 1081
elseif wheels == "Import" then
wheelID = 1082
elseif wheels == "Dollar" then
wheelID = 1083
elseif wheels == "Trance" then
wheelID = 1084
elseif wheels == "Atomic" then
wheelID = 1085
elseif wheels == "Ahab" then
wheelID = 1096
elseif wheels == "Virtual" then
wheelID = 1097
elseif wheels == "Access" then
wheelID = 1098
end
dxDrawImage ( sx/2-32,sy/2-32, 64, 64, "files/"..tostring(wheelID)..".jpg")
end
elseif gSelectedMapTab == 3 then
for i,v in pairs(pvpGui) do
guiSetVisible(v, true)
end
gGuiErrorText = " "
dxDrawText("Player vs. Player\nFight against other players for money!\n\nRules: \n-The player who is longer alive on a map gains a point\n-The player who times out/quits loses the fight", sx/2-640/2, sy/2-480/2 ,sx/2+640/2,sy/2 , tocolor(255,255,255,gAlpha*255),1.2, "clear", "center", "center", false, false, true)
local inPVP = false
local pvpElements = getElementsByType ( "pvpElement" )
for theKey,pvpElement in ipairs(pvpElements) do
if getElementData(pvpElement, "player1") == getLocalPlayer() or getElementData(pvpElement, "player2") == getLocalPlayer() then
if getElementData(pvpElement, "accepted") == false then
inPVP = true
if getElementData(pvpElement, "player1") == getLocalPlayer() then
guiSetText(pvpGui["text"], "PVP war with "..getPlayerName(getElementData(pvpElement, "player2"))..".\nRounds: "..getElementData(pvpElement, "maxrounds").." | Money "..getElementData(pvpElement, "money").."$")
else
guiSetText(pvpGui["text"], "PVP war with "..getPlayerName(getElementData(pvpElement, "player1"))..".\nRounds: "..getElementData(pvpElement, "maxrounds").." | Money "..getElementData(pvpElement, "money").."$")
end
end
end
end
if inPVP == false then
guiSetVisible(pvpGui["accept"], false)
guiSetVisible(pvpGui["decline"], false)
guiSetVisible(pvpGui["text"], false)
end
else
dxDrawText("Please select your application", sx/2-640/2, sy/2-480/2 ,sx/2+640/2,sy/2 , tocolor(255,255,255,gAlpha*255),1.2, "clear", "center", "center", false, false, true)
guiSetVisible(buttonOpenMapshop, true)
guiSetVisible(buttonOpenNormalshop, true)
guiSetVisible(buttonOpenPVP, true)
guiSetVisible(buttonOpenWIP, true)
end
end
end
end
if g_showTooltip == true then
if g_tooltipPosY + 5 < 100 then
g_tooltipPosY = g_tooltipPosY + 5
else
g_tooltipPosY = 100
end
dxDrawRectangle ( sx/2-200, sy-g_tooltipPosY , 400, 100, tocolor ( 200,0,0,200 ))
dxDrawText("Information", 0, 10+sy-g_tooltipPosY, sx, sy, tocolor(0, 0, 0,255), 1, "bankgothic", "center")
dxDrawText(g_tooltipText, sx/2-200, sy+35-g_tooltipPosY, sx/2+200, sy, tocolor(0, 0, 0,255), 1.2, "default", "center", "top", true, true)
else
if g_tooltipPosY - 5 > 0 then
g_tooltipPosY = g_tooltipPosY - 5
dxDrawRectangle ( sx/2-200, sy-g_tooltipPosY , 400, 100, tocolor ( 200,0,0,200 ))
dxDrawText("Information", 0, 10+sy-g_tooltipPosY, sx, sy, tocolor(0, 0, 0,255), 1, "bankgothic", "center")
dxDrawText(g_tooltipText, sx/2-200, sy+35-g_tooltipPosY, sx/2+200, sy, tocolor(0, 0, 0,255), 1.2, "default", "center", "top", true, true)
else
g_tooltipPosY = 0
end
end
end
addEventHandler ( "onClientRender", root, drawGUI )
bindKey("U", "down", function()
if gIsGuiShown == true then
showChat ( true )
showCursor(false)
gIsGuiShown = false
setElementData(getLocalPlayer(), "guiIsVisible", false)
showPlayerHudComponent ( "radar", true )
for i,v in ipairs(gGuiTable) do
guiSetVisible(v.gui, false)
gShowTooltip = false
guiStaticImageLoadImage ( v.gui, getElementData(v.gui, "guiIcon"))
gSelected = 0
end
guiStaticImageLoadImage ( buttonOpenMapshop, "files/maps.png")
guiStaticImageLoadImage ( buttonOpenNormalshop, "files/shop.png")
guiStaticImageLoadImage ( buttonOpenPVP, "files/pvp.png")
guiStaticImageLoadImage ( buttonOpenWIP, "files/stop.png")
else
if getElementData(getLocalPlayer(),"isLoggedIn") then
showChat ( false )
gIsGuiShown = true
showCursor(true)
gSelected = 0
guiStaticImageLoadImage ( gWindowGui[1], "files/closen.png")
setElementData(getLocalPlayer(), "guiIsVisible", true)
showPlayerHudComponent ( "radar", false )
gGuiErrorText = false
gSelectedMapTab = 0
else
outputChatBox("Please login to use the GUI", 255,0,0)
end
end
end)
addEventHandler( "onClientMouseEnter", getRootElement( ),
function ( x, y )
gShowTooltip = false
if source and gIsGuiShown == true then
if getElementData(source, "guiTooltip") ~= false then
gShowTooltip = source
guiStaticImageLoadImage ( source, getElementData(source, "guiHoverIcon"))
end
if gWindowGui[1] == source then
guiStaticImageLoadImage ( gWindowGui[1], "files/closeh.png")
end
if buttonOpenMapshop == source then
guiStaticImageLoadImage ( buttonOpenMapshop, "files/maps_h.png")
end
if buttonOpenNormalshop == source then
guiStaticImageLoadImage ( buttonOpenNormalshop, "files/shop_h.png")
end
if buttonOpenPVP == source then
guiStaticImageLoadImage ( buttonOpenPVP, "files/pvp_h.png")
end
if buttonOpenWIP == source then
guiStaticImageLoadImage ( buttonOpenWIP, "files/stop_h.png")
end
end
end
)
addEventHandler( "onClientMouseLeave", getRootElement( ),
function ( x, y )
if source and gIsGuiShown == true then
if getElementData(source, "guiTooltip") ~= false then
gShowTooltip = false
guiStaticImageLoadImage ( source, getElementData(source, "guiIcon"))
end
if gWindowGui[1] == source then
guiStaticImageLoadImage ( gWindowGui[1], "files/closen.png")
end
if buttonOpenMapshop == source then
guiStaticImageLoadImage ( buttonOpenMapshop, "files/maps.png")
end
if buttonOpenNormalshop == source then
guiStaticImageLoadImage ( buttonOpenNormalshop, "files/shop.png")
end
if buttonOpenPVP == source then
guiStaticImageLoadImage ( buttonOpenPVP, "files/pvp.png")
end
if buttonOpenWIP == source then
guiStaticImageLoadImage ( buttonOpenWIP, "files/stop.png")
end
end
end
)
Alles anzeigen
MfG.