-
Posts
656 -
Joined
-
Days Won
9
Everything posted by SpecT
-
Ye, but you don't start from anywhere. Why don't you write some code and we will help you to make it working? Now stop spamming and good luck!
-
Maybe there are too many running resources. How can we know without any information ?
-
You are welcome!
-
col = createColCuboid ( -2424.2, -610, 132.5, 5, 5, 5 ) function main() icon = guiCreateStaticImage(0.6, 0.3, 0.1, 0.08, "files/mg42.png", true) setTimer ( function() guiSetVisible(icon, false) end, 50, 1 ) end addEventHandler( "onClientResourceStart", root, main ) function onHit() guiSetVisible(icon, true) end addEventHandler( "onClientColShapeHit", col, onHit ) function onLeave() guiSetVisible(icon, false) end addEventHandler( "onClientColShapeLeave", col, onLeave ) function binds() bindKey ( "e", "down", onEnter ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), binds) function onEnter(posX, posY, posZ) if guiGetVisible(icon) then local x, y, z = getElementPosition(localPlayer) setElementPosition(localPlayer, -2422.1469, -607.8954, 132.56) end end This should work. You just have to use guiGetVisible to check if the GUI element is visible.
-
Aww ... now I got it lel. So second.millisecond works fine. Thanks for the reply mate!
-
Hey guys! Am I using it wrong or there is a problem with that function? I want to sync the song position between the client and server. So I send the length (in milliseconds) to the client using the function setSoundPosition. But for some reason it does nothing. What's the problem and am I doing it wrong ? example code: function example(soundElement,position) if isElement(soundElement) then setSoundPosition(soundElement,position) end end Thanks in advance!
-
Yeah lol I missed that. It used to cause some more errors but I fixed them so now it's working fine. Anyway thanks for the reply!
-
Hey guys! I'm having a problem with my first sql script/system. So it's a music system. It used to get the songs from XML but since XML isn't good for large data I decided to learn and make it with SQL. So yeah I successfully moved the data from the XML file to the SQL file and it's working good. The problem is on the loading part - I want to make it in a table and for some reason it gives me an error "attempt to index global "t" (a nil value). Here is wrong code: if result then for _, row in ipairs ( result ) do local name, length, played = (row['songName']), row['length'], row['requested'] t[name] = {name,length,played} songData = t end end It loads normally when its like that : t = {name,length,played} but doesn't load when its like the above code. Thanks in advance!
-
Or just use http://www.geoplugin.net for country detection. You can collect the data using JSON. [url=http://www.geoplugin.net/json.gp?ip=1.1.1.1]http://www.geoplugin.net/json.gp?ip=1.1.1.1[/url] And if the continentCode is EU then let the player join. You are welcome!
-
Well ... you are saying this like we know the guy who made the topic. He asked for "help" but actually he wants ready code so I suggest this topic to be closed. If you know nothing about lua and you are asking for someone to give you the script in silver platter you are in the totally wrong place. So Droam|Oussez you better learn scripting or at least try to write some code and we will help you out!
-
The guys are understanding. But begging for ready code is not the right thing to do here! And please read carefully the other replies before you reply! And now on the topic: Find a normal afk script. Open it and replace the function where it kills/kicks the player with setElementAlpha(player,250) Is it that hard ? I don't think so.
-
The same is for this https://community.multitheftauto.com/in ... s&id=12223 DONE
-
Nevermind guys. I got a solution for that by myself. 1. I got the idea to find out how to rename all the songs -> without spaces 2. Found the script (Power shell) 3. Uploaded the songs on the storage server 4. In the streaming script I used as url the song name with removed spaces 5. Working fine now Anyway thanks for the replies. I hope that this solution will be helpful for the others. Here is the renaming powershell script: dir | Where-Object { $_.name.Contains(" ") } | Rename-Item -NewName { $_.name -replace " ","" } Save it as .ps1
-
Streaming song: playSound("http://ip.ip.ip.ip:22003/songs/songName - songName.mp3",false) That's what I'm using. The problem is that when I try to stream it like that it goes like "http://ip.ip.ip.ip:22003/songs/songName%20-%20songName.mp3" so the storage server can't find that song with these %20 in in. When the song name is like "songName-songName.mp3" (without spaces) it works perfectly .. but how can I rename 1500+ songs ? I just wanted to know if its possible to deal with that somehow.
-
No .. its not. Read what I wrote carefully ! I request a song example "Singer - songName" but when the request goes to the server the song name becomes "Singer%20-%20songName" sooo the server cant find that file "Singer%20-%20songName" (The actual file is "Singer - songName"). That's the problem. In that case all the songs must not have spaces , because otherwise they won't be found. PS: If you still can't understand tell me so I will try to explain it somehow better ..
-
This should work. out = createMarker ( 418.794921875, -84.074752807617, 1001.8046875, "arrow", 1.5, 236, 229, 30 ) setElementInterior ( out, 3, 418.794921875, -84.074752807617, 1001.8046875 ) function outside() if out == source then setElementInterior( localPlayer , 0, 209, -63 , 2 ) end end addEventHandler ( "onMarkerHit", root, outside ) Also don't forget to use [ lua ] function .... [ /lua ] !
-
Yeah, but just 2 GB aren't enough .. I used web hosting with 10 GB space but there were streaming problems (the song stops whenever it wants) What do you mean with that ? Thanks for the replies guys! I appreciate that!
-
Yeah, I know that ... But the problem is that the storage server can't find that name with %20 in it.
-
Hello guys! I want to use other game server as songs storage so I made a resource and added the songs in the meta with attribute "download = false". Okay and now is the time when the songs should be streamed .. I don't know how to deal with the spaces. For example: Someone ft. someone - someone's song In that case the spaces are being replaced with %20 and the storage server can't find such song. How to deal with this if there is any way ?
-
If it has an youtube player why didn't you post a picture of it ?
-
Hello guys! We had a server hosting in germany but since it started being DDoSed (it had no DDoS protection) we told the hosting company to move the server to Hungary so it will have DDoS protection. They moved it but then a download problem came. The map download has no problems but the second one with the scripts and stuff is stuck on 0 b and it doesn't show any error - Icould stay in the server for hours but it wont show anything. So could you tell me what may cause this ?
-
The table "weaponAmmoTable" is empty. Are you sure that there is data in it ?
-
Ok toni012899, read carefully: - First, that's exactly what I suggested in this post. - Secondly, we CAN steal your scripts by doing that. It's just harder so "noobs" can't still your scripts even if it's still possible. Please read other's posts so you know everything that has been said before posting the same answers/suggestions. Oh, jeez ... I'm really really sorry I didn't read your post. Sorry once again ...
-
Yes, but just commands added by your resources (not MTA harcoded). ExecuteCommandHandler
-
Or you could put the client side script in the server side as a string and send it to the client and load it with loadstring. Then they will just see the receive function and they wont be able to steal anything.