Gallardo9944
Members-
Posts
442 -
Joined
-
Last visited
Everything posted by Gallardo9944
-
__newindex is used to scope _G access to avoid hacking within loadstring part. Any hacker can unlock triggerServerEvent and trigger that. __newindex can block setting variables which are defined globally.
-
If you want to understand how it works, then you have to create __index and __newindex metamethods inside the metatable of your environment and call a function which returns the localPlayer, source, etc dending on the keyname. You can use rawget to get that.
-
Should work. apt-get install lib32readline5 ia32-libs lib32ncursesw5
-
there is another way. You can send the image clientside with triggerLatentClientEvent (use latent instead of default here cause it doesn't block the main traffic!) with the pixels. Here goes the tutorial from wiki: -- SERVER function startImageDownload( playerToReceive ) fetchRemote ( "http://www.example.com/image.jpg", myCallback, "", false, playerToReceive ) end function myCallback( responseData, errno, playerToReceive ) if errno == 0 then triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) end end --CLIENT addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", resourceRoot, function( pixels ) if myTexture then destroyElement( myTexture ) end myTexture = dxCreateTexture( pixels ) end ) addEventHandler("onClientRender", root, function() if myTexture then local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture ) end end ) This way, the image won't be even saved to the drive. fileDelete doesn't trigger until you finish the download so ANYONE can get your images while downloading. Same with scripts.
-
yes, it's fixable, I'll ask Arezu if I may share the way with you, and if yes - i'll give you the code.
-
well, the only thing to do is to check onClientGUIClick event and apply your shader when clicked.
-
@Saml1er, would totally be the same. @Bonsai, in fact, you're getting userdata of 000001 (or similar) when using markers, right? That's root. You have to use rawget within the __index and specify source, root, resourceRoot, localPlayer, etc in the metatable. You have to return them in rawget if your key is "source", ... P.S. Thanks to Arezu for the way of fixing the issue.
-
i don't have issues with that though. Markers work as intended.
-
@Bonsai, so how did you solve the problem?
-
no problem, anytime.
-
you're welcome.
-
Try using your internal IP as a host.
-
"Note: Client side function only works with the server the player is connected to" - wiki. Using localhost clientside will attempt to read client's localhost, not the server's one.
-
modename = "" if string.find(name,"%[DM]") then modename = "[DM]" elseif string.find(name,"%[DD]") then modename = "[DD]" end
-
just use executeSQLQuery and CREATE TABLE in it. executeSQLCreateTable is very old and deprecated
-
@P4RK0UR, it doesn't matter if you use setVehicleRespawnPosition
-
Should be fine. executeSQLQuery("INSERT INTO db_data (name,code) VALUES('"..getPlayerName(source).."','"..code.."')")
-
you have double " before 0 for some reason. Also, you shouldn't set id to anything if it's AUTO_INCREMENT - it's set automatically.
-
@McDeKi, the code is going to bug as far as you set "x" to be "50" and you set "x" to be the screen width. Use different variable names for the positions. EDIT: yeah, i'm fast, more than 500 hoursepowers...
-
executeSQLCreateTable( "db_data", "id INT NOT NULL AUTO_INCREMENT, name STRING, code STRING" ) Should be fine, untested though. (or it could be AUTOINCREMENT (without "_"), cause I have never worked with sqlite, only MySQL. SQLite wiki says it's AUTOINCREMENT)
-
and you can add a click checker to the code above: function onClick() local check = isMouseWithinRangeOf(x*0,x*0.5,y*0,y*0.5) -- start x, width, start y, height if check then outputChatBox("you have pressed inside the rectangle") end end addEventHandler("onClientClick",getRootElement(),onClick)
-
if you use MySQL database, you can create an ID field with AUTO_INCREMENT parameter.
-
Are you sure there is no other code which fades the camera out?
-
or check if cursor position is within some range and trigger some function you need. onClientClick would help with it.
-
read map file as an xml and build objects, markers, etc manually.
