Jump to content

Checkbox problem


Recommended Posts

Posted

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 )  
  

Need paid scripter just pm me i will accept every job!

Posted
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 
) 

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted
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!

Need paid scripter just pm me i will accept every job!

Posted

You want if player check the box and press the button setFightingStyle to Boxing right ?

if so

then this is it .

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted
You want if player check the box and press the button setFightingStyle to Boxing right ?

if so

then this is it .

Working,thanks!

Need paid scripter just pm me i will accept every job!

Posted

how to do that, 2 check box cant be selected at same time?Well,when I click on the first checkbox then first checkbox is selected,but when I click on second checkbox then first checkbox is unselected and second checkbox is selected.Understand?

Need paid scripter just pm me i will accept every job!

Posted
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 
) 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
how to do that, 2 check box cant be selected at same time?Well,when I click on the first checkbox then first checkbox is selected,but when I click on second checkbox then first checkbox is unselected and second checkbox is selected.Understand?

https://wiki.multitheftauto.com/wiki/GuiCreateRadioButton

He want's it as checkbox not radio button ..

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
Ok don't tell anyone.

:lol:

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

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