Jump to content

next map in race .. please help


ABu-ALi_

Recommended Posts

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