-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Yes i was thinking, lets add: When its released
-
Have you tested them all work?
-
Somenone can test this? function playerPressedKey(key, press) if webBrowser then if (press) then injectBrowserKeyDown(webBrowser, key) else injectBrowserKeyUp(webBrowser, key) end end end addEventHandler("onClientKey", root, playerPressedKey) PD: Could you make just like the rest of the wiki, "functions to be added"? as we know if they're aviable yet. (And also specify the testbuild version)
-
I have some ideas in mind wich i want to keep them private for now with this, and i've got a few ideas to add: -Event to detect when a page was finished loading, containing the url, weight, etc. -Basically, you can click with mouse with injectBrowserMouseDown, isnt it possible (and relatively easy) to clone this into keyboard?, if you can provide a way to inject keys, i can manage to make in lua an inject to each key with some IFs over there. -Why is a webpage unloaded while minimizing MTA?, i'm also unsure if there's an event in mta to check if a client minimized MTA. -How is this "loading" actually done? via going to server side and server loading and then coming back to the client, or is it direct from client>webpage? a way to block them, was to let the server "overwatch" what the client does (loads, etc), and be able to cancel it, like the server would be notified when a client starts loading a page, and if it doesnt like it, tell the client to stop it loading (eg. cancelEvent) Also, does it need a big "performance" jump? like, will my FPS have any hard blow using this web pages? And finally, pages like a youtube videos, the video needs to be downloaded first, or is it just streamed? EDIT: Randomly did this, could fix the issue where minimizing unloads them: Pages = {} Unloaded = {} function onClientMinimize() if Pages then ---Add Unloaded --Unload Pages (Aka remove them) end end addEventHandler("onClientMinimize", getRootElement(), onClientMinimize) function onClientRestore() if Unloaded then --Load Pages back (Aka add them to Pages) end end addEventHandler("onClientRestore", getRootElement(), onClientRestore)
-
I'd say that MTA is just a "way" to do your stuff, in fact, you are not selling mta, you are selling basically your work wich functions inside mta.
-
Could you post the table?
-
Creating a ped client-side and seting a target to it until you revive.
-
The .db file will be saved inside the script or the server?
-
The tutorial is a tat big foggy. Ineeded, dont ask for help if you're not willing to read.
-
Its pretty messed up, try this: function onPlayerEnterVehicle(thePlayer,seat) if seat == 0 then setRadioChannel(0) addEventHandler("onClientRender", getRootElement(), RenderClient) bindKey("mouse_wheel_up", "down", PlaySound, "up") bindKey("mouse_wheel_down", "down", PlaySound, "down") end end addEventHandler("onClientPlayerVehicleEnter", getRootElement(), onPlayerEnterVehicle) function stopMySound(player,seat) if ( player == localPlayer ) then stopSound( sound ) removeEventHandler("onClientRender", getRootElement(), RenderClient) unbindKey("mouse_wheel_up", "down", PlaySound) unbindKey("mouse_wheel_down", "down", PlaySound) n = 0 end end addEventHandler("onClientPlayerVehicleExit",getRootElement(),stopMySound) function RenderClient() if isPedInVehicle(localPlayer) then dxDrawText("Song Name: "..title, x*0.299, y*0.778, x*0.599, y*0.800, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Radio: "..tostring(radiotitle), x*0.299, y*0.757, x*0.599, y*0.778, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end end function PlaySound(state) local x,y,z = getElementPosition(getLocalPlayer()) n = tonumber(n) if sound then stopSound(sound) end if state == "up" then n = n + 1 if n == 6 then n = 1 end elseif state == "down" then n = n - 1 if n == 0 then n = 1 end end local n = tonumber(n) sound = playSound3D(radios[n][1], x,y,z) radiotitle = radios[n][2] end function UpadteSound() if sound then local x,y,z = getElementPosition(getLocalPlayer()) setElementPosition(sound, x,y,z) end end addEventHandler("onClientRender", getRootElement(), UpdateSound) PD: it will also stop you from going to any higher value of N than 6, or any lower one than 1. (it will just re-play the lowest/highest)
-
You should post in the client-Linux @Support section.
-
local x,y = guiGetScreenSize() for i=1, 18 do dxDrawText("TEXT: ".. i, x*0.2, 0 - y*0.03 + (y*0.05 * i),x,y,tocolor(255,255,255,255)) end Good luck PD: the 0-y*0.03 was to make the texts start from 0.02
-
Well, now the server just went down and our webpage bf3-mta.tk is still up, is there anywhere to search for crash logs?
-
To help you get it, imageStart/textStart table contains base positions according to 5 different possibilities to dxDrawImage and dxDrawText. ImageNow/TextNow are variables wich are constantly being edited, and they go from one to another possible position with interpolateBetween.
-
EDIT: found out a number was missing in my tables, i only had edited one of them when i saw the error before EG: {"Tuning",0.61, 0.8, 0.1,0.1, x * 0.05 + (x*0.6), y*0.85,255}, -- {"Tuning",0.61, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.6), y*0.85,255}, 270 value was missing.
-
gui/client.lua:448: bad argument @'interpolateBetween' [expected number at argument at argument 1, got boolean] Line 448 translates to line 8 on my pasted code up there.
-
Well, my interpolate is giving boolean and stops working on one argument, the others just work fine.. but i cant get the value wich is failing.. Note that image one works pefrectly, while text doesnt. for a=1, 4 do local nimage = "Image"..a local ntext = "Text"..a for c=1, 4 do Dashboard.Positions.ImageNow[nimage][c] = interpolateBetween(Dashboard.Positions.ImageNow[nimage][c], 0,0, Dashboard.Positions.ImageStart[nimage][endx][c],0,0, progress, "Linear") end for b=2, 9 do Dashboard.Positions.TextNow[ntext][b] = interpolateBetween(Dashboard.Positions.TextNow[ntext][b], 0,0, Dashboard.Positions.TextStart[ntext][endx][b],0,0, progress, "Linear") end end Table: local Dashboard = { Positions = { ImageStart = { Image1 = { {0.2, 0, 1, 1, "Image1.jpg"}, {0.2, 0, 1, 1, "Image1.jpg"}, {0.2, 0, 1, 1, "Image1.jpg"}, {0.2, 0, 1, 1, "Image1.jpg"}, {0.2, 0, 1, 1, "Image1.jpg"} }, Image2 = { {0.4, 0, 1, 1, "Image2.jpg"}, {0.7, 0, 1, 1, "Image2.jpg"}, {0.3, 0, 1, 1, "Image2.jpg"}, {0.3, 0, 1, 1, "Image2.jpg"}, {0.3, 0, 1, 1, "Image2.jpg"} }, Image3 = { {0.6, 0, 1, 1, "Image3.jpg"}, {0.8, 0, 1, 1, "Image3.jpg"}, {0.8, 0, 1, 1, "Image3.jpg"}, {0.4, 0, 1, 1, "Image3.jpg"}, {0.4, 0, 1, 1, "Image3.jpg"} }, Image4 = { {0.8, 0, 1, 1, "Image4.jpg"}, {0.9, 0, 1, 1, "Image4.jpg"}, {0.9, 0, 1, 1, "Image4.jpg"}, {0.9, 0, 1, 1, "Image4.jpg"}, {0.5, 0, 1, 1, "Image4.jpg"} }, }, ImageNow = { Image1 = {0.2, 0, 1, 1, "Image1.jpg"}, Image2 = {0.4, 0, 1, 1, "Image2.jpg"}, Image3 = {0.6, 0, 1, 1, "Image3.jpg"}, Image4 = {0.8, 0, 1, 1, "Image4.jpg"}, }, TextStart = { Text1 = { {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,0}, {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255} }, Text2 = { {"Rankings", 0.41, 0.8, 0.1,0.1, x * 0.05 + (x*0.4), y*0.85,255}, {"Rankings", 0.71, 0.8, 0.1,0.1, x * 0.05 + (x*0.7), y*0.85,255}, {"Rankings", 0.31, 0.8, 0.1,0.1, x * 0.05 + (x*0.3), y*0.85,0}, {"Rankings", 0.31, 0.8, 0.1,0.1, x * 0.05 + (x*0.3), y*0.85,255}, {"Rankings", 0.31, 0.8, 0.1,0.1, x * 0.05 + (x*0.3), y*0.85,255} }, Text3 = { {"Tuning",0.61, 0.8, 0.1,0.1, x * 0.05 + (x*0.6), y*0.85,255}, {"Tuning",0.81, 0.8, 0.1,0.1, x * 0.05 + (x*0.8 ), y*0.85,255}, {"Tuning",0.81, 0.8, 0.1,0.1, x * 0.05 + (x*0.8 ), y*0.85,255}, {"Tuning",0.41, 0.8, 0.1,0.1, x * 0.05 + (x*0.4), y*0.85,0}, {"Tuning",0.41, 0.8, 0.1,0.1, x * 0.05 + (x*0.4), y*0.85,255} }, Text4 = { {"Settings", 0.81, 0.8, 0.1,0.1, x * 0.05 + (x*0.8 ), y*0.85,255}, {"Settings", 0.91, 0.8, 0.1,0.1, x * 0.05 + (x*0.9), y*0.85,255}, {"Settings", 0.91, 0.8, 0.1,0.1, x * 0.05 + (x*0.9), y*0.85,255}, {"Settings", 0.91, 0.8, 0.1,0.1, x * 0.05 + (x*0.9), y*0.85,255}, {"Settings", 0.51, 0.8, 0.1,0.1, x * 0.05 + (x*0.5), y*0.85,0} }, }, ImageNow = { Image1 = {0.2, 0, 1, 1, "Image1.jpg"}, Image2 = {0.4, 0, 1, 1, "Image2.jpg"}, Image3 = {0.6, 0, 1, 1, "Image3.jpg"}, Image4 = {0.8, 0, 1, 1, "Image4.jpg"}, }, TextNow = { Text1 = {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, Text2 = {"Rankings", 0.41, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.4), y*0.85,255}, Text3 = {"Tuning",0.61, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.6), y*0.85,255}, Text4 = {"Settings", 0.81, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.8 ), y*0.85,255}, }, }, CurentSelected = 0, rankings = { labels = { "Kills", "Deaths", "Headshots", "PlayTime", "EXP", "Level", "Rank", }, currentTop = "Kills", current = 1, labelsData = { "Kills", "Deaths", "PlayTime", "Headshots", "EXP", "Level", "Rank", }, localLabel = {0,0,0,0,0,0,0}, data = {0,0,0,0,0,0,0}, }, }
-
Its just an extra check, sometimes usefull. (if you call it by mistake for example).
-
The only reason why this happens is basically the fact that the triggering is wrong, it is triggered on player join/etc, and it makes it close for the rest of players. Just remember to make the player source of the event hideWindow. function hidetheWindow() if source ~= getLocalPlayer() then return end guiSetInputEnabled(false) showCursor(false) guiSetVisible(darkpic, false) end addEvent("hideWindow", true) addEventHandler("hideWindow", root, hidetheWindow)
-
Becouse you can create some animations and effects with the vehicles, a podium is a clear example of this. (I'd make winner vehicle golde, second one silver, and third one bronze colour) Anyways, check my previous post and tell me if it works okay.
-
you should check the vehicle velocity within some time (id say client render) local vx,vy,vz = getElementVelocity(vehicle) if vz < 0 then if not isVehicleOnGround(vehicle) --falling in Z position (CHECK THAT GOING DOWN A HILL WITH A SMALL JUMP WILL ALSO DO THIS POSITIVE) end end
-
MTA security measures i guess? This has nothing to do with mta security measures, creating a vehicle client-side will only create it for a specific client (player), nobody will be able to see it except for this client, that's why you can't enter a vehicle that was created on client-side. Thought of some anti-cheat for local side. Anyways, you can create it, warp a ped inside, and make it accelerate with toggleControl, its kind of usable EDIT: @Post starter: Client: function createVehicle(cmd,id) if veh then destroyElement(veh) end local x,y,z = getElementPosition(getLocalPlayer()) veh = createVehicle(id,x+5,y,z) end addCommandHandler("createVehicle", createVehicle) function setColor(cmd, r,g,b,a) setVehicleColor(veh, r,g,b,a) end addCommandHandler("setColor", setColor) function SpawnVehicle() local r,g,b,a = getVehicleColor(veh) -- Should be global variable local x,y,z = getElementPosition(veh) local rx,ry,rz = getElementRotation(veh) local id = getElementModel(veh) triggerServerEvent("SpawnVehicle", getLocalPlayer(), id,x,y,z,rx,ry,rz,r,g,b,a) destroyElement(veh) end addCommandHandler("spawnVehicle", SpawnVehicle) Server: veh = {} function SpawnVehicle(id,x,y,z,rx,ry,rz,r,g,b,a) veh[source] = createVehicle(id,x,y,z) setElementRotation(veh[source],rx,ry,rz) setVehicleColor(veh[source], r,g,b,a) end addEvent("SpawnVehicle") addEventHandler("SpawnVehicle", getRootElement(), SpawnVehicle) PD: Didnt tested it. EDIT2: About another dimension: client: (Add this to the prev) function SpecVehicle() if veh then setElementDimension(veh, 30) local x,y,z = getElementPosition(veh) local dimension = getElementDimension(veh) setElementDimension(getLocalPlayer(), dimension) setCameraMatrix(x-5,y,z+5, unpack(getElementPosition(veh))) else setElementDimension(getLocalPlayer(), 0) setCameraTarget(getLocalPlayer()) end end addEventHandler("onClientRender", getRootElement(), SpecVehicle)
-
These events say that they're triggered when X things happens on top of a GUI element, is there any way to get this working outside GUI elements? Regards HyPeX
-
MTA security measures i guess?
-
erros in debug?
