Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. local seconds = 5 function consoleAddUpgrade ( thePlayer ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( 1139 ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if ( theVehicle ) then addVehicleUpgrade ( theVehicle, id ) end end end addEventHandler ( "onMapStarting", root, function ( ) setTimer ( function ( ) for _, player in pairs ( getElementsByType ( "player" ) ) do consoleAddUpgrade ( player ) end end, seconds * 1000, 1 ) end );
  2. How is this 'gasoline' saved? And what's the maximum range of it? 0-100?
  3. https://github.com/Woovie/dxGUI
  4. If you want 5s interval, for i, v in pairs ( Inter.rows ) do local row = unpack(v) local name = guiGridListGetItemText ( Inter.grid.list, row, 1) local dtxd = Downloader.Mods[ name ].txd local ddff = Downloader.Mods[ name ].dff local t = ( i - 1 ) * 5000 setTimer ( function ( ) triggerEvent("startDownloadModSelected", root, dtxd, ddff) end, ( t == 0 ) and 50 or t, 1 ); Inter.refresh ( ); end
  5. Well, while you inserting row into gridlist, insert it also into table.
  6. triggerServerEvent("pershingsquarespawn", localPlayer) Show your "pershingsquarespawn" event. You have to insert there setting skin's model. Not in client-side.
  7. If you are using race gamemode local seconds = 5 function consoleAddUpgrade ( thePlayer ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( 1139 ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if ( theVehicle ) then addVehicleUpgrade ( theVehicle, id ) end end end addEventHandler ( "onMapStarting", root, function ( ) setTimer ( function ( ) for _, player in pairs ( getElementsByType ( "player" ) ) do consoleAddUpgrade ( player ) end, seconds * 1000, 1 ) end );
  8. When you are using event again you have to set playing = false.
  9. local playing = false function speed() if ( enablelight ) and ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then dxDrawImage(x*960+x2, y*470+y2, 306, 232, "files/2/light.png", 0,0,0, tocolor(255, 255, 255 , 255)) if ( not playing ) then playSound("files/lightswitch.mp3") playing = not playing end else dxDrawImage(x*960+x2, y*470+y2, 306, 232, "files/2/light2.png", 0,0,0, tocolor(255, 255, 255 , 255)) end end addEventHandler ( "onClientRender", root, speed )
  10. Ta funkcja składni jest np++ z odpowiednim pluginem.
  11. https://community.multitheftauto.com/index.php?p= ... ls&id=1316
  12. Client side godModeTeams = { ["Name"] = true, } addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) local team = getPlayerTeam ( source ) if ( team and godModeTeams [ getTeamName ( team ) ] ) then cancelEvent ( ) end end )
  13. WhoAmI

    Elseif

    function rejestracja() un = guiGetText(uzytkownik) psw = guiGetText(haslo) auth = guiGetText(powtorzhaslo) if un ~= "" and psw ~= "" then if psw == auth then triggerServerEvent("rejestruj", getLocalPlayer(), un, psw) end end if un == "" then exports["notifications"]:showBox("info", "Pole z nazwą użytkownika nie może pozostać puste!") end if psw == "" thne exports["notifications"]:showBox("info", "Pole z hasłem nie może pozostać puste!") end end addEventHandler("onClientGUIClick", rejkaBUTTON, rejestracja, false)
  14. WhoAmI

    [WIP] Mask Shop

    Just use masks as objects, and attach them to skin model.
  15. WhoAmI

    Basic's SQL

    To create database you can create a file with '.db' extension and connect to it using dbConnect ( "sqlite", "file.db" ) For rest you have example up.
  16. WhoAmI

    Basic's SQL

    Use dbExec for inserting/updating values into database. Use dbQuery for selecting values from database. Remember to free querys by using dbFree. If you are using dbPoll, you don't have to free them - dbPoll free them automatically. Examples -- conencting connect = dbConnect ( "sqlite", "somefile.db" ) -- creating tables dbExec ( connect, "CREATE TABLE IF NOT EXISTS `table` (`column1` INTEGER, `column2` TEXT)" ) -- inserting values dbExec ( connect, "INSERT INTO `table` SET `column1`=?, `column2`=?", 0, "test" ) -- or dbExec ( connect, "INSERT INTO `table` ( `column1`, `column2` ) VALUES (?,?)", 0, "test" ) -- updating values dbExec ( connect, "UPDATE `table` SET `column1`=?", 1 ) -- selecting values and showing them local q = dbQuery ( connect, "SELECT `*` FROM `table`" ) for k, v in pairs ( dbPoll ( q, -1 ) ) do print ( v["column1"], v["column2"] ) end
  17. You are creating file with '.db' extension, or you connect to global internal.db. Inserting and updating is done by database questions.
  18. Your table looks liek that table = { { name, exp, cash }, { name, exp, cash}, ... } It's easy to loop table and show it's values. for _, v in pairs ( table ) do local name, exp, cash = unpack ( v ) -- now you have 3 values, you have to insert it to gridlist using guiGridListAddRow end
  19. addCommandHandler ( "addword", function ( player, cmd, word ) if word then table.insert ( Table, tostring ( word ) ) end end ) addCommandHandler ( "removeword", function ( player, cmd, word ) if word then for k, v in pairs ( Table ) do if v == word then table.remove ( Table, k ) break end end end end )
  20. Change "rot3" to "rot3 - 180" or "rot3 + 180". Check what works.
×
×
  • Create New...