Jump to content

Checkbox problem


Recommended Posts

Why this dont set my fightin style to "Boxing"?No errors.

Client

function box () 
if ( guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) ) then 
  triggerServerEvent ( getLocalPlayer(), "box" ) 
end 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], box ) 
  

Server

function box () 
if ( getPlayerMoney(source) >= 1000 ) then 
 setPedFightingStyle ( source, 5 ) 
 takePlayerMoney ( source, 1000 ) 
else 
 exports ["guimessages"] : outputServer ( source, "You don't have enought money!" , 255, 255, 0 ) 
end 
end 
addEvent ( "box", true ) 
addEventHandler ( "box", root, box )  
  

Link to comment
addEventHandler('onClientGUIClick', root, 
  function ( ) 
      if ( source == GUIEditor_Button[1] ) then 
      if ( guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) ) then 
      triggerServerEvent('box', localPlayer) 
  end 
 end 
end 
) 

addEvent('box', true) 
addEventHandler('box', root, 
function ( ) 
    if (getPlayerMoney( source ) >= 1000 ) then 
    takePlayerMoney ( source, 1000 ) 
    setPedFightingStyle( source, 5 ) 
 else 
 exports["guimessages"] : outputServer ( source, "You don't have enought money!" , 255, 255, 0 ) 
  end 
end 
) 

Link to comment
addEventHandler('onClientGUIClick', root, 
  function ( ) 
      if ( source == GUIEditor_Button[1] ) then 
      triggerServerEvent('box', localPlayer) 
  end 
end 
) 

addEvent('box', true) 
addEventHandler('box', root, 
function ( ) 
    if (getPlayerMoney( source ) >= 1000 ) then 
    takePlayerMoney ( source, 1000 ) 
    setPedFightingStyle( source, 5 ) 
 else 
 exports["guimessages"] : outputServer ( source, "You don't have enought money!" , 255, 255, 0 ) 
  end 
end 
) 

Noo,you dont understand,you must read script!

Link to comment
addEventHandler("onClientGUIClick", root, 
    function () 
        if getElementType(source) == "gui-checkbox" then 
            if (source == Checkbox1) then 
                guiCheckBoxSetSelected(Checkbox2, false) 
            elseif (source ==Checkbox2) then 
                guiCheckBoxSetSelected(Checkbox1, false) 
            end 
        end 
    end 
) 

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