Jump to content

Snoop.Cat

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Snoop.Cat

  1. hey guys , i have this code on my userpanel to buy maps , but it doesnt not really buys the map , it takes the money but nothing happens then , also i dont know if is problem of racevoting_server.lua, but i dont know what to add on there. Client -- Get all maps on server function getMaps() totalServerMaps = 0 totalDmMaps = 0 totalDdMaps = 0 setTimer(callServerFunction,2000,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 elseif (string.find(map.name,"[FUN]",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) guiSetVisible(tabs[5],false) guiSetInputEnabled (false) showCursor(false) end --Command for buy maps function buyMapsCommand(command, ... ) local mapName = #{...}>0 and table.concat({...},' ') or nil if not(mapName)then getMapsOnce() guiSetVisible(tabs[5],true) guiSetInputEnabled (true) showCursor(true) else callServerFunction("buyMapSecond",getLocalPlayer(),mapName) end end addCommandHandler("bm", buyMapsCommand) -- 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/FUN 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 -- Buy a next map function buyMap(thePlayer,mapName) if not(isEventRunning)then local playersOn = getPlayerCount() local playerPoint = tonumber(getPlayerDataRam(thePlayer,"pointsRam")) local playerCash = tonumber(getPlayerDataRam(thePlayer,"cash")) if mapIsAlreadySet == false then if not (mapName == "") then if(playersOn == 1)then triggerEvent("onPlayerBuyMap", getRootElement(), false, 50000, mapName) outputChatBox("#FF6600* #999999Buying a map when you are alone on the server is free.",thePlayer,255,255,255,true) return end if playerCash >= mapCost then triggerEvent("onPlayerBuyMap", getRootElement(), thePlayer, playerCash, mapName) else outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",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, try again nextmap.",thePlayer,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFYou can't buy maps during the #aaff00DGE#FFFFFF.",thePlayer,255,255,255,true) end end function buyMapSecond(thePlayer,mapName) if not(isEventRunning)then local playersOn = getPlayerCount() local playerPoint = tonumber(getPlayerDataRam(thePlayer,"pointsRam")) local playerCash = tonumber(getPlayerDataRam(thePlayer,"cash")) if mapIsAlreadySet == false then if not (mapName == "") then if(playersOn == 1)then triggerEvent("onPlayerBuyMapSecond", getRootElement(), false, 50000, mapName) outputChatBox("#FF6600* #999999Buying a map when you are alone on the server is free.",thePlayer,255,255,255,true) return end if playerCash >= mapCost then triggerEvent("onPlayerBuyMapSecond", getRootElement(), thePlayer, playerCash, mapName) else outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",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 else outputChatBox("#FF6600* #FFFFFFYou can't buy maps during the #aaff00DGE#FFFFFF.",thePlayer,255,255,255,true) end end function onPlayerSuccessfullyBuyMap(thePlayer, mapName, expensive) local playerCash = tonumber(getPlayerDataRam(thePlayer,"cash")) local cost = mapCost if(expensive)then cost = 50000 end setPlayerDataRam(thePlayer,"cash",playerCash-cost,false) scoreboardRefresh(thePlayer) outputChatBox("#FF4000*#FFFFFF "..getPlayerName(thePlayer).."#FFFFFF has bought #FF6600'"..mapName.."#FF6600'#FFFFFF!",getRootElement(),255,255,255,true) achievement31(thePlayer) end addEvent("onPlayerSuccessBuyMap", true) addEventHandler("onPlayerSuccessBuyMap", getRootElement(), onPlayerSuccessfullyBuyMap) rootElement = getRootElement() addEvent('buyMapFromPanel', true) function buyMFP(mapname) buyMap(source, command, mapname) end addEventHandler('buyMapFromPanel', rootElement, buyMFP) 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("onRaceSetNextMap",true) addEventHandler("onRaceSetNextMap",getRootElement(), function () mapIsAlreadySet = true end) function executeOnMatStarting() mapIsAlreadySet = false end addEvent("onMapSuccessfullyStart") addEventHandler("onMapSuccessfullyStart", getRootElement(), executeOnMatStarting) --Disables the votemanager resource function disableRaceVotingResource() local resource = getResourceFromName ( "votemanager" ) if (getResourceState(resource) == "running" ) then stopResource(resource) end end addEventHandler("onMapStarting",getRootElement(),function()setTimer(disableRaceVotingResource, 3000, 1)end)
  2. hola amigos , quisiera preguntarles sobre un microfono y tambien preguntar que significa cada aspecto de este , el microfono es este Micrófono Chao Echo Mic Micrófono Chao Echo ofrece una calidad cristalina en la comunicación. Diseñado como un micrófono de solapa por lo que se puede conectar en collares o ropa a través del clip. 360 grados de rotación, y una capacidad para llevar tu voz en alta calidad a través de la red * Encendido y apagado imperceptible * Reducción de Echo (Ecolocación Sonora) Características Tipo: Omini-directional Frecuencia: 100 ~ 10K Hz Impedancia: < 2.2 kohm Sensibilidad: -34 ± 3 dBV / Pa a 1 kHz Largo de Cable: 2.7 m Tipo de Cable: Trenzado con Velcro quisiera que me ayudasen porfavor , quiero comprarme algo de calidad y no q mi voz suene mal. aconsejenme
  3. lolposers Dubstep? Nty si algunos temas de dubstep , pero actualizate ase rato q ya pasaron de moda los temas dubstep en la musica de mapas race.
  4. Snoop.Cat

    Radio Full

    Holaaaaa les quiero presentar mi Radio Emisora de internet "Radio FULL" bueno en esta emisora ponemos de todo tipo de musica menos Justin Biber y esas maracadas y Regeton , ponemos casi todos los temas de MTA Race y otros mas , tenemos ya 6 DJ que hacen programas diariamente para que sea una radio mas entretenida , contamos con scripts para android y MTA para que nos escuches donde sea!! la web de la radio es http://Radio-Full.Tk/ tambien puedes descargar el Script para MTA de nuestra radio! : https://community.multitheftauto.com/ind ... ls&id=6823 gracias por tomarse el tiempo de leer esto y pasenla Bien en la radio!
  5. problem solved thx alot csmith
  6. it doesnt works it doesnt start music from resource and not mute the music from maps
  7. miki no one of those codes works , it doesnt not even mute any sound
  8. start the script and mute every music from every race map that loads a new music..
  9. it mutes the music but when a new map load the music from new map starts anyway
  10. soo code should be like for i, sound in ipairs(getElementsByType("sound")) do setSoundVolume(sound, 0) end function startMusic() setRadioChannel(0) song = playSound("song.mp3",true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("music",toggleSong) bindKey("m","down","music") and then only this sound of this specific script will play and others from maps will be muted always?
  11. im srry im noob on scripting , where i should put that code? and also do i should use a setTimer so when a new race map start then it mutes it again?
  12. hey guys i have a problem , when i start this music script the other music from the map resources keep playing , my question is how i can mute the music from every map that start so players can only hear the music from my resource? here is my resource: function startMusic() setRadioChannel(0) song = playSound("song.mp3",true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("music",toggleSong) bindKey("m","down","music")
  13. hey i have a problem , i downloaded minimapshop from the mta comunity and when i start it its says me thata map is already buyed yet and dont let me set a new map. i added it to acl and dont know what can be , a friend told me to send the racevoting_server.lua from race and it worked fine but then my server timedout and the script stop working and dont know how to fix. there is my racevoting_server.lua -- -- racemidvote_server.lua -- -- Mid-race random map vote and -- NextMapVote handled in this file -- local lastVoteStarterName = '' local lastVoteStarterCount = 0 local nextmapbought = false ---------------------------------------------------------------------------- -- displayHilariarseMessage -- -- Comedy gold ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- displayKillerPunchLine -- -- Sewing kits available in the foyer ---------------------------------------------------------------------------- function displayKillerPunchLine( player ) if lastVoteStarterName ~= '' then outputRace( 'Offical news: Everybody hates ' .. lastVoteStarterName ) end end ---------------------------------------------------------------------------- -- startMidMapVoteForRandomMap -- -- Start the vote menu if during a race and more than 30 seconds from the end -- No messages if this was not started by a player ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- event midMapVoteResult -- -- Called from the votemanager when the poll has completed ---------------------------------------------------------------------------- addEvent('midMapVoteResult') addEventHandler('midMapVoteResult', getRootElement(), function( votedYes,map ) -- Change state back gotoState('Running') if votedYes then local query = votemapnext local map, errormsg = findMap( query ) g_ForcedNextMap = map else displayKillerPunchLine() end end ) ---------------------------------------------------------------------------- -- startRandomMap -- -- Changes the current map to a random race map ---------------------------------------------------------------------------- function startRandomMap() -- Handle forced nextmap setting if maybeApplyForcedNextMap() then return end -- Get a random map chosen from the 10% of least recently player maps, with enough spawn points for all the players (if required) local map = getRandomMapCompatibleWithGamemode( getThisResource(), 100, g_GameOptions.ghostmode and 0 or getTotalPlayerCount() ) if map then g_IgnoreSpawnCountProblems = map -- Uber hack 4000 if not exports.mapmanager:changeGamemodeMap ( map, nil, true ) then problemChangingMap() end else outputWarning( 'startRandomMap failed' ) end end ---------------------------------------------------------------------------- -- outputRace -- -- Race color is defined in the settings ---------------------------------------------------------------------------- function outputRace(message, toElement) toElement = toElement or g_Root local r, g, b = getColorFromString(string.upper(get("color"))) if getElementType(toElement) == 'console' then outputServerLog(message) else if toElement == rootElement then outputServerLog(message) end if getElementType(toElement) == 'player' then message = '[PM] ' .. message end outputChatBox(message, toElement, r, g, b) end end ---------------------------------------------------------------------------- -- problemChangingMap -- -- Sort it ---------------------------------------------------------------------------- function problemChangingMap() outputRace( 'Changing to random map in 5 seconds' ) local currentMap = exports.mapmanager:getRunningGamemodeMap() TimerManager.createTimerFor("resource","mapproblem"):setTimer( function() -- Check that something else hasn't already changed the map if currentMap == exports.mapmanager:getRunningGamemodeMap() then startRandomMap() end end, math.random(4500,5500), 1 ) end -- -- -- NextMapVote function startNextMapVote() exports.votemanager:stopPoll() -- Handle forced nextmap setting if maybeApplyForcedNextMap() then return end -- Get all maps local compatibleMaps = exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource()) -- limit it to eight random maps if #compatibleMaps > 8 then math.randomseed(getTickCount()) repeat table.remove(compatibleMaps, math.random(1, #compatibleMaps)) until #compatibleMaps == 8 elseif #compatibleMaps < 2 then return false, errorCode.onlyOneCompatibleMap end -- mix up the list order for i,map in ipairs(compatibleMaps) do local swapWith = math.random(1, #compatibleMaps) local temp = compatibleMaps[i] compatibleMaps[i] = compatibleMaps[swapWith] compatibleMaps[swapWith] = temp end local poll = { title="Choose the next map:", visibleTo=getRootElement(), percentage=51, timeout=15, allowchange=true; } for index, map in ipairs(compatibleMaps) do local mapName = getResourceInfo(map, "name") or getResourceName(map) table.insert(poll, {mapName, 'nextMapVoteResult', getRootElement(), map}) end local currentMap = exports.mapmanager:getRunningGamemodeMap() if currentMap then table.insert(poll, {"^^", 'nextMapVoteResult', getRootElement(), currentMap}) end -- Allow addons to modify the poll g_Poll = poll triggerEvent('onPollStarting', g_Root, poll ) poll = g_Poll g_Poll = nil local pollDidStart = exports.votemanager:startPoll(poll) if pollDidStart then gotoState('NextMapVote') addEventHandler("onPollEnd", getRootElement(), chooseRandomMap) end return pollDidStart end -- -- -- local g_Poll ---------------------------------------------------------------------------- -- startNextMapVote -- -- Start a votemap for the next map. Should only be called during the -- race state 'NextMapSelect' ---------------------------------------------------------------------------- function nextmapsetauto () local map = getRandomMapCompatibleWithGamemode( getThisResource(), 100, 1 ) local currentMap = exports.mapmanager:getRunningGamemodeMap() if map == currentMap then --nothink else g_ForcedNextMap = map nextmapbought = false end end addEvent("onMapStarting",true) addEventHandler ( "onMapStarting", getRootElement(), nextmapsetauto ) -- Used by addons in response to onPollStarting addEvent('onPollModified') addEventHandler('onPollModified', getRootElement(), function( poll ) g_Poll = poll end ) function chooseRandomMap (chosen) if not chosen then cancelEvent() math.randomseed(getTickCount()) exports.votemanager:finishPoll(1) end removeEventHandler("onPollEnd", getRootElement(), chooseRandomMap) end ---------------------------------------------------------------------------- -- event nextMapVoteResult -- -- Called from the votemanager when the poll has completed ---------------------------------------------------------------------------- addEvent('nextMapVoteResult') addEventHandler('nextMapVoteResult', getRootElement(), function( map ) if stateAllowsNextMapVoteResult() then if not exports.mapmanager:changeGamemodeMap ( map,
  14. Snoop.Cat

    PixuTops

    because the owner of pixutops deleted the databases and this can not be recorded, so its not the problem of your server, its a global problem , all started having this problem including me
  15. crear un hosting gratis para tu web y acortar link. ( links en la descripcion del video) crear Foro SMF con el hosting gratis! ( links de descargas y links de utilidad maxima en descripcion del video)
  16. PD: SE que son tutoriales basicos pero no critiquen , siempre hay alguien que no sabe. [Tutorial] Bajar Resources mas actualizados de MTA [Tutorial] Modificar objetos con F3 en map Editor [Tutorial] Poner Musica a Mapa MTA sin Descarga en el Server
  17. but i need when u open whit /chatop the script show cursor and when click ok button to close stop showing button.
  18. i dont understand , i need when i thype /chatop cursor shows whit gui and when i click on OK button cursor stop showing and gui closes at it normally do.
  19. i did what u say me on pm , i already asked owner but no responses , well the scriot u gaved me only showing the cursor when i open the gui , but not closing when i hit the close button
×
×
  • Create New...