-
Posts
862 -
Joined
-
Last visited
Everything posted by iMr.3a[Z]eF
-
function design ( ) playSound ("http://www.181.fm/winamp.pls?station=181-power&style=&description=Power%20181%20(Top%2040)&file=181-power.pls") showCursor ( true ) -- Panels -- panels = { ["bg"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true), ["acc"] = guiCreateStaticImage(0.29, 0.24, 0.14, 0.22, "img/acc.png", true), ["boxid"] = guiCreateStaticImage(0.43, 0.30, 0.23, 0.06, "img/box.png", true), ["boxpass"] = guiCreateStaticImage(0.43, 0.36, 0.23, 0.06, "img/box.png", true), } -- Panels -- -- guiSetEnabled -- guiSetEnabled ( panels["bg"], false ) guiSetEnabled ( panels["acc"], false ) guiSetEnabled ( panels["boxid"], false ) guiSetEnabled ( panels["boxpass"], false ) -- guiSetEnabled -- -- Labels -- name = guiCreateLabel(0.45, 0.24, 0.21, 0.03,getPlayerName( localPlayer ):gsub("#%x%x%x%x%x%x", "") .."", true, bg) state = guiCreateLabel(0.45, 0.27, 0.23, 0.03, "Unlogged", true, bg) -- Labels -- -- Settings -- font = guiCreateFont( "lithos.ttf", 13 ) font2 = guiCreateFont( "lithos.ttf", 18 ) guiSetFont( name, font2 ) guiSetFont( state, font ) -- Settings -- -- Buttons -- buttons = { ["btn"] = guiCreateStaticImage(0.628, 0.37, 0.02, 0.032, "img/log.png", true, bg ) } -- Buttons -- -- Alpha -- guiSetAlpha ( buttons["btn"], 0.75 ) -- Alpha -- end -- Handlers -- addEventHandler( "onClientMouseEnter", root, function( ) for key,gui in pairs (buttons) do if gui == localPlayer then guiSetAlpha ( localPlayer, 1.0 ) end end end ) -- Handlers -- addEventHandler( "onClientResourceStart", getRootElement( ), design )
-
Is that my code? That code for @dazzlepoint.
-
[HELP] It's possible transform object in weapon?
iMr.3a[Z]eF replied to ZueiraPlays's topic in Scripting
Yes you can by attachObject. -
local safecol = createColCuboid ( -4114.1, -2998.8, 379.5, 70, 70, 70 ) local safeZone = createMarker ( 2244.20752, 498.09100, 11.70, "cylinder", 150, 0, 255, 0, 0 ) function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) local mainBackground = guiCreateStaticImage(x2, y2, width2, height2, "Nexus.png", relative2) local mainBackgroundLabel = guiCreateLabel(0, 0, 0, 0, titleBarText2, false, mainBackground2) guiSetEnabled(mainBackgroundLabel, false) return mainBackground end CONTROL_MARGIN_RIGHT = 25 LINE_MARGIN = 1 LINE_HEIGHT = 1 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() function skinInit() setControlNumber(wndSkin, "skinid", getElementModel(g_Me)) end function showSkinID(leaf) if leaf.id then setControlNumber(wndSkin, "skinid", leaf.id) end end function applySkin() local skinID = getControlNumber(wndSkin, "skinid") if skinID then server.setMySkin(skinID) fadeCamera(true) end end wndSkin = {"wnd"; text = "Skins", width = 250, x = -20, y = 0.3, controls = { {"lst"; id = "قائمة الشخصيات", width = 230, height = 290, columns = { {text = "إختيار الشخصيه", attr = "name"}}, rows = {xml = "skins.xml", attrs = {"id", "name"}}, onitemclick = showSkinID, onitemdoubleclick = applySkin}, {"txt"; id = "skinid", text = "", width = 50}, {"btn"; id = "موافق", onclick = applySkin}, {"btn"; id = "إغلاق", closeswindow = true}}, oncreate = skinInit} function setSkinCommand(cmd, skin) if tonumber(skin) then server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) end end addCommandHandler("setskin", setSkinCommand) addCommandHandler("ss", setSkinCommand) function applyAnimation(leaf) if type(leaf) ~= "table" then leaf = getSelectedGridListLeaf(wndAnim, "Animations") end if not leaf then return end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = {"wnd"; text = "Animations", width = 250, x = -20, y = 0.3, controls = { {"lst"; id = "قائمة الحركات", width = 230, height = 290, columns = { {text = "الحركات", attr = "name"}}, rows = {xml = "animations.xml", attrs = {"name"}}, expandlastlevel = false, onitemdoubleclick = applyAnimation}, {"btn"; id = "موافق", onclick = applyAnimation}, {"btn"; id = "إيقاف", onclick = stopAnimation}, {"btn"; id = "إغلاق", closeswindow = true}}} addCommandHandler("anim", function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) function addWeapon(leaf, amount) if type(leaf) ~= "table" then leaf = getSelectedGridListLeaf(wndWeapon, "weaplist") amount = getControlNumber(wndWeapon, "amount") if amount then end if amount then end return end server.giveMeWeapon(leaf.id, amount) end wndWeapon = { 'wnd', text = 'Tools', width = 250, controls = { { 'lst', id='weaplist', width=230, height=280, columns={ {text='Tools', attr='name'} }, rows={xml='weapons.xml', attrs={'id', 'name'}}, onitemdoubleclick=function(leaf) addWeapon(leaf, 500) end }, {'br'}, {'txt', id='amount', text='500', width=60}, {'btn', id='Add', onclick=addWeapon}, {'btn', id='Close', closeswindow=true} } } addCommandHandler("setstyle", function(cmd, style) if style then style = tonumber(style) end if style then server.setPedFightingStyle(g_Me, style) end end ) function clothesInit() if getElementModel(g_Me) ~= 0 then errMsg("يجب أن تستخدم شخصية سي جي لكي تدخل إلى هذه القائمة") closeWindow(wndClothes) return end if not g_Clothes then triggerServerEvent("onClothesInit", g_Me) end end addEvent("onClientClothesInit", true) addEventHandler("onClientClothesInit", g_Root, function(clothes) g_Clothes = clothes.allClothes for i,typeGroup in ipairs(g_Clothes) do for j,cloth in ipairs(typeGroup.children) do if not cloth.name then cloth.name = cloth.model .. " - " .. cloth.texture end cloth.wearing = ((not clothes.playerClothes[typeGroup.type] or clothes.playerClothes[typeGroup.type].texture ~= cloth.texture or clothes.playerClothes[typeGroup.type].model ~= cloth.model) and false) end table.sort(typeGroup.children, function(a, b) return a.name < b.name end) end bindGridListToTable(wndClothes, "clothes", g_Clothes, false) end ) function clothListClick(cloth) setControlText(wndClothes, "addremove", cloth.wearing and "remove" or "add") end function applyClothes(cloth) if not cloth then cloth = getSelectedGridListLeaf(wndClothes, "clothes") end if not cloth then return end if cloth.wearing then cloth.wearing = false setControlText(wndClothes, "addremove", "add") server.removePlayerClothes(g_Me, cloth.parent.type) else local prevClothIndex = table.find(cloth.siblings, "wearing", true) if prevClothIndex then cloth.siblings[prevClothIndex].wearing = false end cloth.wearing = true setControlText(wndClothes, "addremove", "remove") server.addPedClothes(g_Me, cloth.texture, cloth.model, cloth.parent.type) end end wndClothes = {"wnd"; text = "Clothes", x = -20, y = 0.3, width = 350, controls = { {"lst"; id = "clothes", width = 330, height = 390, columns = { {text = "Clothes", attr = "name", width = 0.6}, {text = "Wearing", attr = "wearing", enablemodify = true, width = 0.3}}, rows = { {name = "Retrieving clothes list..."}}, onitemclick = clothListClick, onitemdoubleclick = applyClothes}, {"br"}, {"btn"; text = "Add", id = "addremove", width = 60, onclick = applyClothes}, {"btn"; id = "Close", closeswindow = true}}, oncreate = clothesInit} function addClothesCommand(cmd, type, model, texture) if type then type = tonumber(type) end if type and model and texture then server.addPedClothes(g_Me, texture, model, type) end end addCommandHandler("addclothes", addClothesCommand) addCommandHandler("ac", addClothesCommand) function removeClothesCommand(cmd, type) if type then type = tonumber(type) end if type then server.removePlayerClothes(g_Me, type) end end addCommandHandler("removeclothes", removeClothesCommand) addCommandHandler("rc", removeClothesCommand) function playerGravInit() triggerServerEvent("onPlayerGravInit", g_Me) end addEvent("onClientPlayerGravInit", true) addEventHandler("onClientPlayerGravInit", g_Root, function(curgravity) setControlText(wndGravity, "gravval", string.sub(tostring(curgravity), 1, 6)) end ) function selectPlayerGrav(leaf) setControlNumber(wndGravity, "gravval", leaf.value) end function applyPlayerGrav() local grav = getControlNumber(wndGravity, "gravval") if grav then server.setPedGravity(g_Me, grav) end closeWindow(wndGravity) end function setGravityCommand(cmd, grav) if grav then grav = tonumber(grav) end if grav then server.setPedGravity(g_Me, tonumber(grav)) end end addCommandHandler("setgravity", setGravityCommand) addCommandHandler("grav", setGravityCommand) wndGravity = {"wnd"; text = "Gravity", width = 300, controls = {
-
I tried to replace CJ clothes i didn't got luck Sorry about my reply before.
-
You can't replace CJ clothes. But, you can replace the skin.
-
I really don't understand you, can you explain easier?.
-
Try this: local sounds = { ['S1'] = "http://d.liveatc.net/kjfk_twr", ['S2'] = "http://212.45.104.34:8042/listen.pls", } function startMySound() local vehicle = getPedOccupiedVehicle( localPlayer ) local id = getVehicleID(vehicle) if (id == 513 ) then setRadioChannel(0) playSound( sounds['S1'] ) elseif (id == 429 ) then setRadioChannel(0) sound = playSound( sounds['S2'] ) end end addEventHandler("onClientPlayerVehicleEnter",getRootElement(),startMySound) function stopMySound() stopSound( sounds ) end addCommandHandler ( "stopsound", stopMySound ) addEventHandler("onClientVehicleExplode",getRootElement(),stopMySound)
-
^ Or he can make his own script.
-
What do you want from this functions to do?.
-
try function() local wlevel = getPlayerWantedLevel(source) if wlevel > 6 then theTeam = getPlayerTeam (source) if theTeam and getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then setPlayerTeam(source,getTeamFromName("Unemployed")) outputChatBox ("Menetit työsi, koska olet korruptoitunut!",source, 255, 0, 0,true ) end end end
-
https://community.multitheftauto.com/in ... ls&id=6858
-
if self:getTimeRemaining() = respawnTime > 3000 then -------replace that with this
-
Write the codes at the line 317
-
But setElementPosition == spawnVehicle right?.
-
Who give you the codes, he have to fix it no't us.
-
Solidsnake14: may i ask? What is the difference between these function spawnVehicle and respawnVehicle
-
you just wanna change the sound? is this code, the resource i give it to you?
-
if it's private script send it to me private message then i'll try my best to help you.
-
try -- Client Side function setHealth ( ) local Ganim = getPedAnimation (localPlayer) local health = getElementHealth(localPlayer) local daAnim = getElementData(root, "animz") local daBlockz = getElementData(root, "blockz") if daBlockz == "Laying" and daAnimz == "Lay_Bac_Loop" then setPedAnimation(localPlayer,false) else setPedAnimation (localPlayer, "LAYING", "Lay_Bac_Loop") end if Ganim then setElementHealth ( localPlayer, health +5) end end setTimer(setHealth, 4000, 1) addCommandHandler ("relax", setHealth) some Mistakes Solved. cheak for the Example 2 Client side https://wiki.multitheftauto.com/wiki/SetPedAnimation look at setElementData
-
I'm sorry but i thought you make a marker hit If it's command the player most be source
-
replace setElementHealth ( player, health +5) with setElementHealth ( theplayer, health +5) I'm sorry but i thought you make i marker hit If it's command the player most be source
-
I said replace no't add
-
Also replace local daAnim = getElementData(root, "animz") local daBlockz = getElementData(root, "blockz") with local daAnim = getElementData(theplayer, "animz") local daBlockz = getElementData(theplayer, "blockz")
