Jump to content

Buymap doesnt work


CheiN

Recommended Posts

hello guys today i was fixing a race-panel and i wanted fix the buymap part but i dont know what is wrong i tryied to do all i could but now i have not idea about what is happening with this script.

function buyMap(thePlayer,mapName) 
    if mapIsAlreadySet == false then 
        if not (mapName == "") then 
            local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) 
            if playerCash >= mapCost then 
                exports.race:setNextMap( mapName ) 
                executeCommandHandler("pnfnsdhasd3w7432jhdsbw3ersdncsdir",thePlayer,mapName) 
                savePlayerData(thePlayer,"cash",playerCash-mapCost) 
                outputChatBox("#00BFFF# Nextmap: "..getPlayerName(thePlayer).."#FFFFFF has bought a next map!",getRootElement(),255,255,255,true) 
                outputChatBox("#00BFFF# Nextmap: #FFFFFF"..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("#00BFFF# #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true) 
            end 
        else 
            outputChatBox("#00BFFF# #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true) 
        end 
    else 
        outputChatBox("#00BFFF# #FFFFFFA map is already set at the moment! Please try again later.",thePlayer,255,255,255,true) 
    end 
end 
  
function unbuyMap(thePlayer) 
    if mapIsAlreadySet ~= false then 
            if mapIsAlreadySet == thePlayer then 
                executeCommandHandler("pnfnsdhasd3w7432jhdsbw3ersdncsdir",thePlayer,nil) 
                local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) 
                savePlayerData(thePlayer,"cash",playerCash+(mapCost/4)*3) 
                outputChatBox("#00BFFF# Nextmap: "..getPlayerName(thePlayer).."#FFFFFF has unbought a next map!",getRootElement(),255,255,255,true) 
                mapIsAlreadySet = false 
                local oldmapbuys = loadPlayerData(thePlayer,"mapBuys") 
                savePlayerData(thePlayer,"mapBuys", oldmapbuys - 1) 
                CheckAchievement(thePlayer,13) 
                scoreboardRefresh(thePlayer) 
            else 
                outputChatBox("#00BFFF# #FFFFFFYou didn't buy that map!",thePlayer,255,255,255,true) 
            end 
    else 
        outputChatBox("#00BFFF# #FFFFFFNo map has been bought!",thePlayer,255,255,255,true) 
    end 
end 
  
function resetMapSetStatus() 
    mapIsAlreadySet = false 
end 
addEventHandler("onMapStarting",getRootElement(),resetMapSetStatus) 

thanks for reading.

Link to comment

Fixing other resources requires knowledge which you're lacking. Asking us to help you fix it is like we're fixing it for you. You should ask the author of the script to fix any problems with their resources. We have no idea about the rest of the script and what problems you're having. We know nothing.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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