Jump to content

0xCiBeR

MTA Team
  • Posts

    1,673
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by 0xCiBeR

  1. Algo así te podria ser de utilidad: Server-Side: music = { } music[1] = { name = "LMFAO - Party Rock Anthem", length = "04:22", url = "http://dl.dropbox.com/u/52843114/Music/LMFAO%20-%20Party%20Rock%20Anthem.mp3" } music[2] = { name = "Usher ft. Pitbull - DJ Got Us Falling In Love Again", length = "06:01", url = "http://dl.dropbox.com/u/52843114/Music/Usher%20ft%20Pitbull%20-%20DJ%20Got%20Us%20Falling%20In%20Love%20Again.mp3" } music[3] = { name = "Nicole Scherzinger - Don't Hold Your Breath (remix)", length= "05:48", url = "http://dl.dropbox.com/u/52843114/Music/Nicole%20Scherzinger%20-%20Don%27t%20Hold%20Your%20Breath.mp3" } music[4] = { name = "Inna - 10 Minutes (remix)", length = "04:09", url = "http://dl.dropbox.com/u/52843114/Music/Inna%20-%2010%20Minutes.mp3" } music[5] = { name = "Eiffel 65 - Blue", length = "03:41", url = "http://dl.dropbox.com/u/52843114/Music/Eiffel%2065%20-%20Blue.mp3" } music[6] = { name = "David Guetta & Kelly Rowland - When Love Takes Over", length = "03:08", url = "http://dl.dropbox.com/u/52843114/Music/David%20Guetta%20%26%20Kelly%20Rowland%20-%20When%20Love%20Takes%20Over.mp3" } music[7] = { name = "The Offsprings - You're Gonna Go Far Kid", length = "02:57", url = "http://dl.dropbox.com/u/52843114/Music/The%20Offspring%20-%20You%27re%20Gonna%20Go%20Far%2C%20Kid.mp3" } music[8] = { name = "Jessie J. feat. David Guetta - Laserlights", length = "03:28", url = "http://dl.dropbox.com/u/52843114/Music/Jessie%20J%20ft.%20David%20Guetta%20-%20Laserlight.mp3" } addEvent("onClientRequestMusicList",true) addEventHandler("onClientRequestMusicList",root,function()triggerClientEvent(source,"onServerSendMusicList",root,music)end) La parte del client que lo manejaria: function gotMusicList(songs) music = songs -- Just to globalize it (because we don't want to display URL, but we need it) for k,song in ipairs(music) do local row = guiGridListAddRow(musicList) guiGridListSetItemText(musicList,row,1,k,false,true) guiGridListSetItemText(musicList,row,2,song.name,false,false) guiGridListSetItemText(musicList,row,3,song.length,false,false) end guiSetEnabled(playButton,true) guiSetEnabled(closeButton,true) end addEventHandler("onServerSendMusicList",root,gotMusicList) Si no entiendes, me avisas.
  2. Proba cambiando de root a source haber que pasa..
  3. 0xCiBeR

    Translator

    For that you have to use a api, in the case of google translate it says: So, you will have to find another translation service with api avaliable, and use fetchRemote.
  4. Yeah missed it, i was from my cel thanks
  5. Everything seems ok, as it's in game-state http://www.game-state.com/177.180.108.45:22014. Did you leave it online for a while and then checked again? somtimes it takes some time to appear.
  6. That's true, but you can add a secret code, then they are fried.
  7. Try this: Client: function createText1 ( ) clip = getPedAmmoInClip ( getLocalPlayer() ) arma = getPedWeapon( getLocalPlayer() ) dxDrawText(""..clip.." | "..bala,screenWidth*0.248, screenHeight*0.955, screenWidth*0.0, screenHeight*0.0, tocolor(230, 252, 250, 255), 0.45, "bankgothic", "left", "top", false, false, false, false, false) if ( arma==34 ) then dxDrawText(" DMR ",screenWidth*0.77, screenHeight*0.02012, screenWidth*0.0, screenHeight*0.0, tocolor(50, 200, 31, 255), 1, "bankgothic", "left", "top", false, false, false, false, false) elseif ( arma==31 ) then dxDrawText(" M4A1 ",screenWidth*0.77, screenHeight*0.02012, screenWidth*0.0, screenHeight*0.0, tocolor(50, 200, 31, 255), 1, "bankgothic", "left", "top", false, false, false, false, false) elseif ( arma==28 ) then dxDrawText(" PWD ",screenWidth*0.80, screenHeight*0.020, screenWidth*0.0, screenHeight*0.0, tocolor(50, 50, 31, 205), 1.05, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText(" PWD ",screenWidth*0.8015, screenHeight*0.02012, screenWidth*0.0, screenHeight*0.0, tocolor(50, 200, 31, 255), 1, "bankgothic", "left", "top", false, false, false, false, false) elseif ( arma==33 ) then dxDrawText(" winchester ",screenWidth*0.1, screenHeight*0.6, screenWidth*0.0, screenHeight*0.0, tocolor(203, 112, 31, 255), 1, "bankgothic", "left", "top", false, false, false, false, false) end end function HandleTheRendering11 ( ) triggerServerEvent ( "abcdefghijklmnopqrstuvwxyz", localPlayer) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering11 ) addEvent("yes",true) function yes(thecode) if thecode == "magicbeans" then addEventHandler ( "onClientRender", root, createText1 ) end end addEventHandler("yes",root,yes) Server: function yeah () triggerClientEvent(source,"yes",source,"magicbeans") end addEvent("abcdefghijklmnopqrstuvwxyz",true) addEventHandler("abcdefghijklmnopqrstuvwxyz",root,yeah) PD: I'm from my cel, don't know if everything is perfect.
  8. You are sure that it's called that way? It's easier to delete the part of the code that creates that column.
  9. Then just trigger the event client side and check if it was succesfull, if it's not, then end the function there.
  10. If you type shutdown in the console, the server shuts down.
  11. gate = createObject(980, 1579, 713.599609375, 12.5, 0, 0, 90) -- objID, X, Y, Z, Rotation X, Y, Z function gateOpen(source) source = source local x, y, z = getElementPosition(source) local x1, y1, z1 = getElementPosition(gate) if getDistanceBetweenPoints3D(x, y, z, x1, y1, z1) <= 10 then moveObject(gate, 2000, 1579, 713.599609375, 7, 0, 0, 0) --moves the gate to the open position. time, X, Y, Z, Rotation X, Y, Z outputChatBox("Montana's Gate Is Now Open!", source, 0, 255, 0) setTimer(function () outputChatBox("Montana's Gate Is Now Closing!", source, 0, 255, 0) moveObject(gate, 2000, 1579, 713.599609375, 12.5 , 0, 0, 0)end,5000,1) end end addCommandHandler("go1", gateOpen)--Command /go1 to open gate
  12. This will close the gate after 5 seconds: gate = createObject(980, 1579, 713.599609375, 12.5, 0, 0, 90) -- objID, X, Y, Z, Rotation X, Y, Z function gateOpen(source) local x, y, z = getElementPosition(source) local x1, y1, z1 = getElementPosition(gate) if getDistanceBetweenPoints3D(x, y, z, x1, y1, z1) <= 10 then moveObject(gate, 2000, 1579, 713.599609375, 7, 0, 0, 0) --moves the gate to the open position. time, X, Y, Z, Rotation X, Y, Z outputChatBox("Montana's Gate Is Now Open!", thePlayer, 0, 255, 0) setTimer(moveObject,5000,1,gate, 2000, 1579, 713.599609375, 12.5 , 0, 0, 0) end end addCommandHandler("go1", gateOpen)--Command /go1 to open gate
  13. Check this out: http://stackoverflow.com/questions/8380797/enable-remote-mysql-connection If that doesn't work, google is your best friend mate.
  14. Is your database running on a diferent server than the server?... If it's so, you have to allow external connections
  15. Are you running the plugin?
  16. Should be the other way, client-server not server-client. Remember you have to have that plugin also.
  17. Don't know why you are triggering a client event. This is the example from the wiki: exports.woltlab:woltlab_connect ( "127.0.0.1", "root", "", "wcf" ) local login = exports.woltlab:woltlab_checkPassword ( "xthepr0mise", "test" ) if login == true then outputChatBox("Your password is right!") else outputChatBox("Your password is wrong!") end exports.woltlab:woltlab_disconnect() Remeber:
  18. local gRoot = getRootElement() local screenW, screenH = guiGetScreenSize() function dxDrawAnimWindow(text,height,width,color,font,anim) local x,y = guiGetScreenSize() btwidth = width btheight = height/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, width, height, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btwidth, btheight, btheight/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2,font,"center","center") dxDrawText ( "Example", 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2,font,"center","center")--Here you add the new dxDraw just fix the coords. end function content() local color = tocolor ( 0, 0, 0, 255 ) dxDrawAnimWindow ( "ExampleWindow",500,600, color, "default-bold", "OutBounce") end function open() opened = not opened if opened == true then start = getTickCount() addEventHandler ( "onClientRender", gRoot, content ) else removeEventHandler("onClientRender", gRoot, content ) end end bindKey("F2","down",open)
  19. Just put the dxDraw in the usfull function, and use the same interpolation effects.
×
×
  • Create New...