MrXz Posted January 8, 2012 Posted January 8, 2012 function setNextMap ( mapname ) g_NextMap = mapname end addEvent ( "setNextMap", true ) addEventHandler ( "setNextMap", getRootElement(), setNextMap ) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function setNextNil ( dis ) g_NextMap = "Random" end addEvent ( "setNextNil", true ) addEventHandler ( "setNextNil", getRootElement(), setNextNil ) function hudSet () local screenWidth, screenHeight = guiGetScreenSize() dxDrawColorText ('Next: ' .. g_NextMap, 2+1, screenHeight - dxGetFontHeight(1.3, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 0, 0, 0, 255 ), 0.6, 'bankgothic', 0.6, 'left') dxDrawColorText ('#FF0000Next: #FF0000' .. g_NextMap, 2, screenHeight - dxGetFontHeight(1.3, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.6, 'bankgothic', 0.6, 'left') EN: Was doing my script race and had a race that I had past, and it had nextmap map, but the probe and did not work nextmap, this is the function and was in race_client e_e! Before that and just put setmap appears random in the nextmap ES: Estube haciendo mi script de race y en eso vi que tenia un race que me lo habian pasado, lo probe y vi nextmap y map, pero al probar el nextmap (despues de poner nextmap) no salio el map seleccionado, este script estaba en race_client.lua Sera otros comandos o tiene que esta en race_server? AD: Sorry for my bad english e_e
Castillo Posted January 8, 2012 Posted January 8, 2012 According to your script, a server-side script is triggering "setNextMap" and "setNextNil". These events should change the next map variable to the one sent, could you post the server-side script where you trigger these events?
MrXz Posted January 9, 2012 Author Posted January 9, 2012 EN: Sorry but it is not understand ES: No entendi lo que dijo e_e
Klesh Posted January 9, 2012 Posted January 9, 2012 If do you want to do some question, or help in spanish post here, viewforum.php?f=145, there you get help in your idiom, good luck.
MrXz Posted January 9, 2012 Author Posted January 9, 2012 I'd rather help me here Link race_client and race_server: Check it out and tell me that failure is Please http://www.megaupload.com/?d=QS2FS9JJ
GTX Posted January 9, 2012 Posted January 9, 2012 Change some lines in racevoting_server.lua Search for command handler 'nextmap'. 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) triggerClientEvent("setNextMap", getRootElement(), getMapName(g_ForcedNextMap)) end )
MrXz Posted January 9, 2012 Author Posted January 9, 2012 But ... All is well up here, I put a map in Set and came out in nextmap^^! Buuuuuuuut .... After passing the map in Set, does not appear in random nextmap ... why? Help me on that and that would be all ^^!
GTX Posted January 9, 2012 Posted January 9, 2012 Add this in racevoting_server.lua at the end of the file. addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function() triggerClientEvent("setNextNil", getRootElement()) end)
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