-
Posts
139 -
Joined
-
Last visited
Everything posted by HustraDev
-
hi guys i made a car shop script and i have problem with it when the player spawn the vehicle he could't enter it code [ Client ] addEventHandler ("onClientGUIClick", root, function() if source == BtnShow then if not isElement(car) then local vehID = guiGridListGetItemText (PlayerVehicleList, guiGridListGetSelectedItem (PlayerVehicleList), 1) local vehName = guiGridListGetItemText (PlayerVehicleList, guiGridListGetSelectedItem (PlayerVehicleList), 2) local x,y,z = getElementPosition(getLocalPlayer()) car = createVehicle(vehID,x+3,y,z) warpPedIntoVehicle(localPlayer,car,0) outputChatBox ("لقد ثم إنزال سيارتك الـ" .. vehName .. "[ نظام المركبات ]", getLocalPlayer(), 40, 50, 120, false) elseif source == BtnHide then destroyElement(car) end end end )
-
thanks man i really really appreciate your help it works 100%
-
well i do this and it gave's me the same number of rows in database on gridlist but the rows are the same
-
can you explain to how to use for statement to get every rows that contains account name?
-
ِ-- any help?
-
Hi 2 all , i'm working on script i almost finish it but i have a problem that is i want to insert database row's in GUI gridlist well i want to poll all rows by account name like this >> Server Side function() local rows = dbQuery( connection, "SELECT * FROM `VList` WHERE `account`=?",getAccountName(getPlayerAccount(client))) local result = dbPoll( rows, -3 ) if result and type( result ) == 'table' then local sID = result[1][ 'id' ] local sName = result[2][ 'name' ] local sPrice = result[3][ 'price' ] triggerClientEvent(source,"SendRows",client,sID,sName,sPrice) end Client : function(sID,sName,sPrice) local row = guiGridListAddRow ( PlayerVehicleList ) guiGridListSetItemText ( PlayerVehicleList, row, 1, sID, false, false ) guiGridListSetItemText ( PlayerVehicleList, row, 2, sName, false, false ) guiGridListSetItemText ( PlayerVehicleList, row, 3, sPrice, false, false ) end but the problem is if the database contains more the 1 rows have the same account name it well insert only a 1 row in gui gridlist : [ database.db ] ---------------------------------------- account | id | name | price | koko00 | 12 | hustra | 2000 | koko00 | 14 | dev | 5000 | ---------------------------------------- Gui gridlist ----------------------- id | name | price 12 | dev | 2000 ----------------------- i hope anyone can help me ... sorry for bad english
-
what is normal drawing !?`
-
local vehicleHaveTintedWindow = getElementData(vehicle, "tuning.tintedWindow") or 0 then if vehicleHaveTintedWindow then outputChatBox("perfect") end i do this and there is nothing in chatbox Try this: local windowData = getElementData(vehicle, "tuning.tintedWindow") if windowData then outputChatBox("The data exists") else outputChatBox("Unable to get the data") end ChatBox : The Data Exists
-
local vehicleHaveTintedWindow = getElementData(vehicle, "tuning.tintedWindow") or 0 then if vehicleHaveTintedWindow then outputChatBox("perfect") end i do this and there is nothing in chatbox
-
i do outputing and there's nothing wrong with it if setElementData(vehicle,"tuning.tintedWindow",1) then outputChatBox("Perfect") end Chat : Perfect
-
يب الكود مو لي بس اعطاه لي عضو في المنتدى حطيت موضوع في scripting ورد علي واعطاني الكود بس لما جربته ماشتغل
-
/ Client \ local tintShaders = {} local elementShaders = {} local availableTintedWindows = { [405] = "@hite", } addEventHandler("onClientResourceStart", resourceRoot, function() for _, vehicle in ipairs(getElementsByType("vehicle", root, true)) do local vehicleHaveTintedWindow = getElementData(vehicle, "tuning.tintedWindow") or 0 if vehicleHaveTintedWindow ~= 0 then setVehicleWindowType(vehicle) end end end) addEventHandler("onClientElementStreamIn", root, function() if getElementType(source) == "vehicle" then local vehicleHaveTintedWindow = getElementData(source, "tuning.tintedWindow") or 0 if vehicleHaveTintedWindow ~= 0 then setVehicleWindowType(source) end end end) addEventHandler("onClientElementDestroy", root, function() if getElementType(source) == "vehicle" then destroyTintedWindowShader(source) end end) addEventHandler("onClientElementStreamOut", root, function() if getElementType(source) == "vehicle" then destroyTintedWindowShader(source) end end) addEvent("tuning->TintedWindow", true) function setVehicleWindowType(vehicle, adding) local vehicleModel = getElementModel(vehicle) local windowTexture = availableTintedWindows[vehicleModel] if adding == 0 then destroyTintedWindowShader(vehicle) else if windowTexture then applyTintedWindowShader(windowTexture, 100, vehicle) else destroyTintedWindowShader(vehicle) end end end addEventHandler("tuning->TintedWindow", root, setVehicleWindowType) function destroyTintedWindowShader(element) if elementShaders[element] then destroyElement(elementShaders[element][1][1]) elementShaders[element] = nil end end function applyTintedWindowShader(texture, distance, element) if element then destroyTintedWindowShader(element) end local this = #tintShaders + 1 tintShaders[this] = {} tintShaders[this][1] = dxCreateShader("files/textures/tintedWindow.fx", 0, distance, true) if not tintShaders[this][1] then tintShaders[this] = nil return end if element then if not elementShaders[element] then elementShaders[element] = {tintShaders[this], texture} end end if tintShaders[this][1] and tintShaders[this][2] then engineApplyShaderToWorldTexture(tintShaders[this][1], texture, element) end end Shader technique tintedWindow { pass P0 { DepthBias = -0.0000; AlphaBlendEnable = TRUE; SrcBlend = SRCALPHA; DestBlend = INVSRCALPHA; } } technique fallback { pass P0 { } } جربته وماشتغل ياريت تحدد الخطأ للعلم ابي لون القزاز يتغير للاسود هل المشكلة في ال shader?
-
> could any body explain to what this code does engineApplyShaderToWorldTexture(tintShaders[this][1], texture, element)
-
السلام عليكم شباب محتاج طريقة اغير بيها لون القزاز حق الموتر وشكراً
-
-
i Have been all night trying to fix it but i failed i'm serously need Help
-
-
Thanks for reply man but there is nothing in debug and i have a question this scripts need a Texture ? like a image file with the window color or not?
-
This Script Drives me crazy
-
i have tested but it doesn't work could any body help me ?!
-
I have problem with this script it should change Vehicle Window Color .. But it Doesn't ~ Shader Fx :- technique tintedWindow { pass P0 { DepthBias = -0.0000; AlphaBlendEnable = TRUE; SrcBlend = SRCALPHA; DestBlend = INVSRCALPHA; } } technique fallback { pass P0 { } } Script client :- local tintShaders = {} local elementShaders = {vehicle} local availableTintedWindows = { [405] = "@hite", [543] = "@hite" } addEventHandler("onClientResourceStart", resourceRoot, function() for _, vehicle in ipairs(getElementsByType("vehicle", root, true)) do local vehicleHaveTintedWindow = getElementData(vehicle, "tuning.tintedWindow") or 0 if vehicleHaveTintedWindow ~= 0 then setVehicleWindowType(vehicle) end end end) addEventHandler("onClientElementStreamIn", root, function() if getElementType(source) == "vehicle" then local vehicleHaveTintedWindow = getElementData(source, "tuning.tintedWindow") or 0 if vehicleHaveTintedWindow ~= 0 then setVehicleWindowType(source) end end end) addEventHandler("onClientElementDestroy", root, function() if getElementType(source) == "vehicle" then destroyTintedWindowShader(source) end end) addEventHandler("onClientElementStreamOut", root, function() if getElementType(source) == "vehicle" then destroyTintedWindowShader(source) end end) addEvent("tuning->TintedWindow", true) function setVehicleWindowType(vehicle, adding) local vehicleModel = getElementModel(vehicle) local windowTexture = availableTintedWindows[vehicleModel] if adding == 0 then destroyTintedWindowShader(vehicle) else if windowTexture then applyTintedWindowShader(windowTexture, 100, vehicle) else destroyTintedWindowShader(vehicle) end end end addEventHandler("tuning->TintedWindow", root, setVehicleWindowType) function destroyTintedWindowShader(element) if elementShaders[element] then destroyElement(elementShaders[element][1][1]) elementShaders[element] = nil end end function applyTintedWindowShader(texture, distance, element) if element then destroyTintedWindowShader(element) end local this = #tintShaders + 1 tintShaders[this] = {} tintShaders[this][1] = dxCreateShader("files/textures/tintedWindow.fx", 0, 0, true) if not tintShaders[this][1] then tintShaders[this] = nil return end if element then if not elementShaders[element] then elementShaders[element] = {tintShaders[this], texture} end end if tintShaders[this][1] and tintShaders[this][2] then engineApplyShaderToWorldTexture(tintShaders[this][1], texture, element) end end
-
anybody can explain how to do it with shaders ??
-
can you explain more and what i use from shaders ?
-
Hi i'm looking for Making a new scripts that change cars window color could any body help me with functions or any way i can use to make it change ? Thanks