Newbie Posted March 21, 2015 Share Posted March 21, 2015 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
Enargy, Posted March 21, 2015 Share Posted March 21, 2015 (edited) function getMapName( map ) return getResourceInfo( map, "name" ) or getResourceName( map ) or "unknown" end You're naming the function like default function. change getMapName like.. idk "mapInfo" Edited March 21, 2015 by Guest Link to comment
Newbie Posted March 21, 2015 Author Share Posted March 21, 2015 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
Newbie Posted March 22, 2015 Author Share Posted March 22, 2015 Never mind. Thanks for trying to help! Fixed it by myself Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now