Jump to content

Panel engine load help me


JoZeF

Recommended Posts

I have panel and I want to add function see " floder Shaders > Car >odblask.lua,odblask.fx>images>smallnoise...

> Infer > infer-c.lua,infernus.lua>images>infernus.txd , .dff

>Water >c_water.lua , water.fx>images>smallnoise...

code infernus

function replaceModel()  
  txd = engineLoadTXD("images/infernus.txd", 411 ) 
  engineImportTXD(txd, 411) 
  dff = engineLoadDFF("images/infernus.dff", 411 ) 
  engineReplaceModel(dff, 411) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
  
addCommandHandler ( "reloadcar", replaceModel ) 

code infer-c

function InferreplaceModel(Who,data) 
    if Who ~= getLocalPlayer() then return end 
    if data == 1 then 
        guiLabelSetColor(shaders[3],0,255,0) 
        guiCheckBoxSetSelected(shaderCheckBox[3],true) 
        if not myreplaceModel then 
            myreplaceModel, tec = replaceModel ( "Shaders/Infer/infernus.lua" ) 
            textureVol = engineLoadTXD ( "Shaders/Infer/images/infernus.txd" ) 
            textureCube = engineLoadDFF ( "Shaders/Infer/images/infernus.dff" ) 
            dxSetShaderValue ( myreplaceModel, "microflakeNMapVol_Tex", textureVol ) 
            dxSetShaderValue ( myreplaceModel, "showroomMapCube_Tex", textureCube ) 
            engineReplaceModel ( myreplaceModel, "411" ) 
        end 
    else 
        guiLabelSetColor(shaders[3],255,0,0) 
        guiCheckBoxSetSelected(shaderCheckBox[3],false) 
        if myInferShader then 
            destroyElement(myreplaceModel) 
            myreplaceModel = nil         
        end 
    end 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 

Code in panel Client ..

gRoot = getRootElement() 
sW,sH = guiGetScreenSize()
myCash = "???"
myWinsDD = "???"
myWinsDM = "???"
myPlayedDD = "???"
myPlayedDM = "???"
myRatioDD = "???"
myRatioDM = "???"
myPlayedTime = "???"
myHunters = "???"
myMapBuys = "???"
myACCount = "???"
myTopTimes = "???"
 
topButton = {}
topButtons = {}
topButtons[1] = {"Top Cash","cash"}
topButtons[2] = {"Top Achievements","achievements"}
topButtons[3] = {"Top DDs","dds"}
topButtons[4] = {"Top DMs","dms"}
topButtons[5] = {"Top DD wins","ddwins"}
topButtons[6] = {"Top DM wins","dmwins"}
topButtons[7] = {"Top DD ratio","ddratio"}
topButtons[8] = {"Top DM ratio","dmratio"}
topButtons[9] = {"Top Map Buys","mapbuys"}
topButtons[10] = {"Top Played Time","playedtime"}
topButtons[11] = {"Top Hunters","hunters"}
topButtons[12] = {"Top TopTimes","toptimes"}
topButtons[13] = {"Top DD Map","ddmap"}
topButtons[14] = {"Top DM Map","dmmap"}
 
shaders = {}
shaderCheckBox = {}
shaderNames ={
"Car Shader",
"Water Shader",
"KmE Infernus "
}
shaderHelpNames = {
"Realistic vehicle reflections",
"Realistic water texture and reflections",
"KmE Infernus tuning"
}
 
PlayerDataGUI={}
UserDataGUI={}
UserDataNames={
"Name","Age","BirthDay","Country","Languages","City","Family","Pets","Boyfriend","GirlFriend","E-mail","GG","ICQ","MSN","Site","Hobby","Interest","Fav. Car","Games","PC"
}
 
Achievement = {}
AchievementImages = {}
AchievementsName = {
"First Win!", -- 1sze zwyciestwo            1
"First Hunter!", -- 1szy hunter             2
"Top Winner!", -- 300 wins                  3
"Awesome Winner!", -- 1000 wins             4
"Top Gamer!", -- 2000 map                   5
"Long Time Player!", -- 7 dni               6
"Hunter Owner!", -- hunter 50 razy          7
"Beat my TT kid!", -- pierwszy TT           8
"5 Maps In a Row LOL!", -- 5x               9
"Triple Deathmatch!", -- 3x dm pod rzad     10
"Triple Dest. Derby!", -- 3x DD             11
"Hunter Power", -- hunterfight z 3 graczami 12
"Map Buyer", -- 10 razy kupic mape          13
"Top Times collector!", -- 50 toptimow      14
"Rich player!", -- 1 mln                    15
}
 
AchievementsHelpName = {
"Win a DM or DD map", -- 1sze zwyciestwo
"Get your first hunter", -- 1szy hunter
"Get 300+ wins", -- 300 wins
"Get 1000+ wins", -- 1000 wins
"Play 2000+ maps", -- 2000 map
"Get 7 days (play time) in stats", -- 7 dni
"Get Hunter 50+ times", -- hunter 50 razy
"Get Your First TopTime", -- pierwszy TT
"Win 5 maps in a row", -- 5 maps in a row
"Win DM map 3 times in a row", -- 3x dm pod rzad
"Win DD map 3 times in a row", -- 3x DD
"Win a hunter fight with 3+ players", -- hunterfight z 3 graczami
"Buy a map 10 times", -- 10 razy kupic mape
"Get 50 Top times", -- 50 toptimow
"Get 1 mln $", -- 1 mln
}
 
------------------------------------------
-- Panel
------------------------------------------
function startGUI()
    addEventHandler ( "onClientRender", gRoot, showCash )
    Tab = {}
   
   
   
    PanelImage = guiCreateStaticImage( 0.14,0.12,0.7,0.75, "img/electro.png", true )
    Panel = guiCreateWindow(0.2,0.2,0.6,0.6,"Exploding Gamers - User Panel",true)
    guiSetAlpha(Panel,1)
    guiWindowSetSizable(Panel,false)
    guiWindowSetMovable(Panel,false)
    --[[Panel2 = guiCreateWindow(0.2,0.2,0.37,0.6,"Player's User Data",true)
    guiSetAlpha(Panel2,1)
    guiWindowSetSizable(Panel2,false)]]--
   
    TabPanel = guiCreateTabPanel(0.01,0.05,0.6,0.94,true,Panel)
    Tab[1] = guiCreateTab("Achievements",TabPanel)
    Tab[2] = guiCreateTab("Players",TabPanel)
    --Tab[4] = guiCreateTab("User Data",TabPanel)
    Tab[3] = guiCreateTab("Maps",TabPanel)
    Tab[5] = guiCreateTab("Top Lists",TabPanel)
    Tab[6] = guiCreateTab("Texture",TabPanel)
 
    MyStatsTextGUI = guiCreateLabel ( 0.65, 0.1, 0.3, 0.1, "Your Stats:", true , Panel)
    guiLabelSetColor ( MyStatsTextGUI, 0, 70, 255 )
    guiSetFont ( MyStatsTextGUI, "default-bold-small" )
    -- MAIN PANEL STATS
    myCashGUI = guiCreateLabel ( 0.65, 0.25, 0.25, 0.05, "Money: $"..myCash.."", true , Panel)
    myPlayedDDGUI = guiCreateLabel ( 0.65, 0.3, 0.15, 0.05, "DDs: "..myPlayedDD.."", true , Panel)
    myWinsDDGUI = guiCreateLabel ( 0.65, 0.35, 0.15, 0.05, "Wins (DD): "..myWinsDD.."", true , Panel)
    myRatioDDGUI = guiCreateLabel ( 0.65, 0.4, 0.15, 0.05, "Ratio (DD): "..myRatioDD.."%", true , Panel)
    myPlayedDMGUI = guiCreateLabel ( 0.85, 0.3, 0.15, 0.05, "DMs: "..myPlayedDM.."", true , Panel)
    myWinsDMGUI = guiCreateLabel ( 0.85, 0.35, 0.15, 0.05, "Wins (DM): "..myWinsDM.."", true , Panel)
    myRatioDMGUI = guiCreateLabel ( 0.85, 0.4, 0.15, 0.05, "Ratio (DD): "..myRatioDM.."%", true , Panel)
    myPlayedTimeGUI = guiCreateLabel ( 0.65, 0.45, 0.3, 0.05, "Played Time: "..myPlayedTime.."", true , Panel)
    myHuntersGUI = guiCreateLabel ( 0.65, 0.5, 0.3, 0.05, "Hunters: "..myHunters.."", true , Panel)
    myMapBuysGUI = guiCreateLabel ( 0.65, 0.55, 0.3, 0.05, "Map Buys: "..myMapBuys.."", true , Panel)
    myACCountGUI = guiCreateLabel ( 0.65, 0.6, 0.3, 0.05, "Achievements: "..myACCount.."/15", true , Panel)
    myTopTimesGUI = guiCreateLabel ( 0.65, 0.65, 0.3, 0.05, "Top Times: "..myTopTimes.."", true , Panel)
    guiCreateStaticImage ( 0.7, 0.6, 0.25, 1, "img/Stats.png", true, Panel )
 
    -- TAB 1 - AC
    ScrollPane = guiCreateScrollPane( 0.05, 0.05, 0.9, 0.9, true, Tab[1])
    for i=1,#AchievementsName do       
        local image = guiCreateStaticImage ( 0, 0.05+0.15*i, 0.9, 0.14, "img/black.png", true, ScrollPane )
        guiSetEnabled ( image, false )
        Achievement[i] = guiCreateLabel ( 0.05, 0.06+0.15*i, 0.6, 0.04, "Achievement #"..i..": "..AchievementsName[i].."", true , ScrollPane)
        guiSetFont(Achievement[i],"default-bold-small")
        guiLabelSetColor(Achievement[i],255,0,0)
        local label = guiCreateLabel ( 0.05, 0.1+0.15*i, 0.6, 0.04, AchievementsHelpName[i], true , ScrollPane)
        guiSetFont(label,"default-bold-small")
        AchievementImages[i] = guiCreateStaticImage ( 0.75, 0.074+0.15*i, 0.15, 0.1, "img/loc.png", true, ScrollPane )
        guiSetEnabled ( AchievementImages[i], false )
    end
 
    -- TAB 2 - Players
    PlayersListGUI = guiCreateGridList ( 0.05, 0.05, 0.35, 0.9, true, Tab[2] )
    guiGridListSetSortingEnabled(PlayersListGUI,false)
    playerListColumnGUI = guiGridListAddColumn ( PlayersListGUI, "Player", 0.9 )
    for id, playeritem in ipairs(getElementsByType("player")) do
        local row = guiGridListAddRow ( PlayersListGUI )
        guiGridListSetItemText ( PlayersListGUI, row, playerListColumnGUI, getPlayerName ( playeritem ), false, false )
    end
    MyStatsText2GUI = guiCreateLabel ( 0.5, 0.1, 0.5, 0.1, "Player's Stats:", true , Tab[2])
    guiLabelSetColor ( MyStatsText2GUI, 0, 70, 255 )
    guiSetFont ( MyStatsText2GUI, "default-bold-small" )
    playerCashGUI = guiCreateLabel ( 0.45, 0.25, 0.25, 0.05, "Money: $"..myCash.."", true , Tab[2])
    playerPlayedDDGUI = guiCreateLabel ( 0.45, 0.3, 0.25, 0.05, "DDs: "..myPlayedDD.."", true , Tab[2])
    playerWinsDDGUI = guiCreateLabel ( 0.45, 0.35, 0.25, 0.05, "Wins (DD): "..myWinsDD.."", true , Tab[2])
    playerRatioDDGUI = guiCreateLabel ( 0.45, 0.4, 0.25, 0.05, "Ratio (DD): "..myRatioDD.."%", true , Tab[2])
    playerPlayedDMGUI = guiCreateLabel ( 0.70, 0.3, 0.25, 0.05, "DMs: "..myPlayedDM.."", true , Tab[2])
    playerWinsDMGUI = guiCreateLabel ( 0.70, 0.35, 0.25, 0.05, "Wins (DM): "..myWinsDM.."", true , Tab[2])
    playerRatioDMGUI = guiCreateLabel ( 0.70, 0.4, 0.25, 0.05, "Ratio (DD): "..myRatioDM.."%", true , Tab[2])
    playerPlayedTimeGUI = guiCreateLabel ( 0.45, 0.45, 0.5, 0.05, "Played Time: "..myPlayedTime.."", true , Tab[2])
    playerHuntersGUI = guiCreateLabel ( 0.45, 0.5, 0.5, 0.05, "Hunters: "..myHunters.."", true , Tab[2])
    playerMapBuysGUI = guiCreateLabel ( 0.45, 0.55, 0.5, 0.05, "Map Buys: "..myMapBuys.."", true , Tab[2])
    playerACCountGUI = guiCreateLabel ( 0.45, 0.6, 0.5, 0.05, "Achievements: "..myACCount.."/15", true , Tab[2])
    playerTopTimesGUI = guiCreateLabel ( 0.45, 0.65, 0.5, 0.05, "Top Times: "..myTopTimes.."", true , Tab[2])
   
   
    -- TAB 5 - Tops
    TopGrid = guiCreateGridList ( 0.3, 0.05, 0.65, 0.9, true, Tab[5] )
    ColA = guiGridListAddColumn ( TopGrid, "Pos", 0.1 )
    ColB = guiGridListAddColumn ( TopGrid, "Player / MapName", 0.55 )
    guiGridListSetScrollBars ( TopGrid, false, true )
   
    for i=1,#topButtons do
        topButton[i] = guiCreateButton ( 0.05, 0.05+(i-1)*0.05, 0.2, 0.045, topButtons[i][1], true, Tab[5] )
    end
    -- TAB 6 - Shaders
    ScrollPaneShaders = guiCreateScrollPane( 0.05, 0.05, 0.9, 0.9, true, Tab[6])
    for i=1,#shaderNames do    
        local image = guiCreateStaticImage ( 0, 0.05+0.15*i, 1, 0.14, "img/black.png", true, ScrollPaneShaders )
        guiSetEnabled ( image, false )
        shaders[i] = guiCreateLabel ( 0.05, 0.06+0.15*i, 0.6, 0.04, "Shader #"..i..": "..shaderNames[i].."", true , ScrollPaneShaders)
        guiSetFont(shaders[i],"default-bold-small")
        guiLabelSetColor(shaders[i],255,0,0)
        local label = guiCreateLabel ( 0.05, 0.1+0.15*i, 0.6, 0.04, shaderHelpNames[i], true , ScrollPaneShaders)
        guiSetFont(label,"default-bold-small")
        shaderCheckBox[i] = guiCreateCheckBox ( 0.75, 0.074+0.15*i, 0.15, 0.1, "", false,true, ScrollPaneShaders )
    end
   
    --playerUserDataGUI = guiCreateButton ( 0.55, 0.9, 0.4, 0.05, "User Data", true, Tab[2] )
    -- TAB 4 - UserDataGUI
    --[[for i=1,10 do
        local image = guiCreateStaticImage ( -0.1+i/10, 0.01, 0.05, 0.98, "img/black.png", true, Tab[4] )
        guiSetAlpha(image,0.2)
        guiSetEnabled ( image, false )
        local image = guiCreateStaticImage ( -0.1+i/10, 0.01, 0.01, 0.98, "img/black.png", true, Tab[4] )
        guiSetAlpha(image,0.2)
        guiSetEnabled ( image, false )
    end
    for i=1,10 do
        UserDataGUI[i] = guiCreateEdit( 0.15, -0.075+i/10, 0.3, 0.05, "", true, Tab[4] )
        local text = guiCreateLabel ( 0.02, -0.07+i/10, 0.13, 0.05, UserDataNames[i], true , Tab[4])
    end
    for i=11,20 do
        UserDataGUI[i] = guiCreateEdit( 0.65, -0.075+(i-10)/10, 0.3, 0.05, "", true, Tab[4] )
        local text = guiCreateLabel ( 0.52, -0.07+(i-10)/10, 0.13, 0.05, UserDataNames[i], true , Tab[4])
    end
    local image = guiCreateStaticImage ( 0.499, 0.01, 0.002, 0.98, "img/white.png", true, Tab[4] )
    -- Player's USerData
    for i=1,10 do
        local image = guiCreateStaticImage ( -0.1+i/10, 0.01, 0.05, 0.98, "img/black.png", true, Panel2 )
        guiSetAlpha(image,0.2)
        guiSetEnabled ( image, false )
        local image = guiCreateStaticImage ( -0.1+i/10, 0.01, 0.01, 0.98, "img/black.png", true, Panel2 )
        guiSetAlpha(image,0.2)
        guiSetEnabled ( image, false )
    end
    for i=1,10 do
        PlayerDataGUI[i] = guiCreateEdit( 0.15, -0.065+i/10, 0.3, 0.05, "", true, Panel2 )
        guiSetEnabled(PlayerDataGUI[i],false)
        local text = guiCreateLabel ( 0.02, -0.05+i/10, 0.13, 0.05, UserDataNames[i], true , Panel2)
    end
    for i=11,20 do
        PlayerDataGUI[i] = guiCreateEdit( 0.65, -0.065+(i-10)/10, 0.3, 0.05, "", true, Panel2 )
        guiSetEnabled(PlayerDataGUI[i],false)
        local text = guiCreateLabel ( 0.52, -0.05+(i-10)/10, 0.13, 0.05, UserDataNames[i], true , Panel2)
    end
    CloseButtonGUI = guiCreateButton ( 0.96, 0.03, 0.04, 0.05, "X", true, Panel2 )
    local image = guiCreateStaticImage ( 0.499, 0, 0.002, 10, "img/white.png", true, Panel2)
    local image = guiCreateStaticImage ( 0.499, 0.5, 0.002, 10, "img/white.png", true, Panel2)--]]
    -- TAB 3 - Maps
    MapsFilterGUI = guiCreateEdit( 0.05, 0.05, 0.6, 0.04, "", true, Tab[3] )
    --MapFilterButGUI = guiCreateButton ( 0.7, 0.05, 0.25, 0.04, "Search", true, Tab[3] )
    MapsGridListGUI = guiCreateGridList ( 0.05, 0.1, 0.6, 0.8, true, Tab[3] )
    guiGridListSetSortingEnabled(MapsGridListGUI,false)
    guiGridListAddColumn ( MapsGridListGUI, "Map", 0.9 )
    setTimer(function()callServerfunction("getServerMaps",getLocalPlayer()) end,500,1)
    BuyMapGUI = guiCreateButton ( 0.7, 0.1, 0.25, 0.1, "Buy Map\n-$10.000", true, Tab[3] )
    unBuyMapGUI = guiCreateButton ( 0.7, 0.25, 0.25, 0.1, "unBuy Map\n+$7.500", true, Tab[3] )
    --MarkMapGUI = guiCreateButton ( 0.7, 0.4, 0.25, 0.1, "Fav Map", true, Tab[3] )
    --unMarkMapGUI = guiCreateButton ( 0.7, 0.55, 0.25, 0.1, "unFav Map", true, Tab[3] )
 
    guiCreateStaticImage ( 0.7, 0.8, 0.25, 0.2, "img/Maps.png", true, Tab[3] )
    guiSetVisible ( Panel, false )  
    guiSetVisible ( PanelImage, false )     
    --guiSetVisible(Panel2,false)
    bindKey("f7","down",guiToggleVisible)
Link to comment

What's wrong with people taking other people scripts and using it for there reason, just ask the owner of the script if you can do ... with the script, and maybe they might even help with your script...

CAN A MOD LOCK THIS!

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...