ABu-ALi_ Posted March 7, 2011 Posted March 7, 2011 hi all I tried to work the next map in race , but not working this client code : function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( mapNameEdit, gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1 ) and : function onGuiClick (button, state, absoluteX, absoluteY) if (source == buyButton) then map = guiGetText ( mapNameEdit ) triggerServerEvent ("buyMap", getLocalPlayer(), map) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) Server code : function NextMap(map) if checkClient( true, source, 'NextMap', map ) then return end executeCommandHandler("nextmap", source, map) end addEvent("buyMap", true) addEventHandler("buyMap", getRootElement(),NextMap) please help me
#Paper Posted March 7, 2011 Posted March 7, 2011 function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( mapNameEdit, gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1 ) function onGuiClick (button, state, absoluteX, absoluteY) if (button == buyButton) then map = guiGetText ( mapNameEdit ) triggerServerEvent ("buyMap", getLocalPlayer(), map) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) Server code : function NextMap(map) g_ForcedNextMap = map--I use that metod end addEvent("buyMap", true) addEventHandler("buyMap", getRootElement(),NextMap)
#Paper Posted March 7, 2011 Posted March 7, 2011 not working please help type /debugscript 3 and post the errors...
Castillo Posted March 7, 2011 Posted March 7, 2011 g_ForcedNextMap, that's a race function if i'm right, you can't use it outside the race gamemode if it's not exported.
proracer Posted March 7, 2011 Posted March 7, 2011 I have one question too ... Can I use this function to represent next map with dx drawing?
#Paper Posted March 7, 2011 Posted March 7, 2011 I have one question too ...Can I use this function to represent next map with dx drawing? Yes, i do that
UAEpro Posted March 7, 2011 Posted March 7, 2011 (edited) function NextMap(map) executeCommandHandler("nextmap", source, map) end addEvent("buyMap", true) addEventHandler("buyMap", getRootElement(),NextMap) i think this will work edit : i forget end ... thanks for citizen again and again ^^ Edited March 7, 2011 by Guest
Moderators Citizen Posted March 7, 2011 Moderators Posted March 7, 2011 You forgot the end: function NextMap(map) executeCommandHandler("nextmap", source, map) end addEvent("buyMap", true) addEventHandler("buyMap", getRootElement(),NextMap)
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