-
Posts
1,165 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ALw7sH
-
you had to read what i wrote on the code x = x2 - x1 = (-1516.7998046875 - -1514.5) = -2.2998046875 y = y2 - y1 = (242 - 242) = 0 z = z2 - z1 = (17 - 6.90) = 10.1
-
local object1 = createObject(9585, -1514.5, 242, 6.90, 0, 0, 0) local object2 = createObject(9586, -1516.7998046875, 242, 17, 0, 0, 0) attachElements(object2,object1,-2.2998046875,0,10.1) -- attach object2 to object1 function isAclGroup(p,group) if p and getElementType(p) == "player" and type(group) == "string" then local Deadusergroup = getAccountName(getPlayerAccount(p)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup(group)) then return true else return false end else return false end end function moveGate(playerSource, cmd) if cmd == "gostart" then if isAclGroup(playerSource,"Maritime") then moveObject(object1, 5000, -1377.90, 193.69, 6.90, 0, 0, 45) -- move object1 and object2 gonna move with him end end end addCommandHandler("gostart", moveGate)
-
debugscript وش الاخطاء الي في
-
it wont move Have you added the command handler? and are you sure that you are in "Maritime" ACL group?
-
The best way is to read scripts and try to do scripts (and also you'll need to read tutorials sometimes) dont waste your time for just reading about scripting
-
I cant help you before i know what's the problem so work on the code little bit try to find why onClientElementStreamIn is not working for example output the element data because maybe the problem is from the element data addEventHandler('onClientElementStreamIn', root, function () if getElementType(source) == 'player' then local clothes = getElementData(source, 'clothes') outputDebugString("Clothes data is: "..type(clothes).." - and it's: "..tostring(clothes)) if type(clothes) == 'table' and table.getn(clothes) > 0 then outputDebugString("Adding cloth to "..getPlayerName(source)) for k, v in pairs(clothes) do dxSetShaderValue(Shader[v[2].index], 'gTexture', v[2].model) engineApplyShaderToWorldTexture(Shader[v[2].index], v[1], source) outputDebugString(v[1].." Has been added to"..getPlayerName(source)) end end end end )
-
local object1 = createObject(9585, -1514.5, 242, 6.90, 0, 0, 0) local object2 = createObject(9586, -1516.7998046875, 242, 17, 0, 0, 0) attachElements(object2,object1,-2.2998046875,0,10.1) -- attach object2 to object1 --[[ x = x2 - x1 = (-1516.7998046875 - -1514.5) = -2.2998046875 y = y2 - y1 = (242 - 242) = 0 z = z2 - z1 = (17 - 6.90) = 10.1 ]]-- function isAclGroup(p,group) if p and getElementType(p) == "player" and type(group) == "string" then local Deadusergroup = getAccountName(getPlayerAccount(p)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup(group)) then return true else return false end else return false end end function moveGate(playerSource, cmd) if cmd == "startcruise" then if isAclGroup(playerSource,"Maritime") then moveObject(object1, 5000, -1377.90, 193.69, 6.90, 0, 0, 45) -- move object1 and object2 gonna move with him end end end
-
if you trigger with resourceRoot so the event handler should be resourceRoot too addEvent("wypuszczony", true) addEvent("zamkneles", true) addEvent("zostaleszamkniety", true) addEvent("zlygracz", true) addEvent("puchatimer", true) function info1() exports["notifications"]:showBox("info","Zostałeś zamknięty na okres 10 minut. Po wyjściu z serwera i po ponownym wejściu kara znowu zostanie zresetowana na 10 minut, bez względu na to ile odziedziałeś wcześniej.") end addEventHandler("zostaleszamkniety", getRootElement(), info1) function info2() exports["notifications"]:showBox("info","Zostałeś wypuszczony. Postaj się nie trafić tutaj ponownie.") end addEventHandler("wypuszczony", getRootElement(), info2) function info3() exports["notifications"]:showBox("info","Zamknęłeś wybranego gracza w areszcie.") end addEventHandler("zamkneles", getRootElement(), info3) function info4() exports["notifications"]:showBox("error","Niepoprawna nazwa użytkownika.") end addEventHandler("zlygracz", getRootElement(), info4) function puchatimers(who) setTimer(function(who) triggerServerEvent("accountdata", resourceRoot) end, 5000, 1,who) end addEventHandler("puchatimer", resourceRoot, puchatimers) addEvent("accountdata", true) function zapuszkuj(player, cmd, who) who = getPlayerFromName(who) if (who) then playeraccount = getPlayerAccount ( who ) setAccountData(playeraccount, "areszt", 1) setElementPosition(who, -1948.09949, 274.29776, 35.47393) triggerClientEvent(who, "puchatimer", resourceRoot,who) triggerClientEvent(player, "zamkneles", resourceRoot) triggerClientEvent(who, "zostaleszamkniety", resourceRoot) else triggerClientEvent(player, "zlygracz", resourceRoot) end end addCommandHandler("aresztuj", zapuszkuj) function antitrick() end function ustawdate(who) playeraccount = getPlayerAccount ( who ) setAccountData(playeraccount, "areszt", 0) setElementPostion(who, -1951.99268, 276.64502, 35.46875) end addEventHandler("accountdata", resourceRoot, ustawdate)
-
use attachElements
-
Idont know if this is exactly what you want function giveAmmo ( theVehicle, seat ) if (getElementModel(theVehicle) == 433) then local weapon = getPedWeapon (source) if weapon then giveWeapon ( source, weapon, 200 ) end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), giveAmmo )
-
Because there's no erros use outputDebugString to see what's doesn't works ---Shaders local Shader = {} Shader[1] = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped')---Shirt Shader[2] = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped')---Leg --Table Clothes = { ['cj_ped_torso'] = { ['tshirtwhite'] = { index = 1, model = nil }, ['tshirtgrey'] = { index = 1, model = nil }, ['tshirtbeige'] = { index = 1, model = nil } }, ['cj_ped_legs'] = { ['legsblack'] = { index = 2, model = nil }, ['legsdblue1'] = { index = 2, model = nil }, ['legsblue'] = { index = 2, model = nil } } } --Loop for model, clothe in pairs(cClothes['cj_ped_torso']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end for model, clothe in pairs(cClothes['cj_ped_legs']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] local clothes = getElementData(player, 'clothes') if type(clothes) == 'table' and table.getn(clothes) > 0 then table.insert(clothes, {clothesModel, clothe}) setElementData(player, 'clothes', clothes) outputDebugString("Cloth element data has been added to"..getPlayerName(player)) else local cTable = {} table.insert(cTable, {clothesModel, clothe}) setElementData(player, 'clothes', cTable) outputDebugString("Cloth element data has been added to"..getPlayerName(player)) end --[[if (Shader[clothe.index]) then resetClothes(player, clothesModel, clothe.index) dxSetShaderValue(Shader[clothe.index], 'gTexture', clothe.model) engineApplyShaderToWorldTexture(Shader[clothe.index], clothesModel, player) end]] end addEventHandler('addClothes', root, addClothes) addEventHandler('onClientElementStreamIn', root, function () if getElementType(source) == 'player' then local clothes = getElementData(source, 'clothes') if type(clothes) == 'table' and table.getn(clothes) > 0 then outputDebugString("Adding cloth to "..getPlayerName(source)) for k, v in pairs(clothes) do dxSetShaderValue(Shader[v[2].index], 'gTexture', v[2].model) engineApplyShaderToWorldTexture(Shader[v[2].index], v[1], source) outputDebugString(v[1].." Has been added to"..getPlayerName(source)) end end end end )
-
Don't Work What's doesn't works explain more so we can help you
-
You have to edit the collision file of the object
-
local Shader = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped') --- Create shader for player ---Clothes Table local cClothes = { ['cj_ped_torso'] = { ['tshirtwhite'] = { model = nil }, ['tshirtred'] = { model = nil }, ['tshirtblack'] = { model = nil } } } ---Create texture for player for model, clothe in pairs(cClothes['cj_ped_torso']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end ---Appy Texture for player addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] local clothes = getElementData(player,"clothes") if type(clothes) == "table" and table.getn(clothes) > 0 then table.insert(clothes,{clothesModel,clothe}) setElementData(player,"clothes",clothes) else local cTable = {} table.insert(cTable,{clothesModel,clothe}) setElementData(player,"clothes",cTable) end end addEventHandler('addClothes', root, addClothes) addEventHandler("onClientElementStreamIn",root, function() if getElementType(source) == "player" then if (Shader) then local clothes = getElementData(source,"clothes") if type(clothes) == "table" and table.getn(clothes) > 0 then for k,v in pairs(clothes) do dxSetShaderValue(Shader, 'gTexture', v[2].model) engineApplyShaderToWorldTexture(Shader, v[1], source) end end end end end )
-
if currentSize > maximumSize then currentSize = maximumSize end something like that above your dxDrawImageSection function
-
If you dont have to pay mysql you can just use sqlite
-
You can do that with zmodeler it will be more easier to do it with lua code
-
local mMarkers = {} local lastMarker local Markers = { {1213.9326171875, -1340.8984375, 13.571063995361}, {1214.1376953125, -1309.7197265625, 13.557456016541}, {1214.1376953125, -1309.7197265625, 13.557456016541} -- The last marker } function createMarkers() mMarkers = {} lastMarker = nil for i=1,#Markers do local x,y,z = unpack(Markers[i]) local marker = createMarker(x,y,z,"cylinder",2,255,0,0,150) if i == #Markers then lastMarker = marker end mMarkers[marker] = true end end addEventHandler("onClientResourceStart",resourceRoot,createMarkers) addEventHandler("onClientMarkerHit",root, function(element) if mMarkers[source] then if source == lastMarker then outputChatBox("This is the last marker",element) destroyElement(source) createMarkers() else destroyElement(source) end end end )
-
the event is "onPlayerVehicleEnter" not "onPlayerVehiclenter" and source of this event is the player function giveAmmo ( theVehicle, seat ) if (getElementModel(theVehicle) == 433) then giveWeapon ( source, 31, 200 ) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), giveAmmo ) --- Do you even know what you're going to do? Your code will give a weapon to a vehicle which makes no sense... you are worng because the source of this event is the player not the vehicle the just one thing was worng the name of the event
-
Just a simple progress that you can start from local sX,sY = guiGetScreenSize() local progX = 200 local progY = 25 local moveSpeed = 3 -- per frame local prog = 0 function render() if prog >= progX then removeEventHandler("onClientRender",root,render) triggerEvent("onClientProgressFinish",localPlayer) end dxDrawRectangle((sX/2)-(progX/2)-1,(sY/2)-(progY/2)-1,progX+2,progY+2,tocolor(255,255,255,170)) -- background prog = math.min(prog+moveSpeed,progX) -- move the progress dxDrawRectangle((sX/2)-(progX/2),(sY/2)-(progY/2),prog,progY,tocolor(50,50,50,255)) -- progress end addEventHandler("onClientRender",root,render)
-
ofcourse "myFunction(arg)"
-
فكرته حلوه وماهي مستحيله اولاً التحميل مابيزيد وثانياً مابيصير لاق بعطيك مثال attachment المنتديات أي صوره ترفعها في الـ او صورة الافتار حقتك تتحمل داخل الخادم الي عليه المنتدى والمنتديات اغلبها تلقا عدد الاعضاء فيها اكثر بكثير من عدد لاعبين بسيرفر واحد في ام تي اي لاحد يحطم احد لو في نظرك الفكرة مستحيله يمكن فيه مبرمج غيرك يقدر يطبقها
-
https://wiki.multitheftauto.com/wiki/SetVehicleHandling suspensionLowerLimit
-
something like that? function getResourcesInPath(path) local Resources = {} for k,resource in ipairs(getResources()) do local resourceName = getResourceName(resource) if fileExists(":"..path.."/"..resourceName.."/meta.xml") then table.insert(Resources,resource) end end return Resources end getResourcesInPath("MyResources/Maps") edit: If you mean the ftp path, idont think this is possible with only lua codes