Jump to content

I have buy nextmap problem?


Recommended Posts

Hi guys;

I don't buy nextmap :(

I list maps but not bought

NOTE:THERE İSN'T MY CODE!!!

Client Side

  
--[[*****************************************
*   NOTE: Editing only allowed for 8Q *
*   8Q For ever                      *
*-------------------------------------------*
*   client.lua -- client               *
*                       by 8Q      *
*********************************************]]
 
 
 
 
 
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
 
screenWidth,screenHeight = guiGetScreenSize()
    mainWindowWidth = 619
    mainWindowHeight = 365
    selectedR, selectedG, selectedB = 255, 153, 0
 
    tabs = {}
    window = guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight+75, "Fuck Zone Academy Buy Map System by-Changes#", false)
   
    guiWindowSetMovable(window, true)
    guiWindowSetSizable(window, false)
   
    guiGridListSetSelectionMode(window,2)
    guiSetVisible(window,false)
   
    tabs[1] = guiCreateTabPanel(0,60,mainWindowWidth,mainWindowHeight,false,window)
    tabs[5] = guiCreateTab("Buy Map's",tabs[1])
   
    x = guiCreateButton(575,10,20,20,"X",false,tabs[5])
   
    gridMaps = guiCreateGridList(17,51,315,285,false,tabs[5])
    guiGridListSetSortingEnabled(gridMaps,false)
    guiGridListAddColumn(gridMaps,"FZA// Server Map List",0.9)
 
    lblMapsInfo = guiCreateLabel(342,210,245,45,"",false,tabs[5])
    guiLabelSetVerticalAlign(lblMapsInfo,"center")
    guiLabelSetHorizontalAlign(lblMapsInfo,"center",true)
    guiSetFont(lblMapsInfo,"default-bold-small")
   
   
   
 
   
    lblTotalMapsOnServer = guiCreateLabel(342,28,193,19,"Total maps on the server: N/A",false,tabs[5])
    guiSetFont(lblTotalMapsOnServer,"default-bold-small")
    guiLabelSetColor(lblTotalMapsOnServer,255,153,0)
 
    lblTotalDmMaps = guiCreateLabel(342,47,193,19,"Total DM maps: N/A",false,tabs[5])
    guiSetFont(lblTotalDmMaps,"default-bold-small")
    guiLabelSetColor(lblTotalDmMaps,255,255,255)
 
    lblTotalDdMaps = guiCreateLabel(342,62,193,19,"Total DD maps: N/A",false,tabs[5])
    guiSetFont(lblTotalDdMaps,"default-bold-small")
    guiLabelSetColor(lblTotalDdMaps,255,153,0)
   
    lblSelectedMapNameTitles = guiCreateLabel(342,230,193,19,"Script by",false,tabs[5])
    guiSetFont(lblSelectedMapNameTitles,"default-bold-small")
   
    lblSelectedMapNameTitless = guiCreateLabel(342,230,193,19,"                     FZA//",false,tabs[5])
    guiSetFont(lblSelectedMapNameTitless,"default-bold-small")
    guiLabelSetColor(lblSelectedMapNameTitless,255,153,0)
   
    lblSelectedMapNameTitlesss = guiCreateLabel(342,230,193,19,"                                   *",false,tabs[5])
    guiSetFont(lblSelectedMapNameTitlesss,"default-bold-small")
    guiLabelSetColor(lblSelectedMapNameTitlesss,255,255,255)
   
    lblSelectedMapNameTitlexz = guiCreateLabel(342,230,193,19,"                                     ",false,tabs[5])
    guiSetFont(lblSelectedMapNameTitlexz,"default-bold-small")
    guiLabelSetColor(lblSelectedMapNameTitlexz,111,111,111)
   
    lblSelectedMapNameTitlex = guiCreateLabel(342,230,193,19,"                                       8Q",false,tabs[5])
    guiSetFont(lblSelectedMapNameTitlex,"default-bold-small")
    guiLabelSetColor(lblSelectedMapNameTitlex,255,153,0)
 
    lblSetNextMapTitle = guiCreateLabel(342,189,245,16,"Set a next map",false,tabs[5])
    guiLabelSetColor(lblSetNextMapTitle,255,153,0)
    guiLabelSetVerticalAlign(lblSetNextMapTitle,"center")
    guiLabelSetHorizontalAlign(lblSetNextMapTitle,"center",false)
    guiSetFont(lblSetNextMapTitle,"default-bold-small")
 
    lblSearchForMaps = guiCreateLabel(25,25,101,14,"Search for maps:",false,tabs[5])
    guiLabelSetColor(lblSearchForMaps,255,153,0)
    guiLabelSetVerticalAlign(lblSearchForMaps,"center")
    guiSetFont(lblSearchForMaps,"default-bold-small")
 
    lblSelectedMapNameTitle = guiCreateLabel(342,97,245,16,"Selected map name:",false,tabs[5])
    guiLabelSetColor(lblSelectedMapNameTitle,255,153,0)
    guiSetFont(lblSelectedMapNameTitle,"default-bold-small")
 
    lblSelectedMapAuthorTitle = guiCreateLabel(342,136,245,16,"Map type:",false,tabs[5])
    guiLabelSetColor(lblSelectedMapAuthorTitle,255,153,0)
    guiSetFont(lblSelectedMapAuthorTitle,"default-bold-small")
 
 
    lblSelectedMapName = guiCreateLabel(342,113,245,16,"N/A",false,tabs[5])
 
    lblSelectedMapAuthor = guiCreateLabel(342,152,245,16,"N/A",false,tabs[5])
 
 
    lblMapTabLine1 = guiCreateLabel(342,309,245,27,"************************************************************",false,tabs[5])
    guiLabelSetColor(lblMapTabLine1,0,255,0)
    guiLabelSetVerticalAlign(lblMapTabLine1,"center")
    guiLabelSetHorizontalAlign(lblMapTabLine1,"center",false)
    guiSetFont(lblMapTabLine1,"default-bold-small")
 
    lblMapTabLine2 = guiCreateLabel(342,173,245,16,"************************************************************",false,tabs[5])
    guiLabelSetColor(lblMapTabLine2,255,0,0)
    guiLabelSetVerticalAlign(lblMapTabLine2,"center")
    guiLabelSetHorizontalAlign(lblMapTabLine2,"center",false)
    guiSetFont(lblMapTabLine2,"default-bold-small")
 
    lblMapTabLine3 = guiCreateLabel(342,81,245,16,"************************************************************",false,tabs[5])
    guiLabelSetColor(lblMapTabLine3,0,255,255)
    guiLabelSetVerticalAlign(lblMapTabLine3,"center")
    guiLabelSetHorizontalAlign(lblMapTabLine3,"center",false)
    guiSetFont(lblMapTabLine3,"default-bold-small")
 
    editMapSearch = guiCreateEdit(129,23,198,21,"",false,tabs[5])
 
    btnBuyNextMap = guiCreateButton(380,265,169,44,"Buy as next map - $10.000",false,tabs[5])
   
   
   
   
        GUIEditor_Image = {}
   
    background = guiCreateStaticImage(0.0165,0.0549,0.9669,0.9191,"images/background.jpg",true,window)
    guiSetAlpha(background,1)
     guiSetProperty(background,"Disabled","true")
     GUIEditor_Image[1] = guiCreateStaticImage(0.4081,0.0723,0.5643,0.185,"images/logo.png",true,window)
    guiSetAlpha(GUIEditor_Image[1],1)
     guiSetProperty(GUIEditor_Image[1],"Disabled","true")
 
addEventHandler("onClientResourceStart", getRootElement(),
function(res)
    if res == getThisResource() then
        bindKey ("F7", "down", guiackapa)
    end
end)
 
function guiackapa ()
    if guiGetVisible ( window ) then
        guiSetVisible ( window, false )
        showCursor(false)
    else
        guiSetVisible (window, true)
        showCursor (true)
    end
end
addEvent( "guiackapa", true )
addEventHandler( "guiackapa", getRootElement(), guiackapa )
 
 
function getMaps()
    totalServerMaps = 0
    totalDmMaps = 0
    totalDdMaps = 0
    setTimer(callServerFunction,500,1,"getServerMaps",getLocalPlayer())
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getMaps)
 
function loadMaps(gamemodeMapTable, gamemode, map)
    guiGridListClear(gridMaps)
    if gamemodeMapTable then
        aGamemodeMapTable = gamemodeMapTable
        for id,gamemode in pairs (gamemodeMapTable) do
            if (gamemode.name == "Race") then
                for id,map in ipairs (gamemode.maps) do
                    local row = guiGridListAddRow ( gridMaps )
                    guiGridListSetItemText ( gridMaps, row, 1, map.name, false, false )
                    guiGridListSetItemData ( gridMaps, row, 1, map.resname)
                    totalServerMaps = totalServerMaps+1
                    if (string.find(map.name,"[DM]",1,true)) then
                        totalDmMaps = totalDmMaps+1
                    elseif (string.find(map.name,"[DD]",1,true)) then
                        totalDdMaps = totalDdMaps+1
                    end
                    updateMapLabels(1)
                end
            end
        end
    end
end
 
 
-- Map search
function mapSearch()
    guiGridListClear(gridMaps)
    local searchString = string.lower(guiGetText(editMapSearch))
    if ( searchString == "" ) then
        for id,gamemode in pairs (aGamemodeMapTable) do
            if (gamemode.name == "Race") then
                for id,map in ipairs (gamemode.maps) do
                    local row = guiGridListAddRow ( gridMaps )
                    guiGridListSetItemText ( gridMaps, row, 1, map.name, false, false )
                    guiGridListSetItemData ( gridMaps, row, 1, map.resname)
                end
            end
        end
    else
        for id,gamemode in pairs (aGamemodeMapTable) do
            if (gamemode.name == "Race") then
                local noMapsFound = true
                for id,map in ipairs (gamemode.maps) do
                    if string.find(string.lower(map.name.." "..map.resname), searchString, 1, true) then
                        local row = guiGridListAddRow ( gridMaps )
                        guiGridListSetItemText ( gridMaps, row, 1, map.name, false, false )
                        guiGridListSetItemData ( gridMaps, row, 1, map.resname)
                        noMapsFound = false
                    end
                end
                if noMapsFound == true then
                    local row = guiGridListAddRow(gridMaps)
                    guiGridListSetItemText (gridMaps, row, 1, "No maps matching your search query!", false, false)
                    guiGridListSetItemColor (gridMaps, row, 1, 255,50,50)
                end
            end
        end
    end
    updateMapLabels(2)
end
 
function buyNextMap()
    local row,column = guiGridListGetSelectedItem(gridMaps)
    local mapName = guiGridListGetItemText(gridMaps,row,1)
    callServerFunction("buyMap",getLocalPlayer(),mapName)
end
 
 
-- Update labels
function updateMapLabels(updateMode)
    if updateMode == 1 then
        guiSetText(lblTotalMapsOnServer,"Total maps on the server: "..totalServerMaps)
        guiSetText(lblTotalDmMaps,"Total DM Maps:  "..totalDmMaps)
        guiSetText(lblTotalDdMaps,"Total DD Maps:  "..totalDdMaps)
    else
        local row,column = guiGridListGetSelectedItem(gridMaps)
        local mapName = guiGridListGetItemText(gridMaps,row,1)
        if mapName == "" then
            guiSetText(lblSelectedMapName,"N/A")
            guiSetText(lblSelectedMapAuthor,"N/A")
        else
            guiSetText(lblSelectedMapName,mapName)
            if string.find(mapName,"[DM]",1,true) then
               
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...