SoundWave
Members-
Posts
39 -
Joined
-
Last visited
Everything posted by SoundWave
-
Come on plz help me
-
well before all that i used this script: client sided: function loadMaps(gamemodeMapTable, gamemode, map) guiGridListClear(Shop) local totalServerMaps = 0 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 (Shop) guiGridListSetItemText(Shop, row, 1, map.name, false, false) totalServerMaps = totalServerMaps + 1 end end end end end triggerServerEvent('getMaps', g_Root) addEvent("sendMaps",true) addEventHandler("sendMaps",getRootElement(),loadMaps) -- Map search function mapSearch() guiGridListClear(Shop) local searchString = string.lower(guiGetText(ResourceListSearch)) 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 (Shop) guiGridListSetItemText(Shop, row, 1, map.name, false, false) 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 (Shop) guiGridListSetItemText(Shop, row, 1, map.name, false, false) noMapsFound = false end end if noMapsFound == true then local row = guiGridListAddRow(Shop) guiGridListSetItemText (Shop, row, 1, "No maps matching your search query!", false, false) guiGridListSetItemColor (Shop, row, 1, 0,0,255) end end end end end addEventHandler("onClientGUIChanged",ResourceListSearch,mapSearch) Server sided: -- GET SERVER MAPS function getMaps (loadList) if checkClient( true, source, 'getServerMaps' ) then return end 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" triggerClientEvent(source ,"loadMaps", source, 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 addEvent("getMaps", true) addEventHandler("getMaps", g_Root, getMaps) -- END GET SERVER MAPS But then it didnt show the maps but the map search worked
-
you mean this table.insert(tableOut[countGmodes]["maps"] ,{name = getResourceInfo(map, "name") or getResourceName(map), resname = getResourceName(map)})
-
What do you mean SolidSnake? its for Race Everything works accept the search part. What is wrong with that?
-
Hello, I have a userpanel where you can buy maps i wanted to add a search option to it but that didnt went so good. When i type something in the search bar (ResourceListSearch) all maps go away and when i delete everything i typed maps dont show again. Plz help me Client Sided: triggerServerEvent('getMaps', g_Root) addEvent('sendMaps', true) addEventHandler('sendMaps', g_Root, function(name) local row = guiGridListAddRow(Shop) guiGridListSetItemText(Shop, row, 1, name, false, false) end ) -- Map search function mapSearch() guiGridListClear(Shop) local searchString = string.lower(guiGetText(ResourceListSearch)) 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 (Shop) guiGridListSetItemText(Shop, row, 1, map.name, false, false) 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 (Shop) guiGridListSetItemText(Shop, row, 1, map.name, false, false) noMapsFound = false end end if noMapsFound == true then local row = guiGridListAddRow(Shop) guiGridListSetItemText (Shop, row, 1, "No maps matching your search query!", false, false) guiGridListSetItemColor (Shop, row, 1, 0,0,255) end end end end end addEventHandler("onClientGUIChanged",ResourceListSearch,mapSearch) Server sided: function mapsList() local resourceTable = getResources() for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceInfo(resourceValue, "name") local type = getResourceInfo(resourceValue, "type") local game = getResourceInfo(resourceValue, "gamemodes") if type == "map" and game == "race" then triggerClientEvent("sendMaps", g_Root, name) else cancelEvent() end end end addEvent("getMaps", true) addEventHandler("getMaps", g_Root, mapsList)
-
Hey, I have a buy map system as you can see but i want to add a filter to it This means that when you type in that filter the mapgridlist gets smaller with options and evantually shows your map for example when i type in Tete vol 9 it shows one option in the gridlist and that should be [DM] Tete Vol 9 -Die motherfucker Die I hope you can help me
-
Hey, i have a ghostmode script it disables on DD maps and enables on DM maps the only thing that doesnt work is that it doesn't disable when it pickups a hunter pickup I dont get what the error is because i doesnt give any errors, plz help the script gmontext = get("gmontext") gmoncolor = get("gmoncolor") gmofftext = get("gmofftext") gmoffcolor = get("gmoffcolor") gmoffcolorathunter = get("gmoffcolorathunter") gmofftextathunter = get("gmofftextathunter") addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), function(mapInfo) if string.find(mapInfo.name, "[DM]", 1, true) or mapInfo.modename == "Sprint" then gmon() else gmoff() end end) function hunter(pickupID, pickupType, vehicleModel) if info == "[DM]" then if pickupType == "vehiclechange" then if vehicleModel == 425 then setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) outputChatBox(gmofftextathunter..gmoffcolorathunter,theplayer,25,125,225,true) end end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunter) function gmon() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) outputChatBox(gmoncolor..gmontext,thePlayer,186,212,71,true) end end function gmoff() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) outputChatBox(gmoffcolor..gmofftext,thePlayer,255,255,255,true) end end meta.xml <meta> <info name="Autoghostmode" author="ahmtork" type= "script" version="1.0.0"/> <script src="ghostmode.lua" type="server"/> <settings> <setting name="*gmontext" value="Ghostmode is enabled!" /> <setting name="*gmoncolor" value="#FF001E" /> <setting name="*gmofftext" value="Ghostmode is disabled!" /> <setting name="*gmoffcolor" value="#FFFFFF" /> <setting name="*gmofftextathunter" value="Ghostmode is disabled because hunter is reached!" /> <setting name="*gmoffcolorathunter" value="#ff001E" /> </settings> </meta>
-
On my Server it is like this: I am added to my clan but there doesnt stand any Description like in the 2nd foto there it is EPG (1 player)and then my name. How do i do this?
-
I have a small question. I don't know how to explain but i give an example: When an admin logs in for example /login FatBoy 1234 Then his car should turn green. Plz tell me how i can do this. Thx in advance.
-
this is the login_c.lua --******************** --* Login window * --* Made By: * --* ~EPG~SoundWave * --******************** ACCOUNT_LOGIN_SAVE = "account.xml" function buildLoginWindow(s) if (g_screenX >= 723) and (g_screenY >= 420) then local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 723, 420 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 loginWindow = guiCreateWindow(left, top, windowWidth, windowHeight, "ECR Login Window", false) guiWindowSetSizable(loginWindow, false) gui["tabLabel1"] = guiCreateTabPanel(10, 25, 401, 291, false, loginWindow) gui["tab"] = guiCreateTab("Welcome", gui["tabLabel1"]) gui["plainTextEdit_2"] = guiCreateMemo(10, 10, 371, 241, "Welcome to the Elite Command Racers DD/DM server!\n\n\nThe rules are:\n- Don’t use cheats, hacks, or any other kind that gives you advantages.\n- Don't try insult or swear\n- Do not advertise any other clans or servers!\n- Do not camp.\n- Do not block on DMs\n\n\nHave fun!\n\nGrtz. The ECR clan.", false, gui["tab"]) guiMemoSetReadOnly(gui["plainTextEdit_2"], true) gui["tab_3"] = guiCreateTab("Crew", gui["tabLabel1"]) gui["plainTextEdit_3"] = guiCreateMemo(10, 10, 381, 241, "Leaders", false, gui["tab_3"]) gui["tab_2"] = guiCreateTab("Some Info", gui["tabLabel1"]) gui["plainTextEdit"] = guiCreateMemo(10, 10, 371, 241, "haha :D", false, gui["tab_2"]) guiMemoSetReadOnly(gui["plainTextEdit"], true) gui["pushButton"] = guiCreateButton(575, 325, 135, 41, "Login", false, loginWindow) addEventHandler("onClientGUIClick", gui["pushButton"], on_login_clicked, false) gui["pushButton_2"] = guiCreateButton(430, 325, 135, 41, "Register", false, loginWindow) addEventHandler("onClientGUIClick", gui["pushButton_2"], on_register_clicked, false) nickField = guiCreateEdit(90, 325, 301, 31, "", false, loginWindow) guiEditSetMaxLength(nickField, 255) passField = guiCreateEdit(90, 375, 301, 31, "", false, loginWindow) guiEditSetMaxLength(passField, 255) gui["label_3"] = guiCreateLabel(20, 325, 61, 21, "Nickname:", false, loginWindow) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["label_4"] = guiCreateLabel(20, 375, 61, 21, "Password:", false, loginWindow) guiLabelSetHorizontalAlign(gui["label_4"], "left", false) guiLabelSetVerticalAlign(gui["label_4"], "center") autoLogInOrNot = guiCreateCheckBox(580, 385, 141, 17, "Enable serial log-in", false, false, loginWindow) gui["pushButton_3"] = guiCreateButton(430, 375, 121, 31, "Guest-mode", false, loginWindow) if on_login_as_guest then addEventHandler("onClientGUIClick", gui["pushButton_3"], on_login_as_guest, false) end guiCreateStaticImage(430, 45, 280, 270, "ECR.png", false, loginWindow) else local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 480, 367 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 loginWindow = guiCreateWindow(left, top, windowWidth, windowHeight, "ECR Login Window", false) guiWindowSetSizable(loginWindow, false) gui["tabLabel1"] = guiCreateTabPanel(10, 25, 461, 241, false, loginWindow) gui["tab"] = guiCreateTab("Welcome", gui["tabLabel1"]) gui["plainTextEdit_2"] = guiCreateMemo(10, 10, 441, 201, "Welcome to the Elite Command Racers DD/DM server!\n\n\nThe rules are:\n- Don’t use cheats, hacks, or any other kind that gives you advantages.\n- Don't try insult or swear\n- Do not advertise any other clans or servers!\n- Do not camp.\n- Do not block on DMs\n\n\nHave fun!\n\nGrtz. The ECR clan.", false, gui["tab"]) guiMemoSetReadOnly(gui["plainTextEdit_2"], true) gui["tab_3"] = guiCreateTab("Crew", gui["tabLabel1"]) gui["plainTextEdit_3"] = guiCreateMemo(10, 10, 441, 201, "Leaders", false, gui["tab_3"]) gui["tab_2"] = guiCreateTab("Some Info", gui["tabLabel1"]) gui["plainTextEdit"] = guiCreateMemo(10, 10, 441, 201, "haha :D", false, gui["tab_2"]) guiMemoSetReadOnly(gui["plainTextEdit"], true) gui["pushButton"] = guiCreateButton(280, 275, 91, 41, "Register", false, loginWindow) addEventHandler("onClientGUIClick", gui["pushButton"], on_register_clicked, false) nickField = guiCreateEdit(90, 275, 181, 31, "", false, loginWindow) guiEditSetMaxLength(nickField, 255) passField = guiCreateEdit(90, 325, 181, 31, "", false, loginWindow) guiEditSetMaxLength(passField, 255) gui["label_3"] = guiCreateLabel(20, 275, 61, 21, "Nickname:", false, loginWindow) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["label_4"] = guiCreateLabel(20, 325, 61, 21, "Password:", false, loginWindow) guiLabelSetHorizontalAlign(gui["label_4"], "left", false) guiLabelSetVerticalAlign(gui["label_4"], "center") autoLogInOrNot = guiCreateCheckBox(360, 335, 121, 17, "Enable serial log-in", false, false, loginWindow) gui["pushButton_3"] = guiCreateButton(280, 325, 71, 31, "Guest-mode", false, loginWindow) addEventHandler("onClientGUIClick", gui["pushButton_3"], on_login_as_guest, false) gui["pushButton_2"] = guiCreateButton(380, 275, 91, 41, "Login", false, loginWindow) addEventHandler("onClientGUIClick", gui["pushButton_2"], on_login_clicked, false) end guiEditSetMasked(passField, true) local xmlFile = xmlLoadFile(ACCOUNT_LOGIN_SAVE) if xmlFile then toggle = xmlNodeGetAttribute(xmlFile,"enabled") == "true" if toggle then local S_NICK = tostring(xmlNodeGetAttribute(xmlFile,"nick")) local S_PASS = tostring(xmlNodeGetAttribute(xmlFile,"pass")) guiSetText(nickField,S_NICK) guiSetText(passField,S_PASS) triggerServerEvent("onPlayerJoinData", g_Me,S_NICK, S_PASS, "login") outputChatBox("#FFFFFFSetting#009900: [ #FFFFFFTo disable auto login, use #009900/#FFFFFFstopauto #009900]", 255,255,255,true) end xmlUnloadFile(xmlFile) end guiSetInputEnabled(true) return gui, windowWidth, windowHeight end function on_login_as_guest() showCursor(false) guiSetInputEnabled(false) guiSetVisible(loginWindow,false) triggerServerEvent("onPlayerLoginAsGuest", g_Me) end function on_login_clicked() local nick = guiGetText(nickField) local pass = guiGetText(passField) if(pass ~= "" and pass ~= nil and nick ~= "" and nick ~= nil) then if (guiCheckBoxGetSelected(autoLogInOrNot) ~= false) then handleXMLSave() end triggerServerEvent("onPlayerJoinData", g_Me, nick, pass, "login") else outputChatBox("#FFFFFFError#009900: [ #FFFFFFYou forgot to fill in a field #009900]", 255,255,255,true) end end function on_register_clicked() local nick = guiGetText(nickField) local pass = guiGetText(passField) if(pass ~= "" and pass ~= nil and nick ~= "" and nick ~= nil) then triggerServerEvent("onPlayerJoinData", g_Me, nick, pass, "register") else outputChatBox("#FFFFFFError#009900: [ #FFFFFFYou forgot to fill in a field #009900]", 255,255,255,true) end end addEvent("onPlayerSuccesLogIn", true) addEventHandler("onPlayerSuccesLogIn", getRootElement(), function () showCursor(false) guiSetInputEnabled(false) guiSetVisible(loginWindow,false) end ) function handleXMLSave() local xmlFile = xmlLoadFile(ACCOUNT_LOGIN_SAVE) if not xmlFile then xmlFile = xmlCreateFile("account.xml","settings") if not xmlFile then outputDebugString("Login settings could not be saved",1) return end end xmlNodeSetAttribute(xmlFile,"enabled",tostring(true)) xmlNodeSetAttribute(xmlFile,"nick",tostring(guiGetText(nickField))) xmlNodeSetAttribute(xmlFile,"pass",tostring(guiGetText(passField))) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) end function removeAutoLi() local xmlFile = xmlLoadFile(ACCOUNT_LOGIN_SAVE) if xmlFile then toggle = xmlNodeGetAttribute(xmlFile,"enabled") if toggle == "true" then xmlNodeSetAttribute(xmlFile,"enabled",tostring(false)) outputChatBox("#FFFFFFSetting#009900: [ #FFFFFFYou've disabled the auto-login #009900]", 255,255,255,true) outputChatBox("#FFFFFFSetting#009900: [ #FFFFFFNext time you join, are you able to log in with a different account #009900]",255,255,0) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) else outputChatBox("#FFFFFFSetting#009900: [ #FFFFFFThe auto-login is already disabled#009900! ]", 255,255,255,true) xmlUnloadFile(xmlFile) end end end addCommandHandler("stopauto", removeAutoLi) function playerLoggedOut() dxDrawIsOn = nil guiSetVisible(loginWindow, true) guiSetText(nickField, "") guiSetText(passField, "") guiCheckBoxSetSelected(autoLogInOrNot, false) showCursor(true) guiSetInputEnabled(true) triggerServerEvent("onPlayerLogOutDX",g_Me) local xmlFile = xmlLoadFile(ACCOUNT_LOGIN_SAVE) if xmlFile then toggle = xmlNodeGetAttribute(xmlFile,"enabled") if toggle == "true" then xmlNodeSetAttribute(xmlFile,"enabled",tostring(false)) xmlSaveFile(xmlFile) end xmlUnloadFile(xmlFile) end end This is my login_s.lua --******************** --* Login window * --* Made By: * --* ~EPG~SoundWave * --******************** function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) function onRegister ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "onRegister", true ) addEventHandler( "onRegister", getRootElement(), onRegister ) And this is the Meta.xml <meta> <info author="SoundWave" type="misc" name="Login Window" description="logingui." version="1.0"/> <script src="login_c.lua" type="client"/> <file src="ECR.png"/> </meta> I dont know what is wrong because i don't get an error plz help.
-
gmontext = get("gmontext") gmoncolor = get("gmoncolor") gmofftext = get("gmofftext") gmoffcolor = get("gmoffcolor") gmofftextathunter = get("gmofftextathunter") gmoffcolorathunter = get("gmoffcolorathunter") addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), function(mapInfo) if string.find(mapInfo.name, "[DM]", 1, true) or mapInfo.modename == "Sprint" then gmon() else gmoff() end end) function gmon() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) outputChatBox(gmoncolor..gmontext,thePlayer,186,212,71,true) end end function gmoff() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) outputChatBox(gmoffcolor..gmofftext,thePlayer,255,255,255,true) end end addEvent('onPlayerPickUpRacePickup') addEventHandler('onPlayerPickUpRacePickup', g_Root, function hunterBonus(pickupID, pickupType, vehicleModel) if vehicleModel == 425 then function(mapInfo) if string.find(mapInfo.name, "[DM]", 1, true) or mapInfo.modename == "Sprint" then gmoff() end end) function gmoffathunter() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) outputChatBox(gmoffcolorathunter..gmofftextathunter,thePlayer,255,255,255,true) end end It doesn't work maybe you can help
-
I am just asking for something small (i think): the only thing i want is a site where there is some explanation abouth THIS script or if you are verry pollite you could make me one (the last option is optional)
-
Hey guys, I wonder if somebody could help me. I have a ghostmode script that auto enables ghostmode when there is playing a "[DM]" map and it auto disables when there is playing a "[DD]" map Wel my question is could somebody make or explain some function that auto disables ghostmode when the hunter is reached in "[DM]" maps. Thx in advance. Offtopic: I am new
