Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. I'm wanting to stop players from spraying with the vehicle (hunter) missiles all arround and only shooting 3 in 5 seconds, i found out the best option was toggleControl in the end.
  2. Destroying a projectile makes it explode, so you'd be insta-killed by the explosion.
  3. Hello, is there any event wich is cancellable as the title suggests? Becouse i'm using onClientProjectileCreation combined with onClientKey, but onClientKey would just work for one key and binding another one ruins it, and teleporting the missile away causes a nasty effect for the client if using only the first event (Rockets dissapear and it isnt cool).
  4. fetchRemote to get resources from HTTP? It can get any file, i used to use it alongside with my forum avatars to load them to the client.
  5. Yeah, i ran into this issue when making my radio-streaming script. Usually the meta-table fills after 2-3 seconds, but he needs to check if the meta is there since if the playSound doesnt work propertly it will return nil. Same happens if the streamer is connected to the stream URL but it doesnt play a song, the meta-table will be true but empty.
  6. If you're using freeroam i'm not sure onPlayerSpawn will work, so it might be easier to just edit the freeroam resource or the script you're working on. Then its just a matter of using GetPedWeapon and GetPedTotalAmmo
  7. Follow what Jing said, else there's no way we can help you out. Please read this before posting
  8. Not exactly true, since the meta is always true if the sound is played, but the table will return empty, however it will become available after a while. Also i'd recommend you to use a timer on 500ms or 1sec or even a larger time, since checking onClientRender for the song meta-data might be a bit performance-unwise since the song name wont make a difference if it changes over that time.
  9. Looks lovely and great, but i myself what loved from MTA:SE was firstly the syntax checker wich was on-air and just saved alot of time is there a way to have this on sublime?, and second, is there a way to change the font to look exactly as SE? (Ignore the old-thrash code, it was a random lua file i got for testing) http://i.imgur.com/oT0LGFg.png EDIT: took screenshots for a step-by-step for those who need it: Type %appdata% in the path to go directly to roaming folder, and go to sublime text 3 folder. http://i.imgur.com/ESt2iGc.png Packages Folder http://i.imgur.com/8HtXheR.png User > Unzip 50p's stuff http://i.imgur.com/lu1SYrg.png Open a file and select the lua syntax for MTA:SA http://i.imgur.com/1m68NPX.png Select the Color scheme http://i.imgur.com/vAZ7KVt.png
  10. Thanks, that indeed looks interesting, kinda got lost a few times reading the chunk, but after a re-read or two i started getting the idea
  11. I've been figguring how this syntax should be written but i keep getting a failure on whenever the result is true. outputChatBox((table.size(attr) and table.size(attr)>0 ) or "no attributes") My simple idea is that the "And" should work as an if to shorten the lines of code, but it only works properly when the table is 0.. How would it be properly written, if possible? EDIT: finally found the reference and it was just as easy as swiping them arround, for those interested: outputChatBox((table.size(attr)>0 and table.size(attr) ) or "no attributes") http://www.lua.org/pil/3.3.html
  12. do you mind if we keep trying over and over? 64
  13. Little video by my friend MVM showing how the script can be easily set up and used for those which images werent enought and were to lazy to check it out
  14. Maybe its just me, but if i click on my server cmd tab it gets stuck and until i hit "space" or smth to un-stuck the selection done by the cursor the server freezes, anyone else experiencing this?
  15. Hello everyone, today i'm bringing to you guys my first release of this script, wich is very simple, yet effective. Basically this script will load an internet URL Radio (Specified by admin in the url.txt from the resoruce) and play it for everyone. For streaming into the script i personally recommend using http://www.giss.tv as it is totally free. The script is kind of a beta-release, on the future when i get a proper design i'll re-design it visually as to make it nicier. Community link: https://community.multitheftauto.com/in ... s&id=12314 Some full-size images: (Size @Community sucks) http://imgur.com/a/Px3Ho Greetz
  16. Rescripted it. function table.size(tab) local length = 0 for _ in pairs(tab) do length = length + 1 end return length end addEventHandler('onClientResourceStart',resourceRoot,function() local song = playSound("http://giss.tv:8000/EPGLiveRadio.mp3") setSoundVolume(song,1) local info = getSoundMetaTags(song) outputChatBox(type(info)) outputChatBox(table.size(info)) for i,v in pairs(info) do outputChatBox(i.." "..v) end handl = song sx,sy = guiGetScreenSize() colors = { tocolor(255,0,0),tocolor(0,255,0) } start = getTickCount() addEventHandler('onClientRender',root,clientRenderFunc) end) function clientRenderFunc() local now = getTickCount() if now-start >= 4000 then start = getTickCount() end local px = (now-start)/4000 local p = interpolateBetween(0,0,0,360,0,0,px,"Linear") if(handl) then local bt = getSoundFFTData(handl,2048,9) if not bt then return end if(not bt[1]) then return end local i = 1 local scale = (sx/42.5)*0.75 local base = (sx*0.029411)*0.75 bt[i] = (bt[i]^0.5)*scale --scale it (sqrt to make low values more visible) if not tonumber(bt[i]) then return end dxDrawRectangle(sx*0.3, sy - sy*0.1,sx*0.4,sy*0.1,tocolor(0,0,0,150)) dxDrawImage(sx/2 - (bt[i]+base)/2,sy/2 - (bt[i]+base)/2, base+bt[i],base+bt[i],"images/cd.png",p) end end Tried things, apparently it worked, it was becouse the songs i was playing via the stream were without meta tags at all, however when i edited the meta tags and got a response at the local playing, i tried playing the same exact file via the stream and it came empty.. Tried again setting a timer and guess what, you were right, lua wasnt waiting for the meta tags to load. Thanks a lot HyPeX
  17. I dont see how else the VLC player could be gathering the song name...
  18. So, hello everyone, so far i'm working on a streaming system, but the function "getSoundMetaTags" is returning empty, when it should work - VLC Player recognizes the song name and changes its title constantly. http://i.imgur.com/xF54Msw.png function table.size(tab) local length = 0 for _ in pairs(tab) do length = length + 1 end return length end local song = playSound("http://giss.tv:8000/EPGLiveRadio.mp3") setSoundVolume(song,0) local info = getSoundMetaTags(song) outputChatBox(type(info)) outputChatBox(table.size(info)) for i,v in pairs(info) do outputChatBox(i.." "..v) end Am i doing something wrong? i simply cant get any meta tags..
  19. My bad, i actually have fixed it in my script, i just was testing another thing in the meanwhile and forgot to set the variable back here EDITED OP, still looking on the issue why i cant send the direct resource pointer..
  20. Well hello, i'm sending a 75 object table to the client wich are all resource elements. However, when the table reaches the client is empty, tried using the resource names instead and it worked. So i'm assuming the reason is resource elements cant be sent via triggerElements, but it is said in the wiki "Any lua data type except functions", so i dont know why it isnt working? Server: addCommandHandler('maps',function() local MapList = exports.mapmanager:getMapsCompatibleWithGamemode ( getResourceFromName('race') ) outputChatBox(#MapList) triggerClientEvent(root,'maps', resourceRoot,MapList) end) Client: addEvent('maps',true) addEventHandler('maps',root,function(maps) outputChatBox(#maps) end) Output: 75 0 Greetz HyPeX
  21. Can you show me how to do that? (New to scripting) bool addCommandHandler ( string commandName, function handlerFunction, [bool restricted = false, bool caseSensitive = true] ) Check restricted argument. https://wiki.multitheftauto.com/wiki/AddCommandHandler
  22. Maybe it has something to do with older versions of windows not supporting them by being too old software? Thank you anyways, that'll do.
  23. The resource should check for who uses that, other than denying the players the exact command via acl (Wich i'm not totally sure it would work) i dont see any other thing you could do other than modify the resource.
×
×
  • Create New...