Jump to content

PartyMTA

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by PartyMTA

  1. //With math based animation i mean ex; alpha = alpha + 1 Hello everyone. I am working on login panel with animation like mentioned above this line. Running the event first time works fine, but when i run it AGAIN, it doesnt detect when to stop. First time run is when resource start, and second time when i click a button (which does it perfectly) function loginAnim() if components.login.startPosX>stopanimpos1 then components.login.startPosX = components.login.startPosX - 10 if components.login.startPosX==stopanimpos1 then components.login.startPosX = stopanimpos1 end end end function loginAnim2() if components.login.startPosX<=stopanimpos1 then components.login.startPosX = components.login.startPosX - 10 if components.login.startPosX==0 then removeEventHandler("onClientRender",getRootElement(),login) components.login.startPosX = x end end end loginAnim is for opening, loginAnim2 for closing. It's windows 8 styled btw
  2. Hello guys, first: excuse me for too many questions, but i get stuck everytime. So i ask here. Is it possible to do a text in circle like dxDrawCircle, bit instead of drawing an line, a text? If so, please tell me how.
  3. The player is too in dimension 4, as you go there when you click the Freeroam button.
  4. Hello guys. I am working on a multi-gamemode, atm with freeroam. But when i try to add an vehicle in Dimension 4 (Same as the player) it does not show. No errors, nothing. If u need code, tell me.
  5. It depends on your forum, and if your web hoster supports mysql sharing. You could call the messages with the db functions and let the code update everytime theres a message added, and let the code output the latest message in the chatbox. Free webhostings mostly don't support mysql sharing over other sources tho.
  6. You need to make it yourself and create custom radar for it. I don't know about MTA:Eir, as i saw the normal radar with custo map.
  7. Hello all, im working on a lobby for my gamemode, i used getThisResourceRoot(getThisResource()), but when i use it in the event with DirectX functions (text, image etc), it doesnt show up, but with playSound it does work. Any help pls? root = getResourceRootElement(getThisResource()) function onJoin(theResource) addEventHandler("onClientRender",root,lobby) showCursor(true) showChat(false,false) setRadioChannel(0) radio = playSound("http://www.internet-radio.com/servers/tools/playlistgenerator/?u=http://72.13.86.6:8000/listen.pls?sid=1&t=.pls") --loginGUI() setSoundVolume(radio,2.0) lobbyFunctions() setElementDimension ( gLP, dimensions.lobby ) end addEventHandler("onClientResourceStart",root,onJoin) the lobby to render are the DX functions.
  8. Hello guys. I have 2 scripts with some directx codes in it. Whenever someone clicks on a button the second script goes on but also lets the first script on. But how do i let the first script keep overlaying the second one? First Script: function renderAlways() arena = getElementData(gLP,"user.arena") if arena then dxDrawText("Arena: "..arena,x/19,y/1.05,x,y,tocolor(255,255,255,255),2) else dxDrawText("Arena: None/Lobby",x/19,y/1.05,x,y,tocolor(255,255,255,255),2) end end addEventHandler("onClientRender",root,renderAlways) Second: function carballGui() addEventHandler("onClientRender",root,directxcb) end function directxcb() dxDrawRectangle(x/x,y/y,x,y,tocolor(0,180,0,255)) dxDrawText("Welcome to Carball!",x/2.6,y/18,x,y,tocolor(255,255,255,255),3) end The second triggers when i press a custom button (Which works). So how do i keep the first script overlaying the second one? (Both are in 2 different files) I want dxDrawText("Arena: "..arena,x/19,y/1.05,x,y,tocolor(255,255,255,255),2) keep overlay always. No matter what is in the same position
  9. Oh, i thought i had to put it server-side, thanks
  10. Hello, i tried to make a little script to make a blip for every single marker in the world and attach it. But it doesn't make any blip. Can someone help me? function getMarker() for k,marker in ipairs(getElementsByType("marker")) do local r,g,b,a = getMarkerColor(marker) createBlipAttachedTo(marker,0,2,r,g,b,a,0,99999) end end addEventHandler("onClientResourceStart",getRootElement(),getMarker) Note: i never used the for loops. So sorry if this makes no sense
  11. Hello there, how do i run different maps at the same time? (Race) I already have a gui with the maps in an array which is selectable and some buttons for it. But how do i make it work like LxG and TG? Pls don't blame for as copier or whatever. If u were interested in what i mean with maps in array: tho I made the GUI bigger already
  12. That will go up to 13 decimals, this code will go to ~15 decimals
  13. hi,i made this little script with the method of Archimedes to calculate the Pi. function getPi(commandName,number) calc = number*math.sin(0.5/number) outputChatBox(calc) end addCommandHandler("pi",getPi) Command: /pi (number) change (number) to the wished number. Without ()! its actually easy to make this. i just was bored
  14. Hi, i made this code with some thing out of the useful functions section. It will generate when it's completely white. So it will repeat making the spotlight. Used dxDrawPartialCircle and dxDrawCircle Dont ask me why i called the function dxDrawLoadBar.. function dxDrawLoadBar(posX, posY, radius, width, startAngle, endAngle, angleAmount, color, postGUI) local function clamp(val, lower, upper) if (lower > upper) then lower, upper = upper, lower end return math.max(lower, math.min(upper, val)) end radius = radius or -50 width = width or 5 startAngle = clamp(startAngle or 0, 0, 360) endAngle = clamp(endAngle or 360, 0, 360) angleAmount = angleAmount or 1 color = color or tocolor(255, 255, 255, 10) or tocolor(0, 0,0, 200) postGUI = postGUI or false for i=startAngle,endAngle,angleAmount do local _i = i*((math.pi/180-(posX/posY*40)-posX)*40) dxDrawLine(math.cos(_i)*(radius-width)+posX, math.sin(_i)*(radius-width)+(posY+60/posX),-posX*10,-posY/5, color, 6, postGUI) end return true end function dxDrawCircle(posX, posY, radius, width, angleAmount, color, postGUI) radius = radius or 50 width = width or 5 angleAmount = angleAmount or 1 color = color or tocolor(0, 150, 50, 50) postGUI = postGUI or false for i=0,360,angleAmount do local _i = i*(math.pi/180) dxDrawLine(math.cos(_i)*(radius-width)+posX, math.sin(_i)*(radius-width)+posY, math.cos(_i)*(radius+width)+posX, math.sin(_i)*(radius+width)+posY, color, width, postGUI) end return true end addEventHandler("onClientResourceStart", resourceRoot, function() sx, sy = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawCircle(sx/1.1, sy/1.1) dxDrawCircle(sx/1.1, sy/1.1,40,_,_,tocolor(0,150,150,50)) dxDrawCircle(sx/1.1, sy/1.1,30) dxDrawCircle(sx/1.1, sy/1.1,20,_,_,tocolor(0,150,150,50)) dxDrawCircle(sx/1.1, sy/1.1,10) dxDrawCircle(sx/1.1, sy/1.1,0,_,_,tocolor(0,150,150,50)) dxDrawCircle(sx/1.1,sy/1.1,60,_,_,tocolor(0,150,150,50)) dxDrawCircle(sx/1.1,sy/1.1,61,_,_,tocolor(0,150,150,40)) dxDrawCircle(sx/1.1,sy/1.1,62,_,_,tocolor(0,150,150,30)) dxDrawCircle(sx/1.1,sy/1.1,63,_,_,tocolor(0,150,150,20)) dxDrawCircle(sx/1.1,sy/1.1,64,_,_,tocolor(0,150,150,10)) dxDrawCircle(sx/1.1,sy/1.1,65,_,_,tocolor(0,150,150,1)) end ) end ) addEventHandler("onClientResourceStart", resourceRoot, function() sx, sy = guiGetScreenSize() percentage = 0 addEventHandler("onClientRender", root, function() if (percentage < 360) then percentage = percentage+5 else percentage = 0 end dxDrawLoadBar(sx/1.1, sy/1.1, nil, nil, 0, percentage) end ) end ) Just run it clientsided. You can play with local _i = i*((math.pi/180-(posX/posY*40)-posX)*40) Screen:
  15. local playerHealth = getElementHealth ( getLocalPlayer() ) if playerHealth = -<99 then setElementHealth ( getLocalPlayer(), 100) end I am not sure if this works Not tested
  16. Whenever the server starts a new map, this scripts also trigger function visibility() start = getTickCount() addEventHandler("onClientRender",root,dxMenu) showCursor(true,true) showChat(false) end addEventHandler("onClientResourceStart",resourceRoot,visibility) Anyone knows how to fix?
  17. Can someone help me please? function images() if button1 = guiCreateStaticImage(sX/4-50,sY/1.5,512/2.5,512/2.5,userpanel.image.mapshop,false) and button2 = guiCreateStaticImage(sX/2.3-50,sY/1.5,512/2.5,512/2.5,userpanel.image.settings,false) and button3 = guiCreateStaticImage(sX/1.6-50,sY/1.5,512/2.5,512/2.5,userpanel.image.music,false) then else destroyElement(button1) destroyElement(button2) destroyElement(button3) end end bindKey("U","down",images) debugscript 3 ERROR: Loading script failed: Win8_Userpanel\interface.lua:48: 'then' expected near '=' line 48 = button1 = guiCreateStaticImage(sX/4-50,sY/1.5,512/2.5,512/2.5,userpanel.image.mapshop,false)
  18. This code seems not working for me: function images() loginButton = guiCreateStaticImage(x/1.55,y/1.6,200/5,200/5,login,false) userIcon = guiCreateStaticImage( x/5,y/3,256,256, user,false) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), images ) addEventHandler("onClientMouseEnter", root, function(x,y) if (source == userIcon) then guiSetAlpha(source,150) end end ) addEventHandler("onClientMouseLeave", root, function(x,y) if (source == userIcon) then guiSetAlpha(source,255) end end ) Yes, images are rendered from an event on other place in full code
  19. Is there a way to hide the MTASA (version) text? Because when i record and edit it, the video looks not very nice. I saw some servers with that script
  20. Hi there guys, i'm searching a DM Stats Script/resource. Like, how many times got the hunter (In a gui). Anyone got it or seen it?
×
×
  • Create New...