-
Posts
730 -
Joined
-
Last visited
-
Days Won
2
Everything posted by koragg
-
You can always use SQLite or MySQL databases for any sort of stuff, but don't look at me for help with that I hate SQL, account and element data all the way.
-
Well in that case try something from here: http://www.mediafire.com/file/emwel4ayeobp8sp/vehiclepaintjob.zip I'm not familiar how it syncs paintjobs with everyone (since it's client side?) but paintjobs are shaders so hope you find something useful there.
-
I'm pretty sure every player has a different nos color cuz I'm using it at my server Maybe not in that particular file but that's the resource for sure.
-
https://github.com/JarnoVgr/Mr.Green-MTA-Resources/blob/master/resources/[gameplay]/mrgreen-settings/visual.lua Here you can see how the different nitro color works (if you wanna search around the resource a bit).
-
Fixed, thanks
-
Worked, thanks. Also any way to check if the account to which I'm trying to login is already used by me? I mean, now the "login: You are already logged in" message doesn't show up and I wanna make a custom one when I am logged in but still try to login with the same credentials without logging out first. I tried this but didn't work (no errors as well): function onPlayerAlreadyLoggedIn(previousAccount, newAccount) if previousAccount == newAccount then outputChatBox("#0000FF* #FFFFFFYou've already logged in to #00FFFF"..getAccountName(previousAccount).."#FFFFFF's account!", source, 255, 255, 255, true) end end addEventHandler("onPlayerLogin", root, onPlayerAlreadyLoggedIn)
-
Hmmm... it should've worked. Try this example from the wiki (without changing anything, just to test if it works and if you get errors): -- In order to render the browser on the full screen, we need to know the dimensions. local screenWidth, screenHeight = guiGetScreenSize() -- Let's create a new browser in local mode. We will not be able to load an external URL. local webBrowser = createBrowser(screenWidth, screenHeight, false, false) -- This is the function to render the browser. function webBrowserRender() -- Render the browser on the full size of the screen. dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end -- The event onClientBrowserCreated will be triggered, after the browser has been initialized. -- After this event has been triggered, we will be able to load our URL and start drawing. addEventHandler("onClientBrowserCreated", webBrowser, function() -- After the browser has been initialized, we can load our website. loadBrowserURL(webBrowser, "https://www.youtube.com/") -- Now we can start to render the browser. addEventHandler("onClientRender", root, webBrowserRender) end )
-
A few pages back I saw a way to remove MTA's hardcoded messages like "login: ", "logout: " etc. when the player logs in/out, But the only one which gets removed is the one when the player logs in, the others still show up somehow although I've included them to be removed: function removeLoginText(text) if text == "login: You successfully logged in" or text == "login: You are already logged in" or text == "logout: You logged out" then cancelEvent() end end addEventHandler("onClientChatMessage", root, removeLoginText) Just the "login: You successfully logged in" one gets disabled but the other two still show up. Why? Any way to remove them as well? I tried making different functions for each of them but still the same.
-
local screenWidth, screenHeight = guiGetScreenSize(945, 736) local webBrowser = createBrowser(945, 736, false, false) function createBrowser() loadBrowserURL(webBrowser, "http://www.youtube.com") end addEventHandler("onClientBrowserCreated", webBrowser, createBrowser) function webBrowserRender() dxDrawImage(0, 0, 945, 736, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end function toggleBrowser() if isEventHandlerAdded("onClientRender", root, webBrowserRender) == false then addEventHandler("onClientRender", root, webBrowserRender) end if isEventHandlerAdded("onClientRender", root, webBrowserRender) == true then removeEventHandler("onClientRender", root, webBrowserRender) end end addCommandHandler("youtube", webBrowserRender) function isEventHandlerAdded(sEventName, pElementAttachedTo, func) if type(sEventName) == 'string' and isElement(pElementAttachedTo) and type(func) == 'function' then local aAttachedFunctions = getEventHandlers(sEventName, pElementAttachedTo) if type(aAttachedFunctions) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs(aAttachedFunctions) do if v == func then return true end end end end return false end I'm not sure if you can give arguments to 'guiGetScreenSize' though.
-
addEventHandler ("onClientRender", root, function ()... )
-
You're one of those guys who want everything done by somebody else. Read the rules of the section, take a course in good manners and maybe try to make something yourself. Good luck.
- 25 replies
-
- 1
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
@LopSided_ so that timer will be set only for the player who executed the command? I thought that if i do it like that it will be set for all players since it's server side If it's set just for the player who uses the command I've got some edits to do on my scripts
-
If the button's patent is set to the window which you hide then the button will also be hidden when you hide the window.
-
Attempt to compare number with boolean [HELP PLS]
koragg replied to Tibi [NextMTA]'s topic in Scripting
I mean @Tibi [NextMTA] lol. You posted "any proofs" and I thought you were the OP -
Attempt to compare number with boolean [HELP PLS]
koragg replied to Tibi [NextMTA]'s topic in Scripting
@ProMax try this: if getElementData(player, "acc:admin") and getElementData(player, "acc:admin") >= 7 then -
Attempt to compare number with boolean [HELP PLS]
koragg replied to Tibi [NextMTA]'s topic in Scripting
Please post code in the code editor ... how would we know which line is that? -
Maybe you don't update your element data when you earn more money? I don't know what could be the problem... how do you save the 'player:money' data?
-
Wait a second. Did you save both dollars and pennies in the same element data (player:money)? Put this below your code: function test() local money = getElementData(localPlayer, "player:money") outputChatBox(money) end addCommandHandler("testcash", test) Restart the script and type '/testcash' in your server's chatbox. Tell me what shows up after that in the chat.
-
Sorry but what exactly do you want to do ? Can you please post the full function/code so I can take a look at it as a whole, would be easier.
-
string convertNumber( int/string number ) The function wants a number and you're giving it a string by using the 'string.format' thing. And about the second attempt are you sure that the "player:money" data is saved as a number and not a string? You can try this and see if it's ok: string.format("%.02f$", convertNumber(tonumber(getElementData(localPlayer, "player:money"))))
-
https://wiki.multitheftauto.com/wiki/OnClientPreRender The example says it follows the player in a GTA2 way, so doesn't that mean that it's called every frame? Anyway here's an idea: function setNewCameraTarget() setCameraMatrix(1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) -- obviosly change the numbers to the position you want^ end function onPlayerWasted() -- default shake camera function --blablabla addEventHandler("onClientRender", root, setNewCameraTarget) -- you force it to use your camera spot on every frame end addEventHandler("onClientPreRender", root, onPlayerWasted)
- 25 replies
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
What are you talking about? Nowhere on the wiki does it say that it lasts for only one frame. Even the example is done with onPlayerJoin and not onClientRender And you can try to make a different function which sets the camera matrix how you want it and then just do 'addEventHandler("onPlayerWasted", root, cameraFunc)' in the preRender function. Worth a try, give code it's hard like this...
- 25 replies
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
About your dxDrawText. You forgot to do this: "And always remember to multiply the scale of the text by the "sy" variable to make it smaller on small resolutions and bigger on big ones." Take a look at the tutorial again cuz I'm from phone now and the code editor window is so bad that i don't even wanna try it right now.
-
Can't really do that since the login message is hardcoded into MTA itself (aka not in any resource, not even in LUA) That's why I asked what I asked.
-
https://wiki.multitheftauto.com/wiki/GuiGetScreenSize