Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. drk

    stream music

    No need to use this shitty streams. Install a webserver -> Put it online -> Put your musics in his www directory -> Then use "playSound ( "http://ip/music1.mp3", false )".
  2. drk

    alc Group Show

    exports [ "scoreboard" ]:addScoreboardColumn ( "Group" ) addEventHandler ( "onPlayerLogin", root, function ( ) setElementData ( source, "Group", aclGroupGetName ( aclGetGroup ( "Admin" ) ) ) end ) ??
  3. 1º - If with "upgrade" command it don't update then go to your "admin/server/admin_ip2c.lua" and change setVehicleFrozen to setElementFrozen on line 332. 2º - Be sure that you start scoreboard before admin resource.
  4. And setCameraTarget to set player 1 spectating on player 1.
  5. What's wrong: - onClientTrigger event not exists. - showPicture2 event don't have any arguments so you can't trigger the event with arguments "theVehicle, thePlayer, speed, x, y, z"
  6. triggerClientEvent(source, "showPicture2", theVehicle, thePlayer, speed, x, y, z) showPicture2 don't have any arguments.
  7. I don't understand, maybe you can explain better?
  8. What??
  9. Server: addEventHandler ( "onResourceStart", resourceRoot, function ( ) triggerClientEvent ( "LOL", root ) end ) addEvent ( "LOL2", true ) addEventHandler ( "LOL2", root, function ( ) print ( "LOL" ) end ) Client: addEvent ( "LOL", true ) addEventHandler ( "LOL", root, function ( ) triggerClientEvent ( "LOL2", root ) end ) ?? As far as I know, event "onClientTrigger" or something like that exists.
  10. drk

    XML stats system

    Data will be saved in the account you select in setAcountData. Maybe, you can edit data by handler like: addEventHandler ( "onResourceStart", resourceRoot, function ( ) local g_pACC = getPlayerAccount ( player ) -- i know this code is wrong. It's only a example. setAccountData ( g_pACC, "troll", "lol" ) end ) But if you're thinking about other thing, no. You can't.
  11. drk

    XML stats system

    Nop. You will save the data in the account. Not in the script or an array.
  12. drk

    don t work!!

    This is a mess. You need learn Lua dude. Client-side: function geta ( weapon, ammo, ammoClip, x, y, z, element ) if ( weapon == 31 ) then triggerServerEvent ( "givem", element ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, geta ) setTimer ( function ( ) removeEventHandler ( "onClientPlayerWeaponFire", localPlayer, geta ) end, 5000, 1 ) I don't know why you need remove handler after 5 seconds... But ok.
  13. drk

    XML stats system

    For what is MTA Wiki? https://wiki.multitheftauto.com
  14. drk

    Horns Problem

    Really. This is a stolen script. All scripts who people say "buyed from my friend" it's: STOLEN. And we don't help with stolen scripts.
  15. LOL Not most servers / vps dude. I've got much vps and never any vps have mysql or phpmyadmin.
  16. drk

    new JoinQuit

    No problem
  17. drk

    new JoinQuit

    LOL function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end local messageJoin = "" local messageQuit = "" function renderPlayerJoined ( ) dxDrawColorText("* ".. messageJoin,504.0,4.0,574.0,20.0,tocolor(200,0,0,255),0.7,"sans","left","top",false,false,false) end function renderPlayerLeft ( ) dxDrawColorText("* ".. messageQuit,503.0,16.0,573.0,32.0,tocolor(0,0,255,170),0.7,"sans","left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() messageJoin = getPlayerName(source) .. " #ffffffa entrado al servidor." addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,6000,1 ) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' #ffffffis now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " #ffffffa salido del server [" .. reason .. "]" addEventHandler ( "onClientRender", root, renderPlayerLeft ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerLeft ) end ,6000,1 ) end )
  18. drk

    new JoinQuit

    viewtopic.php?f=91&t=40706&p=413114&hilit=dxDrawColorText#p413114
  19. drk

    new JoinQuit

    Use the function dxDrawColorText. You can find this function in the forums
  20. drk

    new JoinQuit

    I've not seen this, I have only changed the variable name
  21. drk

    new JoinQuit

    Oh, I see, btw, you forgot to remove the extra commas in the timer(s). you forgot to remove the extra commas in the timer(s). Where? LOL
  22. drk

    new JoinQuit

    In onClientPlayerQuit event you wrote messageLeft instead of messageQuit.
  23. drk

    new JoinQuit

    local messageJoin = "" local messageQuit = "" function renderPlayerJoined ( ) dxDrawText("* ".. messageJoin,504.0,4.0,574.0,20.0,tocolor(200,0,0,255),0.7,"sans","left","top",false,false,false) end function renderPlayerLeft ( ) dxDrawText("* ".. messageQuit,503.0,16.0,573.0,32.0,tocolor(0,0,255,170),0.7,"sans","left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() messageJoin = getPlayerName(source) .. " a entrado al servidor." addEventHandler ( "onClientRender", root, renderPlayerJoin ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoin ) end ,5000,1, ) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " a salido del server [" .. reason .. "]" addEventHandler ( "onClientRender", root, renderPlayerLeft ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerLeft ) end ,5000,1, ) end )
  24. You forgot a end to end function. function createLoginWindow() -- define the X and Y positions of the window local X = 0.375 local Y = 0.375 -- define the width and height of the window local Width = 0.25 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" -- click on the function's name to read its documentation. wdwLogin = guiCreateWindow(x, y, Width, Height, "Please login with your username and password", true) -- define new X and Y positions for the first label. X = 0.0825 y = 0.2 -- define new Width and Height values for the first label. Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window). guiCreateLabel (X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value so the second label is slightly below the first. Y = 0.5 guiCreateLabel (X, Y, Width, Height, "password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit (X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit (X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50. guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In" true, wdwLogin) -- now add our onClientGUIClick event to the button we just created. addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) -- make the window invisible guiSetVisible(wdwLogin, false) end -- create the function and define the 'button' and 'state' parameters. -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) -- if our login button was clicked with the left mouse button, and the state of the mousebutton is up: if button == "left" and state == "up" then -- get the text entered in the 'username' field. local username = guiGetText(edtUser) -- get the text entered in the 'password' field. local password = guiGetText(edtPass) -- if the username and password both exist: if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it. triggerServerEvent("submitLogin", getRootElement(), username, password) -- move the input focus back on the game (allowing players to move arround, open the chatbox, etc) guiSetInputEnabled(false) -- hide the window and all the components. guiSetVisible(wdwLogin, false) -- hide the mouse cursor. showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui. outputChatBox("please enter a username and password.") end end end -- attach the event handler to the root element of the resource. -- this means it will only trigger when it's own resource is started. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () -- create the log in window and it's components. createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to BlackDeath's Alpha Server, Please log in with the login information provided to you") -- if the GUI was successfully created, then show the GUI to the player. if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasn't been properly been created, tell the player. outputChatBox("An unexpected error has occurred and the login GUI has not been created.") end -- enable the players cursor (so that they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening. guiSetInputEnabled(true) end ) -- attach the event onClientGUIClick to btnLogin and set it to trigger the 'clientSubmitLogin' function. addEventHandler("onClientGUIClick", btnLogin, clientSumbitLogin, false)
  25. https://wiki.multitheftauto.com/wiki/fadeCamera Example: setTimer ( fadeCamera, 5000, 1, source, true, 0.5 )
×
×
  • Create New...