Jump to content

JoZeFSvK

Members
  • Posts

    201
  • Joined

  • Last visited

Everything posted by JoZeFSvK

  1. Hey i wanna create window with | https://wiki.multitheftauto.com/wiki/GuiCreateWindow | and i wanna when open window special effect etc. Ejecting above ,from below,right,left. What should I use?
  2. each 2 servers have this panel why he accused me ? I did not steal it, I do not write our name on it, i have only problem , buymap dont work
  3. client : http://pastebin.com/bUZxYfX5 server : http://pastebin.com/8J080Lg2 dxdraw: http://pastebin.com/P1hsDFnm in script is lots of things img , levels ,sounds , skins.xml,users.xml , i see error in mapmanager , buy maps dont work , i need update racevoting.lua and i dont know how .
  4. ye i think this is not full code , when i upload ? or ? who help me ?
  5. Client -- Get all maps on server 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 guiSetText(lblSelectedMapAuthor,"Deathmatch") elseif string.find(mapName,"[DD]",1,true) then guiSetText(lblSelectedMapAuthor,"Destruction Derby") elseif string.find(mapName,"[FUN]",1,true) then guiSetText(lblSelectedMapAuthor,"Fun map") else guiSetText(lblSelectedMapAuthor,"UNKNOWN") end end end end Server -- Maps function getServerMaps (loadList) local tableOut if loadList then tableOut = {} -- local deletedMaps = {} local gamemodes = {} gamemodes = call(getResourceFromName("mapmanager"), "getGamemodes") for id,gamemode in ipairs (gamemodes) do tableOut[id] = {} tableOut[id].name = getResourceInfo(gamemode, "name") or getResourceName(gamemode) tableOut[id].resname = getResourceName(gamemode) tableOut[id].maps = {} local maps = call(getResourceFromName("mapmanager"), "getMapsCompatibleWithGamemode" , gamemode) for _,map in ipairs (maps) do table.insert(tableOut[id]["maps"] ,{name = getResourceInfo(map, "name") or getResourceName(map), resname = getResourceName(map)}) end table.sort(tableOut[id]["maps"], sortCompareFunction) end table.sort((tableOut), sortCompareFunction) table.insert(tableOut, {name = "no gamemode", resname = "no gamemode", maps = {}}) local countGmodes = #tableOut local maps = call(getResourceFromName("mapmanager"), "getMapsCompatibleWithGamemode") for id,map in ipairs (maps) do -- if fileOpen(":"..getResourceName(map).."/deleted") then -- table.insert(deletedMaps ,{name = getResourceInfo(map, "name") or getResourceName(map), resname = getResourceName(map)}) -- else table.insert(tableOut[countGmodes]["maps"] ,{name = getResourceInfo(map, "name") or getResourceName(map), resname = getResourceName(map)}) -- end end -- table.sort(deletedMaps, sortCompareFunction) table.sort(tableOut[countGmodes]["maps"], sortCompareFunction) -- table.insert(tableOut, {name = "deleted maps", resname = "deleted maps", maps = {}}) -- local countGmodes = countGmodes + 1 -- tableOut[countGmodes]["maps"] = deletedMaps end local map = call(getResourceFromName("mapmanager"), "getRunningGamemodeMap") local gamemode = call(getResourceFromName("mapmanager"), "getRunningGamemode") gamemode = gamemode and getResourceName(gamemode) or "N/A" map = map and getResourceName(map) or "N/A" callClientFunction(loadList,"loadMaps", tableOut, gamemode, map) end function sortCompareFunction(s1, s2) if type(s1) == "table" and type(s2) == "table" then s1, s2 = s1.name, s2.name end s1, s2 = s1:lower(), s2:lower() if s1 == s2 then return false end local byte1, byte2 = string.byte(s1:sub(1,1)), string.byte(s2:sub(1,1)) if not byte1 then return true elseif not byte2 then return false elseif byte1 < byte2 then return true elseif byte1 == byte2 then return sortCompareFunction(s1:sub(2), s2:sub(2)) else return false end end function callGetMaps() for i,player in ipairs(getElementsByType("player")) do callClientFunction(player,"getMaps") end end addCommandHandler("rebuildMaps",callGetMaps) and -- Buy a next map -- function buyMap(thePlayer,mapName) -- local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) -- local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) -- if mapIsAlreadySet == false then -- if not (mapName == "") then -- if playerLevel >= mapLevel then -- if playerCash >= mapCost then -- triggerEvent("onExternalNextmapRequest",thePlayer,thePlayer,mapName) -- else -- outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true) -- end -- else-- -- outputChatBox("#FF6600* #FFFFFFYou need to be level #ABCDEF"..mapLevel.." #FFFFFFor higher to set maps!",thePlayer,255,255,255,true) -- end -- else -- outputChatBox("#FF6600* #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true) -- end -- else -- outputChatBox("#FF6600* #FFFFFFA map is already set at the moment! Please try again later.",thePlayer,255,255,255,true) -- end -- end function resetMapSetStatus() mapIsAlreadySet = false end addEventHandler("onMapStarting",getRootElement(),resetMapSetStatus) -- Find all maps which match the query string function findMaps( query ) local results = {} --escape all meta chars query = string.gsub(query, "([%*%+%?%.%(%)%[%]%{%}%\%/%|%^%$%-])","%%%1") -- Loop through and find matching maps for i,resource in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource())) do local resName = getResourceName( resource ) local infoName = getMapName( resource ) -- Look for exact match first if query == resName or query == infoName then return {resource} end -- Find match for query within infoName if string.find( infoName:lower(), query:lower() ) then table.insert( results, resource ) end end return results end addEvent('buyMapFromPanel', true) function buyMFP(mapname) -- if g_ForcedNextMap then -- outputChatBox('Next map is ' ..getMapName(g_ForcedNextMap), source) -- return -- end -- local query = #{mapname}>0 and table.concat({mapname},' ') or nil -- if not query then -- if g_ForcedNextMap then -- outputChatBox('Next map is ' ..getMapName(g_ForcedNextMap), source) -- else -- outputChatBox('Next map is not set', source, 255, 0, 0) -- end -- return -- end -- local map, errormsg = findMap(query) -- if not map then -- outputChatBox(errormsg, source) -- return -- end -- local playerLevel = tonumber(loadPlayerData(source,"level")) -- local playerCash = tonumber(loadPlayerData(source,"cash")) -- if playerLevel >= mapLevel then -- if playerCash >= mapCost then -- if lastmap_B == map then -- outputChatBox('That map has been played too much recently.', source, 255, 0, 0) -- else -- local TotalPlayerCash = playerCash - mapCost -- g_ForcedNextMap = map -- outputChatBox(getPlayerName(source).. " bought map '" ..getMapName(g_ForcedNextMap).. "' for "..mapCost.."$.", g_Root, 0, 240, 0) -- savePlayerData(source,"cash", TotalPlayerCash) -- lastmap_B = g_ForcedNextMap -- achievement31(source) -- scoreboardRefresh(source) -- end -- else -- outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",source,255,255,255,true) -- end -- else -- outputChatBox("#FF6600* #FFFFFFYou need to be level #ABCDEF"..mapLevel.." #FFFFFFor higher to set maps!",source,255,255,255,true) -- end buyMap(source, command, mapname) end addEventHandler('buyMapFromPanel', g_Root, buyMFP) function buyMap(player, command, ...) if g_ForcedNextMap then outputChatBox( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) return end local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then outputChatBox( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) else outputChatBox( 'Next map is not set', player, 255, 0, 0 ) end return end local map, errormsg = findMap(query) if not map then outputChatBox(errormsg, player) return end local playerLevel = tonumber(loadPlayerData(player,"level")) local playerCash = tonumber(loadPlayerData(player,"cash")) if playerLevel >= mapLevel then if playerCash >= mapCost then if lastmap_B == map then outputChatBox( 'That map has been played too much recently.', player, 255, 0, 0 ) else g_ForcedNextMap = map local TotalPlayerCash = playerCash - mapCost outputChatBox("#007FFF[Map]#FFFFFF" ..getPlayerName(player).. "#FFFFFF set '#007FFF" ..getMapName(g_ForcedNextMap).."#FFFFFF' as nextmap.", getRootElement(), 0, 240, 0, true) savePlayerData(player,"cash", TotalPlayerCash) lastmap_B = g_ForcedNextMap achievement31(player) scoreboardRefresh(player) end else outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",source,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFYou need to be level #ABCDEF"..mapLevel.." #FFFFFFor higher to set maps!",source,255,255,255,true) end end addCommandHandler('bm', buyMap) addCommandHandler('buymap', buyMap) addCommandHandler("mapcount", function(source) local resourceTable = getResources() local mapcount = 0 for resourceKey, resourceValue in ipairs(resourceTable) do local type = getResourceInfo(resourceValue, "type") local game = getResourceInfo(resourceValue, "gamemodes") if type == "map" and game == "race" then mapcount = mapcount+1 else cancelEvent() end end outputChatBox("There are " ..tostring(mapcount).. " maps on the server.", source, 46, 154, 254) end ) addEvent("onScriptSetNextMap",true) addEventHandler("onScriptSetNextMap",getRootElement(), function (mapName) thePlayer = source local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) savePlayerData(thePlayer,"cash",playerCash-mapCost) outputChatBox("#FFFFFFNextmap: "..getPlayerName(thePlayer).."#FFFFFF has bought a next map!",getRootElement(),255,255,255,true) outputChatBox("#FFFFFFNextmap: #FF8800"..mapName,getRootElement(),255,255,255,true) mapIsAlreadySet = true scoreboardRefresh(thePlayer) achievement31(thePlayer) end) addEvent("onRaceSetNextMap",true) addEventHandler("onRaceSetNextMap",getRootElement(), function () mapIsAlreadySet = true end) LoL now will create something which i add to racevoting.lua in race floder , i try now create addCommandHandler('buymap', function(player, command,...) and idk ... i need help skype , email ,
  6. Hey i search scripter i have nextreme's old panel "thepanel" and when i buy maps and nothing i think problem is in racevoting.lua and i dont know edit it. who knows please coment. we can negotiate the price or something else
  7. and when i wanna add background image ? local Window = guiCreateWindow(0.2, 0.3, 0.7, 0.5, "Userpanel", false) local tabPanel = guiCreateStaticImage(0, 0, 1, 1, "bg.png", true, window) guiSetEnabled(guiBack, false) local tabPanel = guiCreateTabPanel(0, 0.1, 1, 1, true, Window) local tab1 = guiCreateTab("Stats", tabPanel) local tab2 = guiCreateTab("Players", tabPanel)
  8. i think when player reached hunter ,after a few minutes or sec i see drawtext Time for a Hunter Fight
  9. i open it but I can not close
  10. hmm i press f1 and nothing i see panel and when i press f1 nothing
  11. and i have question how i show cursor ?
  12. hey i have question i add to script bind key and dont work local Window = guiCreateWindow ( 0, 0, 0.5, 0.4, "Information", true )--create a window which has "Information" in the title bar. local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, Window ) local tabMap = guiCreateTab( "Map Information", tabPanel ) local tabHelp = guiCreateTab( "Help", tabPanel ) guiCreateLabel(0.02,0.04,0.94,0.2,"This is information about the current map",true,tabMap) guiCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,tabHelp) function funkcia() guiSetVisible (Window, true) end bindKey ( localPlayer, "F1", "down", funkcia )
  13. nothing , i reached hunter , wait some minutes and nothing
  14. i reached hunter and waiting some minutes and nothing
  15. yes , i have dxdraw text in client 2
  16. addEventHandler("start_AllHunters",getRootElement(), triggerClientEvent("AllHunters",getRootElement()) end end) this ?
  17. addEventHandler("onAllHunter",getRootElement(), triggerClientEvent("onAllHunter",getRootElement()) end end) ? this is not god
  18. ok sorry , Lock topic
  19. Hey i need help with server side function waiting() if drawing == true then setTimer(start_AllHunters, 5000,1) else setTimer(start_AllHunters, 50,1) end end addEvent("onAllHunter",true) addEventHandler("onAllHunter",getRootElement(),waiting) function start_AllHunters() removeEventHandler("onClientRender",getRootElement(),AllHunters) addEventHandler("onClientRender",getRootElement(),AllHunters) setTimer(stop_AllHunters,5000,1) getTickStart = getTickCount () end function stop_AllHunters() removeEventHandler("onClientRender",getRootElement(),AllHunters) end function AllHunters() local getTickNow = getTickCount () - getTickStart if getTickNow <= 1000 then alfa = getTickNow/1000 elseif getTickNow >= 4000 then alfa = (5000-getTickNow)/1000 else alfa = 1 end alfa = alfa * alfa * alfa dxDrawColorText("Time for a Hunter Fight !",1,sy/3-1,sx+1,sy-1,tocolor(0,0,0,alfa*200),(2.5*sx/1920)*alfa*1.6,"default-bold","center","center",true) and i start write server side addEvent("onAllHunter",true) addEventHandler("onAllHunter",getRootElement(), triggerClientEvent("onAllHunter",getRootElement()) end end) where is problem ?
  20. i edit only in "..." all sentence in turkish i edit
×
×
  • Create New...