
Pirulax
Discord Moderators-
Posts
403 -
Joined
-
Last visited
Everything posted by Pirulax
-
Have a nice day
-
You have overwritten the function called 'type'. And since exports table uses that its :Oed. Submitted a PR right now. Just rename the variable in you script from 'type' to something else.
-
You should use utf8.lower() instead of the built-in one.
-
What do u wanna rotate? The is the Los Santos thing a part of the img? If yes, just use math.sin()--// Use this on axis Y math.cos()--// Use this on axis X math.rad()-- U'll need to put this into sin and cos to convert degs to radians.
-
Its -3072 - 3072, so its 3072*2 so its 6144. And please, create a texture for the radar with dxCreateTexture with textureFormat = "dxt3", otherwise the radar itself, just to draw the image will eat 8-10-% CPU. function getMapCoordsFromWorldCoords(x, y, imgSize) imgSize = imgSize or 3072 return ((x + 3072) / 6144) * imgSize, (-(y - 3072) / 6144) * imgSize end With this function you can get the 2D coords on the map from world position. For zoom you need to make the image smaller(zoom in) or bigger(zoom out). I hope I helped you If it returns inaccurate positions use this function instead: function getMapCoordsFromWorldCoords(x, y, imgSize) imgSize = imgSize or 3072 return ((x + 3000) / 6000) * imgSize, (-(y - 3000) / 6000) * imgSize end The way I did it was, that I got the position from this function, then i subbed usize/2, vsize/2. So i got the U and V. The size'll be usize and vsize. I have a lot of hard work, and time in figuring this out, so, I'll not tell every "secret". Think a little bit.
-
Thanks, never thought about this! You got some +rep from me.
- 10 replies
-
- 1
-
-
Hm, for this i would use the object_preview resource, that would help you a lot. Nah, it doesnt look that good, but its better than nothing, isn't it?
-
Nah, at least you learned something from that ExternalGaming gm Good to see that.
-
Use the <> tag please. Enable OOP(Object Orientated Programming) in meta.xml using the <oop>true</oop> tag. Or just use setElementData() instead of :setData(), because using OOP only sometimes makes no sense at all. Or if you want a fairly good looking script then you should use :setRotation() instead of setElementRotation() and use :setFrozen() instead of setElementFrozen()
-
use a function instead, because u'll use it a lot in the future. and, if i would be u, i would use a variable like: local currentPanelName = "information" And, then under render I would use an if statement, like: if (currentPanelName=="information") then --// Ur code here elseif (currentPanelName=="panel2") then --// Ur code here end
-
Happens, I was tired as I said. Btw, here is the working code then: addCommandHandler("gotobeach", function(source) if (isPedDead(source)) then spawnPlayer(source, 343.20026, -1780.60388, 5.22299) else setElementPosition(source, 343.20026, -1780.60388, 5.22299) end end ) And actually, there is no predefined 'source' variable in addCommandHandler, and why would you spawn a player?
-
*Server-side* Was tired, sorry
-
local equipos = { --{"TeamName",r,b,g}, {"Zombies",255,0,0}, {"Humanos",0, 200,0}, } for _ ,v in ipairs ( equipos ) do createTeam (unpack(v)) end addEventHandler("onPlayerSpawn", root, function () local team = getTeamFromName(equipos[math.random(#equipos)]) if not team then return end setPlayerTeam(source, team) end )
-
Because it should be client-side, which is dumb. addCommandHandler("gotobeach", function goToBeach(source) setElementPosition(source, 343.20026, -1780.60388, 5.22299) end )
-
I dont know if some1 have noticed it, but it should be countCheckpointBusRoad setElementData(player, "countCheckpoitBusRoad", 0) -- somewhere in the code local countCheckpoint = getElementData(player, "countCheckpoitBusRoad") -- Why do u store it in elementData, if only the same resource uses it? setElementData(player, "countCheckpoitBusRoad", countCheckpoint + 1) -- set element's data to the current value + 1 It should be working. I suppose that the element on which you set the elementData was the problem(changed source to player at line 1)
-
So, the idea is simple. I want to make an interior customizing system, but I dont want to use so called "building blocks", because they suck, instead, I want to give players a grid on which they can create a floor / wall ingame, so basically, i need to create / modify a DFF. Really, i would just modify vertexes, nothing more. I've found this but, its not documented very well, and its in russian too. Tried searching on Google for a documentation for DFF/COL files in GTA, but haven't found any, just found one about COL, but that haven't helped much either. I hope someone can help me, because I really dont want to stick to that "bulding blocks" thing, it just sucks.
-
Maybe this helps you.
-
Did /debugscript 3 throw errors?
-
Or he could you use a _ instead. But makes no sense to do that
-
You can use everything actually instead of value, I mean every false condition(so only nil and false and _(this is called a dummy variable, and its always a nil value))
-
Hello, because you put effort in it, I'll write a code for ya'. local HEX_TABLE = {[0] = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "A", "B", "C", "D", "E", "F"} local ENABLED_MSG_TYPES = {[0] = true} local function rgb2hex(r,g,b) return "#"..HEX_TABLE[math.floor(r/16)]..HEX_TABLE[r-(16*r1)]..HEX_TABLE[math.floor(g/16)].. HEX_TABLE[g-(16*g1)]..HEX_TABLE[math.floor(b/16)]..HEX_TABLE[b-(16*b1)] end addEventHandler("onPlayerChat", root, function(msg, msgType) if (not DISABLED_MSG_TYPES[msgType]) then outputChatBox(rgb2hex(getPlayerNametagColor(source))..msg) end end ) Untested.
-
Read the dff/col/txd file, then use base64Encode(which Mr.Loki forgot), then encode the string u got, then write it. And there you have ur encoded file. To load it, you'll need the key you provided to T.E.A. base64Decode, with that you'll get the bytes, pass the bytes to the function (engineLoadlDFF, and such,be sure it accepts raw data)
-
Hello. In MTA you have some predefined variables, but for security reasons, if you want to apply something to the player who triggered the event(actually, to that client) then just use the variable 'client'. These are variables that are 'hiddenly' defined, but you can use them. To fix your problem just remove the 'player' argument from the function, and replace every other 'player' argument to 'client' And use debugscript
-
I'll answer on your second question only, because I dont know the answer for the first: So, yeah it does, and I'm just about to implement a simple argument to dxDrawFunctions(only rectangle, image, image section and text for now) which will automatically position everything based on the screen resolution, and the source resolution on which the whole thing was designed. But its just kinda s*it. Use CEF instead, HTML+CSS is designed for such purposes, and yeah bootstrap will help you a lot, but for that you'll need to learn a little. I boostrap I personally cant help you, since, I'm a total noob in it.