Userpanel Map Shop Bug

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Userpanel Map Shop Bug

    • Moin, ich habe folgendes Problem.
    • Wenn bei Race eine Map läuft, und ich Kaufe im Userpanel eine, und die Map die schon läuft wird mit dem Befehl /redo neugestartet, wird die Map Normal neugestartet. Aber sobald dann einer eine Map kauft wird die vorher gekaufte Map einfach übergesetted. :C

    LUA-Quellcode

    1. -- Buy a next map
    2. function buyMap(thePlayer,mapName,command)
    3. local account = getPlayerAccount(thePlayer)
    4. if not (isGuestAccount(account)) then
    5. local playerCash = tonumber(getAccountData(account,"cash"))
    6. if #mapQueue == 1 then
    7. outputChatBox("#FFFFFF[#0080ffSERVER#FFFFFF] #FFFFFFQueue is full, please wait.",thePlayer,255,255,255,true)
    8. return
    9. end
    10. if not mapShopState then
    11. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #FFFFFFMap shop is Currently #FF0000Disabled",thePlayer,255,255,255,true)
    12. return
    13. end
    14. if not (mapName == "") then
    15. if playerCash >= mapCost then
    16. if command then
    17. mapName = getMapName(mapName)
    18. else
    19. mapName = tostring(mapName)
    20. end
    21. if not mapTimer[mapName] then
    22. if not tableFind(mapQueue,mapName) then
    23. table.insert(mapQueue,mapName)
    24. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #ffffff"..getPlayerName(thePlayer).."#FFFFFF has bought #FFFFFF"..tostring(mapName).."#ffffff!",getRootElement(),255,255,255,true)
    25. --outputChatBox("#FFFFFF[#0080FFMAPSHOP#FFFFFF] #ffffff"..tostring(mapName).."#ffffff successfully added to map queue!",getRootElement(),255,255,255,true)
    26. addStat(account,"buyedMaps",1)
    27. setAccountData(account,"cash",playerCash - mapCost)
    28. scoreboardRefresh(thePlayer)
    29. mapTimer[mapName] = setTimer(resetMapTimer,60000*35,1,mapName)
    30. if #mapQueue <= 1 then
    31. triggerEvent("onBoughtMap",getRootElement(),mapName)
    32. end
    33. callClientFunction(getRootElement(),"setMapQueue",mapQueue)
    34. else
    35. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #FFFFFFMap "..mapName.." is already in map queue.",thePlayer,255,255,255,true)
    36. end
    37. else
    38. local remaining, executesRemaining, totalExecutes = getTimerDetails(mapTimer[mapName])
    39. if remaining < 60000 then
    40. remaining = math.floor(remaining/1000).."#ffffff second"
    41. else
    42. minutes = math.floor(remaining/60000)
    43. remaining = string.format('%02d',minutes).."#ffffff minutes"
    44. end
    45. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #FFFFFFYou have to wait #FFFFFF"..remaining.." to set this map!",thePlayer,255,255,255,true)
    46. end
    47. else
    48. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true)
    49. end
    50. else
    51. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true)
    52. end
    53. else
    54. outputChatBox("#FFFFFF[#0080FFSERVER#FFFFFF] #FFFFFFA map is already set at the moment! Please try again later.",thePlayer,255,255,255,true)
    55. end
    56. end
    57. function resetMapSetStatus(g_MapInfo)
    58. if #mapQueue >= 1 then
    59. if g_MapInfo.name ~= mapQueue[1] then
    60. triggerEvent("onBoughtMap",getRootElement(),mapQueue[1])
    61. removeFromTable(mapQueue,mapQueue[1])
    62. else
    63. removeFromTable(mapQueue,mapQueue[1])
    64. if mapQueue[1] then
    65. triggerEvent("onBoughtMap",getRootElement(),mapQueue[1])
    66. end
    67. end
    68. end
    69. for i,player in pairs(getElementsByType("player")) do
    70. respawnFix[player] = false
    71. end
    72. respawnFix = {}
    73. callClientFunction(getRootElement(),"setMapQueue",mapQueue)
    74. end
    75. addEvent("onMapStarting",true)
    76. addEventHandler("onMapStarting",getRootElement(),resetMapSetStatus)
    Alles anzeigen