-
Posts
730 -
Joined
-
Last visited
-
Days Won
2
Everything posted by koragg
-
You can make both the input text and the thing you're searching for (the result to be found) in small letters by using this: http://www.lua.org/manual/5.1/manual.html#pdf-string.lower That way it won't matter if you type "Infernus", "infernus", "INFERNUS", "iNfeRnuS" and so on. It will still work and show you the vehicle.
-
Isn't that modified radar made with shaders? Anyway, it's strange how it stopped working... changing host can't have anything to do with the resources.
-
You can use shaders to modify it. Have a look at this and see how it's made: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10225
-
Fixed!! With below code: addEvent("onMapStarting", true) function onMapStarting() canUsePJsAndLights = true setElementData(resourceRoot, "canUsePJsAndLights", true) for k, s in pairs(getElementsByType("spawnpoint")) do if getElementData(s, "upgrades") or getElementData(s, "paintjob") then canUsePJsAndLights = false setElementData(resourceRoot, "canUsePJsAndLights", false) end end for k, s in pairs(getElementsByType("checkpoint")) do if getElementData(s, "upgrades") or getElementData(s, "paintjob") then canUsePJsAndLights = false setElementData(resourceRoot, "canUsePJsAndLights", false) end end for k, s in pairs(getElementsByType("pickup")) do if getElementData(s, "upgrades") or getElementData(s, "paintjob") then canUsePJsAndLights = false setElementData(resourceRoot, "canUsePJsAndLights", false) end end if canUsePJsAndLights == false then local customLightsRes = getResourceFromName("cr_vehiclelights") if customLightsRes then if getResourceState(customLightsRes) == "running" then return end end setTimer(outputChatBox, 1500, 1, "This map has it's own custom upgrades, paintjobs and vehicle lights are disabled!") end end addEventHandler("onMapStarting", root, onMapStarting) And whenever I don't want paintjobs (and vehicle lights) to load I just use if canUsePJsAndLights == false then return end And for client-side I use the resource's element data which I've set above^. The problem before was that I didn't know from where that "upgrades" and "paintjob" element data came for checkpoints, spawnpoints and pickups but now I found out that it's there by default in MTA. This made my work super easy Thanks for all the help guys.
-
This became way too hard Well my paintjobs script works on all vehicles, literally all so editing the dff would be a huge download and i have no Idea how to do this since I've never used zModeler before. I guess I'll just detect if there are .txd and .dff files in the map's folder when a map starts (as @IIYAMA suggested). I can live with no paintjob on default cars if there is a modded one in the map. It's not like there are a lot of maps with custom vehicles which actually contain a switch to another non-modded one. Edit: line 435 here does that for another server but i still need to figure it out - https://github.com/JarnoVgr/Mr.Green-MTA-Resources/blob/master/resources/[gameplay]/gcshop/modshop/modshop_s.lua
-
Not sure how to check for extentions but also what if the vehicle changes from a pickup or on checkpoint hit? Let's say map starts with a modded Sultan, then there is a pickup or checkpoint and it changes to a not modded Infernus, can I somehow know at any point during the race if the current vehicle is a mod or not?
-
I've seen it been done at one server but even though it's resoures are open-source I found it hard to make it work. Basically I'm looking for a way to see if the currently played map has a custom vehicle model into it. I need this check because I want to disable custom paintjobs/vehicle lights if the player's current vehicle is a modded one (with txd and dff files). Also if the map starts with the modded vehicle but then switches to a normal gtasa vehicle I need paintjobs/lights to work normally. So I'm looking for a way to keep checking if the vehicle is a modded one or not and I'll make it with a setTimer of 50ms. Hope you can help. Merry Christmas to everyone btw
-
You can always simply use "resourceRoot" client side as well instead of that ugly long thing
-
@IIYAMA I'm studying trees in university and I hate it Haven't payed attention to that graph although I've seen it before.
-
Try to set the client event handler for 'root' as well instead of 'resourceRoot'. I had problems if it wasn't root recently.
-
You're trying to set position of a string, not of a player. You should put getPlayerFromName (targetPlayerName) instead of targetPlayerName in setElementPosition function.
-
On line 18 put "targetPlayer" instead of "player" in the outputChatBox. My bad.
-
Try to output in chat the content of the account data. Maybe it's not a number? Do this in a separate function: function testStuff (player) local acc = getPlayerAccount (player) if acc and isGuestAccount (acc) then return end local data = getAccountData (acc, "Zombie kills") if data then outputChatBox (data, player, 255, 0, 0) end addCommandHandler ("testdata", testStuff) Just type "testdata" in chat and tell me what comes up. Server side script btw.
-
Should work. Try this: if tonumber(getAccountData(account, "Zombie kills")) < 3000 then
-
Try this. Not tested though. Server-side: function changePlayerNick(player, command, target, newNick) local account = getPlayerAccount(player) local accName = getAccountName(account) if account and isGuestAccount(account) then return end if isObjectInACLGroup("user." ..accName, aclGetGroup("Admin")) then if not target or not newNick then outputChatBox("Correct command is /changenick player nick.", player, 255, 0, 0, true) return end local targetPlayer = getPlayerFromPartialName(target) if not targetPlayer then outputChatBox("No such player found.", player, 255, 0, 0, true) return end outputChatBox("You changed #FFFFFF"..getPlayerName(targetPlayer).."#00FF00's nickname to #FFFFFF"..newNick.."#00FF00.", player, 0, 255, 0, true) outputChatBox("Your nickname was changed from #FFFFFF"..getPlayerName(targetPlayer).."#00FF00 to #FFFFFF"..newNick.."#00FF00.", player, 0, 255, 0, true) setPlayerName(targetPlayer, newNick) else outputChatBox("You're not an Admin!", player, 255, 0, 0, true) return end end addCommandHandler("changenick", changePlayerNick) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
-
Put this code at the end of the file: https://wiki.multitheftauto.com/wiki/GetPedClothesID That error means that the function doesn't exist so you should add it as it's a useful function, not mta default one.
-
Yes it's same for all dxDraw functions.
-
How to know whether the world objects have been loaded
koragg replied to John Smith's topic in Scripting
It's really irritating when i switch to spectating and objects around the target haven't loaded. Would love to make them load faster as well. -
Have a look at this tutorial: It makes things look fine on any resolution. If the first method seems hard for you i posted an easier one as a reply. At least it's easier for me. Good luck!
-
At first glance I saw that you've made a typo OnPlayerScreenShot should be onPlayerScreenShot The wiki says imageData: A string which contains the JPEG image data. This can be saved with the file functions, or sent to players with triggerClientEvent or even uploaded to a web site. But it's pretty weird that there isn't any mention of saving a picture in none of the file functions. All of the parameters required are strings so putting the image data instead won't work. I'd also like to know the answer to this since it's something I've never even thought of doing. Try without the "e:/" part in fileCreate: local newFile = fileCreate(iname..".jpg") But fileWrite's second argument must be a string so I can't see how you'll put the image data there.
-
It's built in MTA, just press Y to team chat.
-
Hm ok then. Btw, does 'removeElementData(source, "data")" do the same thing as 'setElementData(source, "data", nil)' ?
-
Yeah, that will never work with 'guiSetInputMode'. You'll need to do something like if getElementData(localPlayer, "LoggedIn") == true then --open panel end client-side and something like this function onPlayerJoin() setElementData(source, "LoggedIn", false) end addEventHandler("onPlayerJoin", root, onPlayerJoin) function onPlayerLogin() setElementData(source, "LoggedIn", true) end addEventHandler("onPlayerLogin", root, onPlayerLogin) server-side. That's what I do and it works for me. Good luck