
Karuzo
Members-
Posts
1,213 -
Joined
-
Last visited
Everything posted by Karuzo
-
You can do everything in MTA without using Cleo.
-
Hey Guys, I'm on OOP atm and i have a problem that mta can't get the length of self.apps, it says it's a nil value. This is the code: local x, y = guiGetScreenSize() local w,h = 400,600 local px, py = x/2-w/2,y/1.5-h/1.5 phone = {} phone.__index = phone; function phone:new() local data = {} data.apps = { -- {string name, int line, int row, string appIcon} {"placeholder", 0, 0, nil} } data.open = false data.keyToOpen = "F2" data.keyState = "down" data.network = "Freeroam" data.batterycharge = 100 data.curApp = "main" data.background = nil data.renderTarget = dxCreateRenderTarget(w, h, true) data.maxApps = 12 setmetatable(data, self) addEventHandler("onClientRender",root,data.render) return data end function phone:render() --render end function phone:newApp(name, icon) if #self.apps < device.maxApps+1 then local line, row = self:getFreeAppPosition() table.insert(self.apps, {name, line, row, icon}) end end phone:newApp("Settings", nil) function phone:getFreeAppPosition() for index, value in pairs ( self.apps ) do if index == #self.apps then local name, line, row, icon = unpack(self.apps[index]) if line < 4 then return ( (line or 0) + 1 ), ( (row or 0) ) elseif line == 4 then return ( 1 ), ( (row or 1) + 1 ) else return false end end end end phone:new()
-
Holy shet! I love this createEffect Function :DD Just can't get enough of it
-
local infoz = createPickup(2181.8864746094,1115.2287597656,12.34375,3,1273,0) local prop = createBlip(2181.8864746094,1115.2287597656,12.34375,31) addCommandHandler("comprar", function(player) local money = getPlayerMoney(player) local dono = getElementData(player,"donoCasa") if money == 200000 and dono ~= true then --- ~= siginifica diferente takePlayerMoney ( player, 200000 ) outputChatBox("Você comprou a propriedade Come a Lot",player) timer = setTimer ( function() setElementData(resourceRoot,"precoCasa",getElementData(resourceRoot,"precoCasa") + 25000) triggerClientEvent("reajustarPreco",resourceRoot,getElementData(resourceRoot,"precoCasa")) end, 60*1000, 0 ) setElementData(resourceRoot,"donoCasa",player) createBlip(2181.8864746094,1115.2287597656,12.34375,32) end end) addEventHandler("onPickupHit", infoz, function(player,dim) local dono = getElementData(resourceRoot,"donoCasa") if getElementType(player) == "player" and dim then if dono == false then outputChatBox("Não existe dono, você pode comprar esta casa",player) else outputChatBox("Você é o dono desta casa pode vende-la",player) end end end) addCommandHandler("lucrar", function(player) local dono = getElementData(resourceRoot,"donoCasa") if dono ~= false and dono == player then givePlayerMoney(player,Preco_casa1) if outputChatBox("Você recebeu " .. getElementData(resourceRoot,"precoCasa") .. " de lucro.",player) then setElementData(resourceRoot,"precoCasa",0) triggerClientEvent("reajustarPreco",root,getElementData(resourceRoot,"precoCasa")) end end end) addCommandHandler("vender", function(player) local dono = getElementData(resourceRoot,"donoCasa") if dono ~= false and dono == player then setElementData(resourceRoot,"timer",0) setElementData(resourceRoot,"precoCasa",0) killTimer( timer ) givePlayerMoney(player,200000) createBlip(2181.8864746094,1115.2287597656,12.34375,31) triggerClientEvent("reajustarPreco",root,Preco_casa1) outputChatBox("Você vendeu a propriedade Come a Lot",player) end end)
-
Hey Guys, So i have a problem with isElementWithinColShape. I tried to check if the player is in the colshape using source. But it always returns me bad Argument. My Code: addEventHandler("onClientColShapeHit",root, function(p) if p == localPlayer then local g local t = getPlayerTeam(p) if t then g = getTeamName(getPlayerTeam(p)) end local gangr = getElementData(source,"Gang") setElementData(p,"GangName",gangr) if not g then outputChatBox("Gang da degilsin!",180,180,0,false) end if g ~= gangr and g then outputChatBox("Düsman base'ye girdin! Dikkatli ol! Gang: "..tostring(gangr),180,0,0,false) addEventHandler("onClientRender",root,DrawInfos) setElementData(p,"showHud",false) timer = setTimer( function() outputChatBox("lol") if isElementWithinColShape(p,source) then setRadarAreaFlashing(r,true) count = count + 1 if count == 200 then removeEventHandler("onClientRender",root,DrawInfos) end end end ,1000,0) elseif g == gangr then outputChatBox("Gang Base'yi girdin!",0,180,0,false) addEventHandler("onClientRender",root,DrawInfos) setElementData(p,"showHud",false) end end end )
-
Everyone has it's own method. I prefer to use MySQL.
-
You can just simply use a variable to define the alpha and do alpha = alpha +/- 1
-
This is NOT possible afaik.
-
Well i tried to change the width/height and the position several times but didn't see a rectangle at all.
-
Hey Guys, So i'm trying to "attach" a rectangle to the ped's arm but the rectangle just doesn't show up. No Errors. This is my code: local dot = dxCreateTexture(1,1) local white = tocolor(255,255,255,255) function dxDrawRectangle3D(x,y,z,w,h,c,r) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, dot, h, c or white) end addEventHandler("onClientRender",root, function() local x,y,z = getPedBonePosition(localPlayer,23) dxDrawRectangle3D(x,y,z,20,20,tocolor(255,255,255,255)) end )
-
No you're gode. Close but not close enough.
-
You're completely wrong. 1. the 3rd argument is the time to execute. 2. the 2nd argument is the time interval. So your code makes no sense.
-
Ah yeah idk why i didn't come up to that. Thanks i'll give it a try.
-
keyword; conchita wurst's ugliest mien
-
I like the logo which we have atm more than this tho. Looks good but not that much work.
-
Hey Guys, So i need your help. I'm trying to let my hud shake like the hud in bf3 for instance. But my problem is i can't really do the without shaders. And im not really into shaders, 'cuz i never used them tho. So is there anyway to do this without shaders(i think not) and if not could someone give me just a small example how a shader for this would look like.
-
Whoa. That tonumber helped. Thank you very much.
-
function createHouse_func(player, _, preis, int) addCommandHandler("createhouse",createHouse_func)
-
https://wiki.multitheftauto.com/wiki/EngineLoadCOL
-
Hey guys, i'm workin on a gamemode atm but i got stuck at the house system. So my problem is that i'm unpacking the interior positions but unpack returns me an error that he expected a table but got nil. So here's my script: InteriorPosi = { [1] = {223.0538482666, 1287.3552246094, 1082.140625}, } --and so on local x, y, z = unpack(InteriorPosi[int]) local houseIntPickup = createPickup(x, y, z, 3, 1318, 100)