
krYshuT
Members-
Posts
27 -
Joined
-
Last visited
Everything posted by krYshuT
-
Hello, So I have this code that should remove the option "Play again" from vote, when one map was played 3 times in a row. But it doesn't work correct and I have no clue how to make it working. It removes "Play again" every third map, no matter if it was played more times than once. Example: Map 1 (people voted for Play again) > Map 1 (people voted for Play again) > Map 1 (Play again option disappeared) This is okay, it works. But when people vote each time for different map: Map 1 (people voted for Map 2) > Map 2 (people voted for Map 3) > Map 3 (Play Again option disappeared, but it shouldn't, cause they played it just once) Please help g_maxPlayAgain = 2 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 if g_maxPlayAgain >= 2 then --table.insert(poll, {"Reached max play again times, chossing a random map.", 'nextMapVoteResult', getRootElement()}) g_maxPlayAgain = 0 else g_maxPlayAgain = g_maxPlayAgain + 1 table.insert(poll, {"Play again", 'nextMapVoteResult', getRootElement(), currentMap}) end 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
-
I already found another way, but thanks I just added "setSoundVolume(sound, 0)" and it works the same way.
-
Hello, So I saw this map with MP3 song in it. I wonder, if there is a way to set it to not-play on beginning of the map. It can be turned off with M, but it's boring for most people hearing it again on each start, so I'd like to set it to never play on start, but people can turn it on back with M. Here's the script: local sound addEventHandler('onClientResourceStart', resourceRoot, function () outputChatBox("Press M to toggle between music / radio") sound = playSound("song.mp3",false) end ) local toggle = false bindKey("m","down", function() if toggle then setSoundVolume(sound,0) toggle = false else setSoundVolume(sound,1) toggle = true end end ) The line "local toggle = false" was originally with true value and I thought it might fix it, but it didn't. The song still plays on start.
-
Hello I want to destroy the HEX codes from player's nicknames in outputs, when someone is mute, kicked, etc. It's placed in the messages.xml file, so i don't think it works the same way as in the LUA scripting. Example: <group action="ban" r="255" g="0" b="0"> <all>$player has been banned$by_admin_4all. $data2</all> <log>ADMIN: $admin has banned $player $data $data2</log> </group> <group action="kick" r="255" g="0" b="0"> <all>$player has been kicked$by_admin_4all.</all> <log>ADMIN: $admin has kicked $player $data</log> </group> <group action="mute" r="255" g="0" b="0"> <all>$player has been muted$by_admin_4all. $data2</all> <log>ADMIN: $admin has muted $player $data $data2</log> </group> What shall I add to destroy the hex codes in game?
-
Hello MTA! Is there any hunter toptimes resource free to download? Because I only saw it on some "bigger" servers and they probably coded it themselves. And I couldn't find it anywhere on the forum, or resources site. Thanks.
-
Thanks varez, it took me like 2 hours to make it working, but it works
-
Ingame it looks like this: Lua file: local messagesList = { "19.11.: ESE #00ff0013:3 TPT", "ingame cycling text shows here", "ingame cycling text shows here", "ingame cycling text shows here", "ingame cycling text shows here", "ingame cycling text shows here", } local currentMessage = 0 addEventHandler("onClientPreRender", getRootElement(), function() local screenWidth, screenHeight = guiGetScreenSize() -- Draw the news sticker. dxDrawRectangle(screenWidth - 249, 4, 0, 20, tocolor(0, 0, 0, 192), false) -- Draw all strings. dxDrawText(messagesList[currentMessage + 1], screenWidth - 246, 6, screenWidth - 6, 16, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "top", false, false, false) end ) function updateMessage() if (currentMessage == 5) then currentMessage = 0 else currentMessage = currentMessage + 1 end end setTimer(updateMessage, 5000, 0)
-
Works perfect, thanks much. Just one more question. Is there a way to make color text else then in the chatbox? I've got one resources which generates text elsewhere.
-
Got it finally!! Admin from this revision 643 works. What's odd, that I'm pretty sure that i tried this version already, but whatever. Then the problem must be in admin resource from r655. Anyway, thanks for help.
-
Well, there is this line in delay indicator resource: delayDisplayBehind:text("+"..msToTimeStr(delayTime).." "..cps..getPlayerName(source)) I have no experience in coding, so I don't know how to make it work fine. I tried to edit it like: delayDisplayBehind:text("+"..msToTimeStr(delayTime).." "..cps..string.gsub(playerName, '#%x%x%x%x%x%x', '')) But it didn't work. How it's correct? Else in the killmessages resource I have no idea where to paste it to make it work. Can you help me with this?
-
Is there any way to hide hex codes in player's names? Nobody want it look like this: But what is odd - when you finish the race, the killmessages resource shows it without the hex code as "ESE|krYshuT". However, when i kill myself it shows as "ESE|#ff00ffkrYshuT
-
Ok, I reinstalled my server, left there default resources and files only. And it doesn't work. Same problem. Admin panel is all okay expect Maps panel. My hosting: http://www.gta-multi.com
-
Already tried around 5 versions of admin and everytime it's the same. And I tried the one from resources revision 655
-
I don't think so, it does all the admins on my server.
-
Hello, I've just got this bug today, it worked the whole time before. The "maps" tab doesn't seem to work. All the buttons are faded and I can't scroll through the list. Using the /changemap is pretty boring. Everything other works normal, no signs of other unfunctionality. I tried to reinstall server to new clean folder, tried older and newer versions of admin. Every time the same issue.
-
Awesome dude, it works, thanks
-
Hello, how do I delete exact race toptime? For example, when cheater does it and I want to delete it.
-
Hello! When could i find a resource, that includes player's location in the scoreboard? Like this: http://img714.imageshack.us/img714/1822/beznzvuru.png
-
You are a genius! There was exactly the core of the problem! Thx a bunch!
-
Yeah varez, that's what I do always when things doesn't work how they should. ^^ Tried like million times... A friend of mine, who I'm making maps with have got the same problem. It looks like the problem is in the editor. Because server should read cp's size always the same way.
-
Sexserghy, that's what I mentioned - that I have to set 3 to 4 times smaller checkpoint size, but that's not my style. I need my maps work on server exactly, how I created them in the editor. And that's the problem. So? Any Ideas how could I fix this? This bug really sux.
-
No mate, I'm using MTA Server 1.0.4. Check .map file screenshot above. It looks like that
-
Yeah, I also tested it in the testmode - same issue as on the server.
-
I've noticed that, the checkpoint size on the server is like 3-4 times bigger compared to what I set in the editor. Some people I know have the same issue. And yes, I updated all the resources to the newest ones. Now I have to fill in 3 to 4 times smaller amount in all the checkpoint's properties to have normal checkpoints size on server. Any solution? Editor: http://img200.imageshack.us/img200/1208/editorm.jpg Server: http://img838.imageshack.us/img838/8199/servers.jpg .map file: http://img12.imageshack.us/img12/346/mapfile.jpg