Jump to content

trying to make a map shop


Newbie

Recommended Posts

triggerEvent("onBoughtMap",getRootElement(),mapName) 

This part works fine..

And now im trying to set a map

P.S Default Race.

function SetNextMap ( mapName ) 
    g_ForcedNextMap = mapName 
end 
addEvent ( "onBoughtMap", true ) 
addEventHandler ( "onBoughtMap", getRootElement(), SetNextMap ) 

[2015-03-22 00:35:35] WARNING: [gamemodes]\[race]\race\racevoting_server.lua:773: Bad argument @ 'getResourceInfo' [Expected resource-data at argument 1, got string '[DM] Audio v4 - Dream Experience']

[2015-03-22 00:35:35] WARNING: [gamemodes]\[race]\race\racevoting_server.lua:773: Bad argument @ 'getResourceName' [Expected resource-data at argument 1, got string '[DM] Audio v4 - Dream Experience']

function getMapName( map ) 
    return getResourceInfo( map, "name" ) or getResourceName( map ) or "unknown" Line 773 
end 
  

Need help so far.

Link to comment

I think it will make more badly..

addCommandHandler('nextmap', 
    function( player, command, ... ) 
        local query = #{...}>0 and table.concat({...},' ') or nil 
        if not query then 
            if g_ForcedNextMap then 
                outputRace( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) 
            else 
                outputRace( 'Next map is not set', player ) 
            end 
            return 
        end 
        if not _TESTING and not isPlayerInACLGroup(player, g_GameOptions.admingroup) then 
            return 
        end 
        local map, errormsg = findMap( query ) 
        if not map then 
            outputRace( errormsg, player ) 
            return 
        end 
        if g_ForcedNextMap == map then 
            outputRace( 'Next map is already set to ' .. getMapName( g_ForcedNextMap ), player ) 
            return 
        end 
        g_ForcedNextMap = map 
        outputChatBox('Next map set to ' .. getMapName( g_ForcedNextMap ) .. ' by ' .. getPlayerName( player ), g_Root, 0, 240, 0) 
    end 
) 

g_Forced calls .. getMapName

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...