ABu-ALi_ Posted March 7, 2011 Share 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 Link to comment
#Paper Posted March 7, 2011 Share 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) Link to comment
ABu-ALi_ Posted March 7, 2011 Author Share Posted March 7, 2011 not working please help Link to comment
#Paper Posted March 7, 2011 Share Posted March 7, 2011 not working please help type /debugscript 3 and post the errors... Link to comment
ABu-ALi_ Posted March 7, 2011 Author Share Posted March 7, 2011 i try but not found errors please help me Link to comment
Castillo Posted March 7, 2011 Share 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. Link to comment
proracer Posted March 7, 2011 Share Posted March 7, 2011 I have one question too ... Can I use this function to represent next map with dx drawing? Link to comment
#Paper Posted March 7, 2011 Share 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 Link to comment
UAEpro Posted March 7, 2011 Share 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 Link to comment
Moderators Citizen Posted March 7, 2011 Moderators Share Posted March 7, 2011 You forgot the end: function NextMap(map) executeCommandHandler("nextmap", source, map) end addEvent("buyMap", true) addEventHandler("buyMap", getRootElement(),NextMap) Link to comment
ABu-ALi_ Posted March 7, 2011 Author Share Posted March 7, 2011 thankk you UAEpro and Citizen ... Link to comment
Moderators Citizen Posted March 7, 2011 Moderators Share Posted March 7, 2011 No problem 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