#1ERuPTiON Posted May 11, 2014 Posted May 11, 2014 Hello, I need help with adding "showchat" which disables/enables chat. I have no idea on how to do that, i tried everything .. And I also need help with adding Speed + Big Jump if anyone knows how .... Skype - destroyermarc354 Ingame: [Victory]#1ERuPTiON / [xXx]#1ERuPTiON / 'kkingg'
Dealman Posted May 11, 2014 Posted May 11, 2014 For showchat, use the event onClientGUIClick to detect when the button is clicked. Then use executeCommandHandler. For speed and jump you can use; getElementVelocity setElementVelocity
Castillo Posted May 11, 2014 Posted May 11, 2014 You can't execute a MTA hardcoded command, so you have to use the function: showCursor And, if you mean the bunny jump cheat from single player, then you must use the function: setWorldSpecialPropertyEnabled
Dealman Posted May 11, 2014 Posted May 11, 2014 You can't execute a MTA hardcoded command Knowledge is power Then you could just use the function showChat...
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 For showchat, use the event onClientGUIClick to detect when the button is clicked. Then use executeCommandHandler.For speed and jump you can use; getElementVelocity setElementVelocity I know you had to do onClientGUIClick but I will try to use executeCommandHandler ..
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 For showchat, use the event onClientGUIClick to detect when the button is clicked. Then use executeCommandHandler.For speed and jump you can use; getElementVelocity setElementVelocity Okay, can you do the function showchat for me, I would really appreciate it. The button name = showChat
Karuzo Posted May 11, 2014 Posted May 11, 2014 Don't call your button showChat it could make some troubles. addEventHandler("onClientGUIClick",btn_showChat, function() showChat(false) end )
Castillo Posted May 11, 2014 Posted May 11, 2014 That could cause problem, since you forgot to set to false the "getPropagated" argument from addEventHandler, everytime you click a GUI element, the chat will hide.
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 That could cause problem, since you forgot to set to false the "getPropagated" argument from addEventHandler, everytime you click a GUI element, the chat will hide. I get bad Argument @ Showchat
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 Don't call your button showChat it could make some troubles. addEventHandler("onClientGUIClick",btn_showChat, function() showChat(false) end ) + I want to Trigger it Server Side
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 Post your complete script. My complete script is a Shop I'm making.. But here is the showChat.. -- Client -- showChat = guiCreateButton(385, 100, 144, 25, "Show/Hide Chat", false, tab) guiSetProperty(showChat, "CaptionColour", "FFFE0000") guiSetProperty(showChat, "PushedTextColour", "FFFE0000") guiSetProperty(showChat, "HoverTextColour", "FFFE0000") guiSetProperty(showChat, "NormalTextColour", "FFFE0000") guiSetFont(showChat, "default-bold-small") addEventHandler("onClientGUIClick",root,function() if ( source == showChat ) then triggerServerEvent("showChat",localPlayer) end end) -- Server -- addEvent("showChat",true) addEventHandler("showChat",root, function() showChat(false) end)
Karuzo Posted May 11, 2014 Posted May 11, 2014 Why are you triggering to the server when you can make it client-sided? and i said you should call your button different. This could cause some problems.
Castillo Posted May 11, 2014 Posted May 11, 2014 The error is because showChat in the server side has a player argument, and you didn't specify one.
Dealman Posted May 11, 2014 Posted May 11, 2014 Try changing the button variable to showChatButton since it might be causing a conflict with the function showChat. For example you can try something like this(Client Side); function showChatOnButtonClick_Handler() local chatHidden = false; if(source == showChatButton and chatHidden == false) then showChat(false); chatHidden = true; elseif(source == showChatButton and chatHidden == true) then showChat(true); chatHidden = false; end end addEventHandler("onClientGUIClick", getRootElement(), showChatOnButtonClick_Handler)
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 Try changing the button variable to showChatButton since it might be causing a conflict with the function showChat.For example you can try something like this(Client Side); function showChatOnButtonClick_Handler() local chatHidden = false; if(source == showChatButton and chatHidden == false) then showChat(false); chatHidden = true; elseif(source == showChatButton and chatHidden == true) then showChat(true); chatHidden = false; end end Thanks, But now when I click it, yes it hides the chat, but I wanted it when you click it again it will show again .. the c addEventHandler("onClientGUIClick", getRootElement(), showChatOnButtonClick_Handler) Thanks, But now when I click it, yes it hides the chat, but I wanted it when you click it again it will show again .. Doesn't work with that .
Dealman Posted May 11, 2014 Posted May 11, 2014 Try this instead, I messed up the logic a bit... local chatHidden = false; function showChatOnButtonClick_Handler() if(source == showChatButton) then if(chatHidden == false) then showChat(false); chatHidden = true; else showChat(true); chatHidden = false; end end end
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 Try this instead, I messed up the logic a bit... local chatHidden = false; function showChatOnButtonClick_Handler() if(source == showChatButton) then if(chatHidden == false) then showChat(false); chatHidden = true; else showChat(true); chatHidden = false; end end end Still doesn't work and you forgot to add "addEventHandler("onClientGUIClick", getRootElement(), showChatOnButtonClick_Handler)" in the second one .. Anyways, i don't know maybe I have to make separate tabs for showchat and hidechat ? because this doesn't work
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 Anyone, Help me with this, basically I want a button to click "showchat" and when you click it once, it will hide chat, click again show chat. I don't know how to do this please help - skype : destroyermarc354
TAPL Posted May 11, 2014 Posted May 11, 2014 He told you to change your button variable name as it may conflict with the function showChat. if ( source == showChat ) then if(source == showChatButton) then
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 He told you to change your button variable name as it may conflict with the function showChat. if ( source == showChat ) then if(source == showChatButton) then I know that, I said I wanted it all in one button, When you click button once it shows chat, then again hides chat
#1ERuPTiON Posted May 11, 2014 Author Posted May 11, 2014 That's is what the code above do. Go to skype .. and I'll give you pass to my local server so you can see what happens
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