Jump to content

Buy Map Problem


anksel

Recommended Posts

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

:S

Link to comment
This isn't your script and you, yourself don't know what's the error/problem?

If this isn't your script then we can not help you,

if this came from another scripter then ask them if you could modify there resource, maybe they could even help you with it.

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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