DazzaJay Posted January 15, 2008 Share Posted January 15, 2008 MOD NOTE: The resource that mainly gets discussed here, "kchaticon", has been revived by MTA staff and re-uploaded to https://community.multitheftauto.com/index.php?p=resources&s=details&id=14639. The latest version solves all problems discussed on the pages of this topic; it optimizes bandwidth, and also fixes chat icons remaining (floating) on the screen. The resource has been rewritten partially. Im sure some of you have played Quake III before, and have seen the blue logo that appears over somones head when they have started to type a chat message. well, i was wondering if it is possible to get a script that will display this image...... above the players head when they have the "say" or "Team say" box open. (displayed on everyones screen above the player that is typing's head that is) the good thing is that i belive you wouldent need to host the image on the server, as it is located in the game defaultly! its called "badchat" and is located in the /san andreas/models/txd/LD_CHAT.txd file! can somone help out with a script like this? :::EDIT::: i have made a Photoshopped image of how i would like it to work when its done...... (click for bigger photoshopped image) Link to comment
Ransom Posted January 15, 2008 Share Posted January 15, 2008 Would work through the use of: http://development.mtasa.com/index.php? ... ntrolState ( "chatbox" control) and http://development.mtasa.com/index.php? ... taticImage Although im not sure if theres a method to put the icon on the player like network trouble. Link to comment
DazzaJay Posted January 15, 2008 Author Share Posted January 15, 2008 i dare say getting the chat bubble to show above a player would be a simmilar system to how thier name and health bar appears to others Link to comment
eAi Posted January 15, 2008 Share Posted January 15, 2008 find the player's position, add 1.5 or so to the Z axis. Then use getScreenFromWorldPosition on it and place a static image at that point. Link to comment
[CaM] Posted January 16, 2008 Share Posted January 16, 2008 And possibly, build in a microphone button? So when you push the button(hold it down), you speak into your mic and pow. Just like CS:S. Link to comment
TmM_DEVIL Posted January 17, 2008 Share Posted January 17, 2008 And possibly, build in a microphone button? So when you push the button(hold it down), you speak into your mic and pow. Just like CS:S. where did voip get added lol Link to comment
[CaM] Posted January 18, 2008 Share Posted January 18, 2008 It didn't, i just forgot to say they should add voice. Link to comment
Truespin Posted January 18, 2008 Share Posted January 18, 2008 Yes, a built-in TeamSpeak platform.....when you speak, your modell speaks also.......the closer you come, the louder it gets. This could be more easy you think, cause TS3 is made with lua. But this would be toooo much, I think. Link to comment
Twig Posted January 18, 2008 Share Posted January 18, 2008 http://mumble.sourceforge.net Mumble does this already, and possibly using http://mumble.sourceforge.net/Link someone might be able to make it work with SA. Link to comment
DazzaJay Posted January 18, 2008 Author Share Posted January 18, 2008 ok. this has gotten a bit off topic. so i will bring it back a bit. from what i have learnt, the eaisiest method for this would be to bind it to the same keys that interact with the text chat box.... so if somone presses T or Y the icon appears above thier head. and if they press Enter, Return or Esc, it removes the icon (if icon is above head) sadly i dont know enough about scripting to do this, and the wiki makes me even more confused. so can anyone point me in the right direction? Link to comment
eAi Posted January 18, 2008 Share Posted January 18, 2008 Just use isChatBoxInputActive. Link to comment
ruby159 Posted January 19, 2008 Share Posted January 19, 2008 Just use isChatBoxInputActive. no example..... can you make a example? Link to comment
Twig Posted January 19, 2008 Share Posted January 19, 2008 if isChatBoxInputActive() == true then outputChatBox("your typing") end Probly just works like that Link to comment
DazzaJay Posted January 19, 2008 Author Share Posted January 19, 2008 and how does somone with pretty much no knowlage of LUA make that peice of code show a .png image above somones head? Link to comment
Twig Posted January 19, 2008 Share Posted January 19, 2008 The same way anyone else who started off knowing nothing of lua, you learn. If that is indeed how it works then you'd use that snippet to call a function which would add the image as eAi suggested here find the player's position, add 1.5 or so to the Z axis. Then use getScreenFromWorldPosition on it and place a static image at that point. I doubt you'd find anyone willing to write it for you unless they wanted it themself. Link to comment
DazzaJay Posted January 19, 2008 Author Share Posted January 19, 2008 I doubt you'd find anyone willing to write it for you unless they wanted it themself. yeah, i remembered when the community used to be helpfull. but all the good people left. and now nobody helps anyone. Link to comment
Twig Posted January 19, 2008 Share Posted January 19, 2008 To be honest I think your being very rude, people are pointing you in the correct direction and by applying your brain you'd work it out. If you want to be spoon fed, then I certainly can't remember a time when the community would do such a thing and I've been here since the days of 0.3. Thats all I have to say. Link to comment
Jumba' Posted January 19, 2008 Share Posted January 19, 2008 I doubt you'd find anyone willing to write it for you unless they wanted it themself. yeah, i remembered when the community used to be helpfull. but all the good people left. and now nobody helps anyone. back then coding was in mIRC, now its Lua, so obviously not as many people know it. Link to comment
DazzaJay Posted January 19, 2008 Author Share Posted January 19, 2008 im not trying to be rude, im just trying to point out facts. People used to help others. help them Learn how to do things... just linking to stuff on the wiki, where the Examples are like this... --This line does...blabhalbalhb --abababa --This line does this... mooo ^^ taken from this link: http://development.mtasa.com/index.php? ... nputActive isnt any help attall, to be precise it makes things more confusing to a learner, and is a pure waste of time. Now, as ive said befoer, i know Nothing about LUA, i have been learning, But i CANT LEARN anything if i CANT SEE working examples. thats why if you look back at all my old threads, from back when Mirc was in use, i would ask somthing, somone would give a decent example, and i would never ask for anything like it again, because i could remember it, and adapt that peicee of code to other similar things. But with No help, no examples, it kind of makes things ridiculously hard. Link to comment
Twig Posted January 19, 2008 Share Posted January 19, 2008 An examples isn't really needed for the function as "Returns true if the chatbox is receiving input, false if not active." pretty much explains it all. It just returns a boolean value i.e true or false. And anyhow, I gave you an example. Link to comment
DazzaJay Posted January 19, 2008 Author Share Posted January 19, 2008 if isChatBoxInputActive() == true then outputChatBox("your typing") end Look, that peice of code... from what i understand.... if the chat box is open, then it outputs "your typing" to the chatbox, is that correct? and if so, how do i adapt that peice of code, to a .png image above somones head? and remove that image when they have closed the Say: box? Link to comment
50p Posted January 19, 2008 Share Posted January 19, 2008 guiCreateStaticImage, guiSetVisible, getElementPosition, bindKey, addEvent, addEventHandler, triggerEvent These are the most important functions you'll need to create what you want to. Take a look in gamemode 'stealth'. To be more accurate 'gadgets_client.lua' Link to comment
DazzaJay Posted January 19, 2008 Author Share Posted January 19, 2008 guiCreateStaticImage, guiSetVisible, getElementPosition, bindKey, addEvent, addEventHandler, triggerEventThese are the most important functions you'll need to create what you want to. Take a look in gamemode 'stealth'. To be more accurate 'gadgets_client.lua' iil look into it after i get back from the Star Trek Marathon, and i will post back here if i cant figure it out. Link to comment
50p Posted January 19, 2008 Share Posted January 19, 2008 At the near end of the file, you'll find comment ---INFRARED CODE Just folow the code below. If you've played stealth (obviously you have) then you must have use the goggles (infrared). You can see where the ENEMY and TEAM players' are, soo you can also create image above them using the same method. Link to comment
eAi Posted January 20, 2008 Share Posted January 20, 2008 You've got to try to code it yourself, even if you make a complete mess of it. We're happy to help but we can't do it for you... Give us something to comment on. The vast majority of wiki functions are documented. The one you picked out was really obvious - no arguments and just a boolean return. I know you might not find it obvious but thats more an issue with your general level of LUA/MTA experience which you can rectify by messing about writing some scripts We're sorry we haven't got every function documented completely, we put literally thousands of man hours into that wiki and we're pretty happy with it - it's better documentation than you'll find for many other projects. 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