Jump to content

Problema 'BuyMap'


MrXz

Recommended Posts

Hola a todos!

Bueno intente esto, es una parte del panel, el panel viene con un buymap, pero intente comprar un map y pues en el chat sale que habia comprado un map, pero al parecer no pasaba eso. Lo que supuesta mente compraba como nextmap, no aparecia, es como si le diera a buymap y solo estoy gastando plata y no juego el map que compre..

Puse /debugscript 3 pero no me aparecio nada.

Por favor, cual seria el problema?

Se lo agradecería mucho :)

function buyMap(thePlayer,mapName) 
    if mapIsAlreadySet == false then 
        if not (mapName == "") then 
            local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) 
            if playerCash >= mapCost then 
        executeCommandHandler("buymap",thePlayer,mapName) -- No entiendo esta línea 
                savePlayerData(thePlayer,"cash",playerCash-mapCost) 
                outputChatBox("#FFFFFFNextmap: "..getPlayerName(thePlayer).."#FFFFFF has bought a next map!",getRootElement(),255,255,255,true) 
                outputChatBox("#FFFFFFNextmap: #00AAFF"..mapName,getRootElement(),255,255,255,true) 
                mapIsAlreadySet = thePlayer 
                local oldmapbuys = loadPlayerData(thePlayer,"mapBuys") 
                savePlayerData(thePlayer,"mapBuys", oldmapbuys + 1) 
                CheckAchievement(thePlayer,13) 
                scoreboardRefresh(thePlayer) 
            else 
                outputChatBox("#00AAFF# #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true) 
            end 
        else 
            outputChatBox("#00AAFF# #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true) 
        end 
    else 
        outputChatBox("#00AAFF# #FFFFFFA map is already set at the moment! Please try again later.",thePlayer,255,255,255,true) 
    end 
end 

Edited by Guest
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...