XetaQuake Posted February 16, 2008 Share Posted February 16, 2008 (edited) 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 question: can somebody help me with this? or is this at this moment not possibly? Edited February 20, 2008 by Guest Link to comment
lil Toady Posted February 16, 2008 Share Posted February 16, 2008 http://development.mtasa.com/index.php? ... andHandler That's what you need, however in the admin resource the command handler is added client side so i think you'll have to use this function client side too Link to comment
XetaQuake Posted February 16, 2008 Author Share Posted February 16, 2008 (edited) nice! can you pleas say me the client side version from this?: function openAdminReport() executeCommandHandler ( "report", playerSource ) end Edited February 20, 2008 by Guest Link to comment
mabako Posted February 16, 2008 Share Posted February 16, 2008 it's probably executeCommandHandler( "report" ). If that doesn't work, use getLocalPlayer() as player-argument. Link to comment
XetaQuake Posted February 16, 2008 Author Share Posted February 16, 2008 (edited) it's probably executeCommandHandler( "report" ). dont work, no errors, no window, no warnings If that doesn't work, use getLocalPlayer() as player-argument. sorry but was is a player-argument? Edited February 20, 2008 by Guest Link to comment
XetaQuake Posted February 18, 2008 Author Share Posted February 18, 2008 (edited) 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 Edited February 20, 2008 by Guest Link to comment
XetaQuake Posted February 19, 2008 Author Share Posted February 19, 2008 (edited) ah pleas help me, its my last problem at this time for my gamemode come on pleas when i press the button noting happens, and i cant see any errors, warnings etc the script have in my eyes no errors...realy strange Edited February 20, 2008 by Guest Link to comment
erorr404 Posted February 20, 2008 Share Posted February 20, 2008 I'll assume you're calling that function. Did you add a command handler for "report"? Paste all necessary code. Link to comment
XetaQuake Posted February 20, 2008 Author Share Posted February 20, 2008 {'btn', id='Report', onclick=openAdminReport}, local localPlayer = getLocalPlayer ( ) function openAdminReport() executeCommandHandler( "report", localPlayer ) end Link to comment
XetaQuake Posted February 22, 2008 Author Share Posted February 22, 2008 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 can someone help me? 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