
WiBox
Members-
Posts
234 -
Joined
-
Last visited
Everything posted by WiBox
-
Hey, can you explain? You want to make, a panel with songs he can buy using a button? When he buy a song, he can activate it so all on the server it but won't be a mess? Example if 2 activated a song, it will be like hearing 2 songs at the same second. So I prefer you rethink of what you want.
-
Ihnify can you try to explain what you really want? I didn't understand what you want to do, If you speak Russian, use Google Translate it will help much better
-
Thanks you mate, working but about that verification code: " and isElement( element ) and available_types[ getElementType( element ) ] ) then " I had to remove it so it work, it's something in available_types, but nvm I've fix that error in it, thanks.
-
Hey, I need to know how I can make an Ped shoot at the same spot as I do, addEventHandler( "onClientPlayerWeaponFire", root function ( hitElement, hitX, hitY, hitZ ) --set ped shoot as the same hitElement, example: setPedShootOn( thePed, hitElement ) end ) I appreciate who'll help... Thanks. Plus I need that Ped to follow me where ever I go, is that possible?
-
Nevermind... fixed~
-
function openGrid(plr) local tName = getElementData( plr, "t") local account = dbQuery(con, "SELECT * FROM tSys WHERE tName = ?", tName) local account2 = dbPoll(account, -1) local accountz = dbQuery(con, "SELECT * FROM tSys2 WHERE tName = ?", tName) local accountz2 = dbPoll(account, -1) data1 = {} data2 = {} for ind, col in ipairs(account2) do data1[#data1+1] = {} data1[#data1+1] = col.account end for ind, col in ipairs(accountz2) do data2[#data2+1] = {} data2[#data2+1] = col.T end if ( canPlayerDoActionInGroup( client, "editT") ) then triggerClientEvent( plr, "openGridList", plr, data1, data2) else return end end addEvent("viewGridList", true) addEventHandler("viewGridList", root, openGrid) I've made it a bit better.. I don't know if I did the "dbQuery right", but the part which I want to fix is taking the account2 and accountz2 from those 2 dbQuery, and add them in a grid list which is: function displayActions2(table) guiGridListClear(t) for k, v in ipairs(table) do local row = guiGridListAddRow(t) guiGridListSetItemText(t, row, 1, v[k].account, false, false) end end function displayActions3(table) guiGridListClear(TT) for k, v in ipairs(table) do local row = guiGridListAddRow(TT) guiGridListSetItemText(TT, row, 1, v[k].T, false, false) end end function window( table, table2 ) guiSetVisible( window, true) guiBringToFront( window ) displayActions2( table ) displayActions3( table2 ) end addEvent("openGridList", true) addEventHandler("openGridList", root, window) The error which I'm getting at /debugscript 3 is: ERROR: Tsys.lua:1422: attempt to index field '?' (a nil value) and the line 1422 is: guiGridListSetItemText(t, row, 1, v[k].account, false, false) Which is at the function displayActions2, the thing is I'm not sure if the v[k].account is wrong or the account2 and accountz2 name not working at the function openGrid()... Sorry for my bad skills, I tried to explain as good as possible... I've replace "v[k].account" and "v[k].T" with math.random, and it worked, so all what I know it's either from "v[k].account" or "v[k].T" either from the table "data1" and "data2" either from "dbQuery" ...
-
If the message isn't appearing when you send it to someone else, it means either table.insert does't work either when you set the message using dxDrawText with the table isn't working...
-
Fix the table.insert ... As it seems, your'e saving the message in a table.insert so you've to fix when you take the message from the table.. ain't you getting warning or errors at /debugscript 3 ?
-
About that 'remap' texture, I've found a ".dff" & " .txd" Infernus files, which has at the" .dff" a texture "basemap", when I enable it using a script, the car shader worked successfully, but I don't know how to create a ".dff" file...
-
function openGrid(plr) local tName = getElementData( plr, "t") local Test3 = getTlist1(tName, false) local Test4 = getTlist2(tName, false) data1 = {} data2 = {} for ind, col in ipairs(Test3) do data1[#data1+1] = {} data1[#data1+1] = col.account end for ind, col in ipairs(Test4) do data2[#data2+1] = {} data2[#data2+1] = col.T end if ( canPlayerDoActionInGroup( client, "editT") ) then triggerClientEvent( plr, "openGridList", plr, data1, data2) else return end end addEvent("viewGridList", true) addEventHandler("viewGridList", root, openGrid) Hello, now in some different ways, I could check if the data of (dbExec) get saved, it does... but the thing is I'm trying to add the data stored inside the (dbExec) in a GridList... Does anyone know how? That is server side, and this is the Client Side: function displayActions2(table) guiGridListClear(t) for k, v in ipairs(table) do local row = guiGridListAddRow(t) guiGridListSetItemText(t, row, 1, v[k].account, false, false) end end function displayActions3(table) guiGridListClear(TT) for k, v in ipairs(table) do local row = guiGridListAddRow(TT) guiGridListSetItemText(TT, row, 1, v[k].T, false, false) end end function window( table, table2 ) guiSetVisible( window, true) guiBringToFront( window ) displayActions2( table ) displayActions3( table2 ) end addEvent("openGridList", true) addEventHandler("openGridList", root, window) to be honest I tried to remove v[k].T and add "test" so it wrote 3 times "test" and I already tried to add 3 different account names.. so I'm just having problem by getting the name and add it in this v[k].T and v[k].account
-
about engineApplyShaderToWorldTexture what is the texture of a car? Is I use the "vehiclegrunge256" the texture isn't placed right at the car, does someone know it?(For all vehicles.. plane...)
-
I've been working on it since 6 hours.. Anyway, I added a table to store in it the multi "shaderElement" as data[#data+1] = shaderElement .... I took the idea from a old script I made... Thanks a lot.
-
When I enable the skin, it work 100% but when I try to disable it, it doesn't work, the "ShaderElement", "textureName", "element" data at "engineApplyShaderToWorldTexture" has the same data of "engineRemoveShaderFromWorldTexture" Here's the code: function applyShader ( element, table, _type) for index, value in pairs ( table ) do if ( index == 1 ) then model = value elseif ( index == 2 ) then textureName = value elseif ( index == 3 ) then texturePath = value end end local shaderElement = dxCreateShader ( "shader/shader.fx", 0, 0, false, _type == "skin" and "ped" or "vehicle" or "object" ) local textureElement = dxCreateTexture ( _type.."/textures/"..texturePath ) if ( shaderElement and textureElement ) then dxSetShaderValue ( shaderElement, "Tex0", textureElement ) engineApplyShaderToWorldTexture ( shaderElement, textureName, element ) end end addEvent("shaders.applyShader", true) addEventHandler("shaders.applyShader", root, applyShader) function removeShader ( element, table, _type) for index, value in pairs ( table ) do if ( index == 1 ) then model = value elseif ( index == 2 ) then textureName = value elseif ( index == 3 ) then texturePath = value end end local shaderElement = dxCreateShader ( "shader/shader.fx", 0, 0, false, _type == "skin" and "ped" or "vehicle" ) local textureElement = dxCreateTexture ( _type.."/textures/"..texturePath ) if ( shaderElement and textureElement ) then dxSetShaderValue ( shaderElement, "Tex0", textureElement ) engineRemoveShaderFromWorldTexture ( shaderElement, textureName, element ) end end addEvent("shaders.removeShader", true) addEventHandler("shaders.removeShader", root, removeShader)
-
Worked Thanks ?
-
I'm trying to trigger a event in it I want to trigger a table to the client side.. skinsShaders = { { skinTo = "RIP", texture = "jpg2/278", worldname = "Sbmotr2", skinID = 134 }, { skinTo = "RIP", texture = "jpg2/298", worldname = "swmotr5", skinID = 230 }, } function sendDatas() triggerClientEvent("applyTheShaderOnSkin", resourceRoot, skinsShaders) end setTimer(sendData, 5000, 1) The thing is, at the Client side I want to get the "skinTo", "texture", "worldname" and "skinID"... Server Side: -- Example, ofc not working... addEvent("applyTheShaderOnSkin", true) function applyTheShaderOnSkin ( table) for index, value in pairs ( table ) do if ( index == 1 ) then element = value.skinTo elseif ( index == 2 ) then textureName = value.worldname elseif ( index == 3 ) then texturePath = value.texture end --......... end end addEventHandler("applyTheShaderOnSkin", root, applyTheShaderOnSkin) I need it like in this form.... is there anyway I can make that? If it's not possible, I'll appreciate if he say it.
-
I need to check if a player is writing writing in a specific edit I tried to use "onClientGUOChanged" but it isn't what I need, I need to check if the player was writing in a edit and stopped writing and add the value with setElementData
-
Nevermind, worked I just needed to use return getAccountData..
-
It's nothing I just used those two: dxCreateTexture dxDrawImage Because I didn't understand what those three do: dxCreateRenderTarget dxSetRenderTarget dxGetMaterialSize But I'm having some difficulties so I add blips on the map and the minimap..
-
groups = { { name = "ABC", texture= "skins/ABC.jpg", shader= "groupskinshader.fx", num = "ABC", worldname = "cwmohb2" }, { name = "ABC", texture= "skins/ABC1.jpg", shader= "groupskinshader.fx", num = "ABC", worldname = "swmotr5" }, } addEventHandler( "onClientResourceStart", resourceRoot, function() for i,val in ipairs(groups) do perfectname = val.name..""..val.num textures[perfectname] = dxCreateTexture ( val.texture ) shaders[perfectname] = dxCreateShader( val.shader, 999999, 0, false, "ped" ) names[perfectname] = val.worldname dxSetShaderValue ( shaders[perfectname], "Tex0", textures[perfectname] ) if not shaders[perfectname] then outputDebugString( "Could not create shader. Please use debugscript 3" ) destroyElement( textures[perfectname] ) return elseif not textures[perfectname] then outputDebugString( "loading texture failed" ) destroyElement ( shaders[perfectname] ) tec = nil return end end end) function groupskinapply(cmd,val2,num) local grp = getElementData(localPlayer,"g") local perfectname = grp..""..num if grp and grp ~= "" and shaders[perfectname] then if val2 == "off" then if ( applied[perfectname] == nil ) then return end triggerServerEvent("SunApplyToAllServer", root, perfectname, theplayer) applied[perfectname] = nil return end if ( val2 == "on" ) then if ( applied[perfectname] == true ) then return end theplayer = localPlayer val = groups[1] applied[perfectname] = true triggerServerEvent("SonApplyToAllServer", root, perfectname, theplayer) end end end addCommandHandler("customskin", groupskinapply) That's the part of my script which I need to edit, I could make example, "/customskin on ABC" but it worked for only one skin, I can make it as change the 3 variable, "/customskin on ABC1" but the thing is I need to apply all the skin using the command once.. Does anyone have a idea?
-
addEventHandler("onClientGUIChanged", resourceRoot, function() local text = guiGetText(search) local data1Items = { } local data2Items = { } local data3Items = { } local data4Items = { } local data5Items = { } local data6Items = { } if source == search then for i, v in pairs(vehInfo) do if not (text == "" ) then if (string.find(string.upper(v[3]), string.upper(text), 1, true)) then table.insert(data1Items, v[1]) table.insert(data2Items, v[2]) table.insert(data3Items, v[3]) table.insert(data4Items, v[4]) table.insert(data5Items, v[5]) table.insert(data6Items, v[6]) end end end if ( text == "" ) then guiGridListClear(grid) for index, vehs in ipairs(vehInfo) do local row = guiGridListAddRow(grid) if (getSetting(vehs[1])) then guiGridListSetItemText(grid, row, name, getSetting(vehs[1]), false, false) end if (getSetting(vehs[2])) then guiGridListSetItemText(grid, row, ID, getSetting(vehs[2]), false, false) end if (getSetting(vehs[3])) then guiGridListSetItemText(grid, row, replaces, getSetting(vehs[3]), false, false) end if (getSetting(vehs[4])) then guiGridListSetItemText(grid, row, Size, getSetting(vehs[4]), false, false) end if (getSetting(vehs[5])) then guiGridListSetItemText(grid, row, Downloaded, getSetting(vehs[5]), false, false) end if (getSetting(vehs[6])) then guiGridListSetItemText(grid, row, Enabled, getSetting(vehs[6]), false, false) end end else -- Here is my problem: guiGridListClear(grid) row = guiGridListAddRow(grid) for i, v in pairs(data1Items) do guiGridListSetItemText(grid, row, 1, v, false, false) end for i, v in pairs(data2Items) do guiGridListSetItemText(grid, row, 6, v, false, false) end for i, v in pairs(data3Items) do guiGridListSetItemText(grid, row, 2, v, false, false) end for i, v in pairs(data4Items) do guiGridListSetItemText(grid, row, 3, v, false, false) end for i, v in pairs(data5Items) do guiGridListSetItemText(grid, row, 4, v, false, false) end for i, v in pairs(data6Items) do guiGridListSetItemText(grid, row, 5, v, false, false) end end end end ) I know where's my mistake, but I don't know how to fix, I tried but I don't have the idea how to fix it, in those tables( data1Items, data2Items, data3Items...) I need each one on a line, but the thing is when I search for the vehicle name, it search only at the first row ( Row ID 0 ) so I tried to use for i, v in pairs(data1Items) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, v, false, false) end Worked because each data is getting on a line because I add the local row = guiGridListAddRow(grid) in the for i, v in pairs() do end but I need to make for multi tables( data1Items, data2Items, data3Items...), I didn't know who to do it.. Any ideas?
-
Mate, I'm scripting for a whole server, regardless I don't know all the functions and where they can be useful in some cases, I used as @Dimos7 said dxCreateTexture dxDrawImage dxCreateRenderTarget dxSetRenderTarget dxGetMaterialSize And yes, I'm making it for all players, not for myself so replacing it in my local data? Of course no.
-
Well, yes. I need to check how much MB's did the player downloaded until now ( But specific files... ) but I don't know anything about table.sort and how to use it
-
Rust system building, well done. It's hard to make such thing
-
I want to change the map at F11, I got the files but I just don't know what functions to use so I can add it.. Does anyone have a idea?