-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Que raro, la copie exactamente como me la setio al clipboard mi función, vere de buscarlas denuevo.
-
Ya lo eh posteado en ingles, quizas alguien en español me pueda ayudar, no se selecciona Engineer, pero todas las demas si, y no encuentro el error. function DeployMetClick(button, state) if state == "up" then return end local CursorX, CursorY = getCursorPosition() if CursorX > 0.79 and CursorY > 0.917 then if CursorX < 0.96 and CursorY < 0.96 then Deploy() outputConsole("DEPLOYED") end end if CursorX > 0.00600 and CursorY > 0.809 then if CursorX < 0.07050 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Medic") outputConsole("Medic") end end if CursorX > 0.07426 and CursorY > 0.8098 then if CursorX < 0.01367 and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end if CursorX > 0.14100 and CursorY > 0.809 then if CursorX < 0.20400 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Assault") outputConsole("Assault") end end if CursorX > 0.20800 and CursorY > 0.809 then if CursorX < 0.27100 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Sniper") outputConsole("Sniper") end end end addEventHandler("onClientClick", getRootElement(), DeployMetClick)
-
Well, Engineer does not work but all the rest work perfectly.. cant see why, they're all perfect!! function DeployMetClick(button, state) if state == "up" then return end local CursorX, CursorY = getCursorPosition() if CursorX > 0.79 and CursorY > 0.917 then if CursorX < 0.96 and CursorY < 0.96 then Deploy() outputConsole("DEPLOYED") end end if CursorX > 0.00600 and CursorY > 0.809 then if CursorX < 0.07050 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Medic") outputConsole("Medic") end end if CursorX > 0.07426 and CursorY > 0.8098 then if CursorX < 0.01367 and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end if CursorX > 0.14100 and CursorY > 0.809 then if CursorX < 0.20400 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Assault") outputConsole("Assault") end end if CursorX > 0.20800 and CursorY > 0.809 then if CursorX < 0.27100 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Sniper") outputConsole("Sniper") end end end addEventHandler("onClientClick", getRootElement(), DeployMetClick)
-
That would only work client-side. I'd suggest you to use an element data if server-side, as WhoAmI Said. using a global variable server side should be like this: function HitMarker(Element, Dimension) model[Element] = getElementModel(Element) end addEventHandler("onMarkerHit", getRootElement(), HitMarker) Also, source of onMarkerHit element is the marker, not the player. https://wiki.multitheftauto.com/wiki/OnMarkerHit
-
All Leaked versions of this userpanel are bugged, and PVP never works. And no, you have to edit the race to make it work with it, since this panel uses some custom events.
-
No, For every dead player The actual one will get 100 money. (Source in this case). If there 10 players online: 5 died, the player who ends 5ths will get 500$. If you end first, you earn 1000$. (100 * 10)
-
That looks like Xiti's userpanel, note that you need to link it to the race gamemode. Plus, C_server is over 2000 lines. Meta:
-
Its very easy, i'll divide it into parts: Adding scoreboard column: https://wiki.multitheftauto.com/wiki/Scoreboard Setting Money: Pretty something like onPlayerWasted should do: function PlayerWasted() local DeadPlayers = #getDeadPlayers() local Prize = DeadPlayers * 100 end addEventHandler("onPlayerWasted", getRootElement(), PlayerWasted)
-
Es este function updateCopias( ) windows.copia[2].panes = { } local t = exports.items:get( getLocalPlayer( ) ) if t then for k, v in ipairs( t ) do if v.item == 1 or v.item == 2 then local image = exports.items:getImage( v.item, v.value, v.name ) table.insert( windows.copia[2].panes, { image = image or ":players/images/skins/-1.png", onHover = function( cursor, pos ) dxDrawRectangle( pos[1], pos[2], pos[3] - pos[1], pos[4] - pos[2], tocolor( unpack( getKeyState( 'c' ) and { 255, 0, 0, 63 } or { 255, 255, 0, 63 } ) ) ) dxDrawText( "ID: "..v.value,pos[1], pos[2]-250, pos[3] - pos[1], pos[4] - pos[2], tocolor ( 255, 0, 0, 255 ), 1.02, "pricedown", "left", "top", false,false,true ) end, onClick = function( key ) if key == 1 then copias = copias+1 triggerServerEvent( "items:copy", getLocalPlayer( ), k, copias ) end end } ) end end end end La función 'get' es server-side, no puedes utilizarla en client-side. Calla, eso es una variable, no esta usando el GET en si. en cambio el call es client & server side.
-
Primero, puede estar dentro de una carpeta. Segundo, simplmenete si no es ZIP debe ser RAR, y MTA solo soporta ZIP. Tercero, Cualquier carpeta que se encuentre dentro de corchetes; ej: "[ETC]" significa subcarpeta, y adentro puede contener resources, si no tiene estos requisitos es contada como posible carpeta de resource. (Cada cosa que contenga un meta basicamente es un resource, sin importar si es un map, o lo que sea)
-
Podrias especificar que errores? saludos.
-
Es bastante simple, vas al editor, seleccionas interiors, buscas ese (Que en dicho caso es el 14) y luego pones un ped y obtienes las coordenadas.
-
Quick bump and update: reading arround found out setCameraTarget was needed Now it works, thanks for the help anyway.
-
Well after some days of trying came to a question: Why does it work if im online and i restart the script (I'm starting the script via console and then logging in, and it works perfectly), but it doesnt if it is on and i come online (Without starting it with me online)?
-
Lo primero que hay es la introduccion al scripting (Imagino que no tienes problema con leerlo en inglés) https://wiki.multitheftauto.com/wiki/Sc ... troduction Luego lo que sigue es la GUI: https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI Igual en mi caso, yo te recomendaria que empiezes por provar de hacer cosas al azar, crear peds, dibujar textos, etc. Y si quieres algo mas avanzado, intenta crear algo con interpolateBetween que es una funcion bastante dificil, avanzada e interesante que puedes utilizar para crear animaciones (Te recomendaria escencialmente utilizarlo con dxDraw porque no tienes que hacer cosas extras, pero si aun asi quieres hacerlo con gui, deberias utilizar guiSetPosition en conjunto con onClientRender). De todas formas, onClientRender deberias verlo, es algo muy usado si quieres hacer cosas visuales interesantes. Saludos
-
How would that help? i'm being spawned but i cant see the bar (interior) and i see all objects "together" (The 2 peds on the bar are joined together infront of me, and i can see it becouse of their dxDrawText on their heads, but only the text, else just air) EDIT: Pic:
-
Hay un resource en la community que hace lo que quieres, aqui esta: https://community.multitheftauto.com/in ... ls&id=3090 Saludos
-
[FS] MP3 System - Custom Radio stations - MySQL
.:HyPeX:. replied to glowdemon1's topic in Resources
You should make a log system too, to ban "trolls" as you called them. -
Well, i can only make this work correctly if i restart the resource while im online and do /Lobby , if i reconnect i get buged up (also the F1 bind isnt working). Lobby = createTeam("#006677 - Lobby | Welcome - ") Missions = createTeam("#006677Missions | Co-Op") function SpawnPlayerToLobby(player,cmd) if source then bindKey(source, "F1", "down", "Lobby") fadeCamera(source, true) setPlayerTeam(source, Lobby) spawnPlayer(source, 493.45208740234, -23.21369934082, 1000, 0, 0, 17, 0) end if isElement(player) and getElementType(player) == "player" then spawnPlayer(player, 493.45208740234, -22.21369934082, 1000, 0, 0, 17, 0) setPlayerTeam(player, Lobby) fadeCamera(player, true) end end addEventHandler("onPlayerLogin", getRootElement(), SpawnPlayerToLobby) addCommandHandler("Lobby", SpawnPlayerToLobby)
-
Im not using it anyways, i've fixed this since the 3rd post and it works perfectly like that
-
Kinda forgot that detail of the server/client, and block of animation, the rest i already know it.
-
Well, its outputing the dance name correctly, but it wont dance. local DanceTable = {} table.insert(DanceTable, 1, "bd_clap") table.insert(DanceTable, 2, "bd_clap1") table.insert(DanceTable, 3, "dance_loop") table.insert(DanceTable, 4, "DAN_Down_A") table.insert(DanceTable, 5, "DAN_Left_A") table.insert(DanceTable, 6, "DAN_Loop_A") table.insert(DanceTable, 7, "DAN_Right_A") table.insert(DanceTable, 8, "DAN_Up_A") table.insert(DanceTable, 9, "dnce_M_a") table.insert(DanceTable, 10, "dnce_M_b") table.insert(DanceTable, 11, "dnce_M_c") table.insert(DanceTable, 12, "dnce_M_d") table.insert(DanceTable, 13, "dnce_M_e") function Dance() if not dance then i = nil countedTable = 0 for i,v in ipairs(DanceTable) do countedTable = countedTable + 1 end dance = true valRandom = math.random(1,countedTable) outputChatBox("#0046C8[bF3]: Random Dance: "..tostring(DanceTable[valRandom]), 255,255,255,true) setPedAnimation(getLocalPlayer(), tostring(DanceTable[valRandom]), 5000,true,true, false) dance = false setPedAnimation(getLocalPlayer()) end end addCommandHandler("Dance", Dance)
-
The peds come about line 280 EDIT: They exist (@IIYAMA) EDIT2: Fixed it by frozing them, Peds were just falling off the objects b4 they were loaded. local startx = 487.60119628906 local starty = -3.6586000919342 local startz = 1000 local screenStartX = guiGetScreenSize() local SPECWIDTH = screenStartX local screenStartX = screenStartX * 0 local SPECHEIGHT = (SPECWIDTH / 16) * 7 local screenStartY = SPECHEIGHT / 2 local BANDS = 40 local use_dx = true object = createObject(16000, 487.60119628906,-3.6586000919342,1000.7130126953, 0,0,180) setElementInterior(object, 17, 487.60119628906,-3.6586000919342,1000.7130126953) setObjectScale(object, 0.3) setElementCollidableWith(getLocalPlayer(), object, false) object1 = createObject(8838, 484.20709228516,-3.1703000068665,1001.5739746094,0,270,0) object2 = createObject(8838,484.41659545898,-3.3726000785828,1001.5739746094,0,270,90) object3 = createObject(8838,490.80099487305,-3.373899936676,1001.5739746094, 0,270,90) object4 = createObject(8838,490.99771118164,-3.1575000286102,1001.5739746094,0,270,180) setElementCollidableWith(getLocalPlayer(), object1, false) setElementCollidableWith(getLocalPlayer(), object2, false) setElementCollidableWith(getLocalPlayer(), object3, false) setElementCollidableWith(getLocalPlayer(), object4, false) setObjectScale(object1, 0.2) setObjectScale(object2, 0.2) setObjectScale(object3, 0.2) setObjectScale(object4, 0.2) setElementInterior(object1, 17) setElementInterior(object2, 17) setElementInterior(object3, 17) setElementInterior(object4, 17) timer = setTimer(function() setTime(1,0) setWeather(63) end, 5000,0) local peakData, ticks, maxbpm, startTime, release, peak, peaks function reset ( ) peaks = {} for k=0, BANDS - 1 do peaks[k] = {} end peakData = {} ticks = getTickCount() maxbpm = 1 bpmcount = 1 startTime = 0 release = { } peak = 0 end function changeMeta(stream) if tags then tags.stream_title = stream end end addEventHandler("onClientSoundChangedMeta", getRootElement(), changeMeta) timerSound = setTimer(function() Lobby = getTeamFromName("#006677 - Lobby | Welcome - ") if getPlayerTeam(getLocalPlayer()) ~= Lobby then setSoundVolume(stream, 0) else setSoundVolume(stream, 1) end end, 1000, 0) addEventHandler("onClientResourceStart", root, function () if ( stream ) then destroyElement(stream) end -- Deal with sound setRadioChannel(0) stream = playSound3D("http://pub5.di.fm:80/di_chilloutdreams",startx, starty, startz, true) setSoundVolume(stream, 1) setSoundMinDistance(stream, 1) setSoundMaxDistance(stream, 10000) startTicks = getTickCount() ticks = getTickCount() reset ( ) -- Deal with shaders -- Create shader shader_cinema, tec = dxCreateShader ( "texreptransform.fx" ) if not shader_cinema then return end -- If the image is too bright, you can darken it -- If the image is too bright, you can darken it dxSetShaderValue ( shader_cinema, "gBrighten", -0.25 ) -- Set the angle, grayscaled, rgb local radian=math.rad(0) dxSetShaderValue ( shader_cinema, "gRotAngle", radian ) dxSetShaderValue ( shader_cinema, "gGrayScale", 0 ) dxSetShaderValue ( shader_cinema, "gRedColor", 0 ) dxSetShaderValue ( shader_cinema, "gGrnColor", 0 ) dxSetShaderValue ( shader_cinema, "gBluColor", 0 ) -- Set image alpha (1 max) dxSetShaderValue ( shader_cinema, "gAlpha", 1 ) -- Set scrolling (san set negative and positive values) dxSetShaderValue ( shader_cinema, "gScrRig", 0) dxSetShaderValue ( shader_cinema, "gScrDow", 0) -- Scale and offset (don't need to change that) dxSetShaderValue ( shader_cinema, "gHScale", 1 ) dxSetShaderValue ( shader_cinema, "gVScale", 1 ) dxSetShaderValue ( shader_cinema, "gHOffset", 0 ) dxSetShaderValue ( shader_cinema, "gVOffset", 0 ) if not shader_cinema then outputChatBox( "Could not create shader. Please use debugscript 3" ) return else -- new render target slightly bigger tar = dxCreateRenderTarget ( SPECWIDTH, SPECHEIGHT ) -- reduce our width SPECWIDTH = SPECWIDTH - 6 -- Apply our shader to the drvin_screen texture engineApplyShaderToWorldTexture ( shader_cinema, "drvin_screen" ) end addEventHandler("onClientRender", root, function ( ) -- Get 2048 / 2 samples and return BANDS bars ( still needs scaling up ) local fftData = getSoundFFTData(stream, 2048, BANDS) -- get our screen size local w, h = guiGetScreenSize() -- if fftData is false it hasn't loaded if ( fftData == false ) then dxDrawText("Stream not loaded yet.", w-300, h-150) return end -- Draw a nice now playing thingy local myx, myy = guiGetScreenSize() local len = string.len("You are in the Lobby, feel free to relax or join the fight") dxDrawText("You are in the Lobby, feel free to relax or join the fight.", w-(270+(len*4)), h-150,myx,myy,tocolor(0,104,255,255), 1.5, "default-bold") -- Calculate our bars by the fft data calc ( fftData, stream ) end) end) -- Util stuff function timetostring ( input, input2 ) local minutes = input / 60 local seconds = input % 60 local minutes2 = input2 / 60 local seconds2 = input2 % 60 return string.format("%2.2i:%2.2i", minutes2, seconds2) end function avg ( num ) return maxbpm / bpmcount end function avg2 ( num1, num2, num ) return (num1+num2)/num end function round(num, idp) return tonumber(string.format("%." .. (idp or 0) .. "f", num)) end function getAverageBPM ( ) return maxbpm / bpmcount end function min ( num1, num2 ) return num1 <= num2 and num1 or num2 end function max ( num1, num2 ) return num1 >= num2 and num1 or num2 end function calc ( fft, stream ) -- Render to a render target and clear it dxSetRenderTarget( tar, true ) -- Set a random seed math.randomseed ( getTickCount ( ) ) -- Get our "Average" bpm local bpm = getSoundBPM ( stream ) if ( bpm == false or bpm == nil or bpm == 0 ) then bpm = 1 end local calced = {} local y = 0 local bC=0 local specbuf = 0 local w, h = guiGetScreenSize() local r,g,b = 0,0,0 local var = bpm + 37 -- use bpm to determine r,g,b though there are better ways of doing this. if ( var <= 56 ) then r,g,b = 99, 184, 255 end if ( var >= 57 and var < 83 ) then r,g,b = 238, 174, 238 end if ( var >= 83 and var < 146 ) then r,g,b = 238, 174, 238 end if ( var >= 146 and var < 166 ) then r,g,b = 99, 184, 255 end if ( var > 166 and var <= 200 ) then r,g,b = 238, 201, 0 end if ( var >= 200 ) then r,g,b = var, 0, 0 end local tags = getSoundMetaTags(stream) local bSpawnParticles = true if ( bpm <= 1 and getSoundBPM ( stream ) == false and getSoundPosition ( stream ) <= 20 ) then r,g,b = 255, 255, 255 dxDrawImage ( 0, 00, SPECWIDTH, SPECHEIGHT+100, "bg.png", 0, 0,0, tocolor(r, g, b, 255) ) dxDrawText(string.format("Learning...", bpm), screenStartX+10, screenStartY-30, screenStartX+10, screenStartY-30, tocolor(255, 255, 255, 255 ), 1.5, "arial") bSpawnParticles = false else -- always make this bigger because when you tint it the image will look smaller. local var = 600 local var2 = 400 dxDrawImage ( -var2, -var, SPECWIDTH+(var2*2), SPECHEIGHT+(var*2)+100, "bg.png", 0, 0,0, tocolor(r, g, b, 255) ) end local movespeed = (1 * (bpm / 180)) + 1 local dir = bpm <= 100 and "down" or "up" local prevcalced = calced -- loop all the bands. for x, peak in ipairs(fft) do local posx = x - 1 -- fft contains our precalculated data so just grab it. peak = fft [ x ] y=math.sqrt(peak)*3*(SPECHEIGHT-4); -- scale it (sqrt to make low values more visible) if (y > 200+SPECHEIGHT) then y=SPECHEIGHT+200 end -- cap it calced[x] = y y = y - 1 if ( y >= -1 ) then dxDrawRectangle((posx*(SPECWIDTH/BANDS))+10+screenStartX, screenStartY, 10, max((y+1)/4, 1), tocolor(r, g, b, 255 )) end if ( bSpawnParticles == true ) then for key = 0, 40 do if ( peaks[x][key] == nil ) then if ( #peaks[x] <= 20 and prevcalced[x] <= calced[x] and ( release[x] == true or release[x] == nil ) and y > 1 ) then local rnd = math.random(0, 0) peaks[x][key] = {} if ( dir == "up" ) then peaks[x][key]["pos"] = screenStartY else peaks[x][key]["pos"] = screenStartY+((y+1)/4) end peaks[x][key]["posx"] = (posx*(SPECWIDTH/BANDS))+12+screenStartX+(2-key) peaks[x][key]["alpha"] = 128 peaks[x][key]["dirx"] = 0 release
