Jump to content

ClientSide event "SetChatInput" ??


XetaQuake

Recommended Posts

hi, i need a clientside function that write in the chat by the player

why?:

i have a GUI script (not by me) and this is complete client side, now i want to build in a option window from this GUI script a button like "report".

so players can press this button and then the report window from admin.zip open so that player can report

my idea:

a function that write /report in the chat box (or report in the console) that this report window will be open

dont know what i mean? than connect to any server and write /report in the chat box :wink:

question:

can somebody help me with this? or is this at this moment not possibly?

Edited by Guest
Link to comment

ok i have test and learning a little bit

can somebody tell me why this dont work:

local localPlayer = getLocalPlayer ( ) 
  
function openAdminReport() 
    executeCommandHandler( "report", localPlayer ) 
end 

and i cant see any errors, warnings etc ;(

i hope for help 8)

Edited by Guest
Link to comment

Because i dont think that anybody answer, i explain the code better:

i use the Freeroam Gui, and i want to add a "Report" button in the Main Window (open with F1)

Here is the code from the main window (the red line at the end is the new line):

  
wndMain = { 
    'wnd', 
    text = 'FR GUI', 
    x = 10, 
    y = 150, 
    width = 280, 
    controls = { 
        {'lbl', text='Local player'}, 
        {'br'}, 
        {'btn', id='kill', onclick=killLocalPlayer}, 
        {'btn', id='skin', window=wndSkin}, 
        {'btn', id='weapon', window=wndWeapon}, 
        {'btn', id='clothes', window=wndClothes}, 
        {'btn', id='playergrav', text='grav', window=wndGravity}, 
        {'btn', id='warp', window=wndWarp}, 
        {'btn', id='stats', window=wndStats}, 
        {'br'}, 
        {'chk', id='jetpack', onclick=toggleJetPack}, 
        {'chk', id='falloff', text='fall off bike', onclick=toggleFallOffBike},[/color] 
        {'br'}, 
         
        {'lbl', text='Pos:'}, 
        {'lbl', id='xpos', text='x', width=50}, 
        {'lbl', id='ypos', text='y', width=50}, 
        {'lbl', id='zpos', text='z', width=50}, 
        {'btn', id='setpos', text='map', window=wndSetPos}, 
        {'br'}, 
        {'br'}, 
         
        {'lbl', text='Vehicles'}, 
        {'br'}, 
        {'lbl', text='Current:'}, 
        {'lbl', id='curvehicle'}, 
        {'br'}, 
        {'btn', id='createvehicle', window=wndCreateVehicle, text='create'}, 
        {'btn', id='repair', onclick=repairVehicle}, 
        {'btn', id='flip', onclick=flipVehicle}, 
        {'btn', id='upgrades', window=wndUpgrades}, 
        {'btn', id='color', window=wndColor}, 
        {'btn', id='paintjob', window=wndPaintjob}, 
        {'br'}, 
        {'chk', id='lightson', text='Lights on', onclick=forceLightsOn}, 
        {'chk', id='lightsoff', text='Lights off', onclick=forceLightsOff}, 
        {'br'}, 
        {'br'}, 
         
        {'lbl', text='Environment'}, 
        {'br'}, 
        {'btn', id='time', window=wndTime}, 
        {'btn', id='weather', window=wndWeather}, 
        {'btn', id='speed', window=wndGameSpeed} 
        [b][color=#FF0008]{'btn', id='Report', onclick=openAdminReport},[/color][/b] 
    }, 
    oncreate = mainWndShow, 
    onclose = mainWndClose 
} 
  

and here a the openAdminReport function:

  
local localPlayer = getLocalPlayer ( ) 
  
function openAdminReport() 
    executeCommandHandler( "report", localPlayer ) 
end 
  

the button are to see, but nothing happens when i click

note: all must be clientside

The server community want the gamemode and i want to release it so fast as i can :wink:

can someone help me?

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