HandBuzz

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About HandBuzz

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I wanted to say something that wouldn't cause so much CPU usage, I know some methods may load all the mods at the time and are very laggy for that server as well as the players I am not very good at efficient scripting, help is welcome
  2. I wanted to say something that wouldn't cause so much CPU usage, I know some methods may load all the mods at the time and are very laggy for that server as well as the players I am not very good at efficient scripting, help is welcome
  3. Hey guys, so I created a script for my server so that players can download mod files from a HTTP server. I have a considerable amount of files and this is a more comfortable way of downloading them. Now, I figured it out so players can download a single file, with the following structure (stripped down): function downloadMod ( name ) --name is correspondent to a clientside list if ( name and moddinglist[name] ) then local dff = moddinglist[name][1] local txd = moddinglist[name][2] if ( fileExists ( "mods/"..dff ) ) then --overwrite old files fileDelete ( "mods/"..dff ) end if ( fileExists ( "mods/"..txd ) ) then --overwrite old files fileDelete ( "mods/"..txd ) end downloadingFiles[name] = true -- a little output so i let the player know what he downloads local f = fetchRemote ( httpModDirectory.."/"..dff, function ( data, err, name, dff, txd ) if ( err == 0 ) then local f = fileCreate ( "mods/"..dff ) fileWrite ( f, data ) fileClose ( f ) if ( moddinglist[name][4] ) then fetchRemote ( httpModDirectory.."/"..txd, function ( data, err, name, name2 ) if ( err == 0 ) then local f = fileCreate ( "mods/"..txd ) fileWrite ( f , data ) fileClose ( f ) -- some more error handling code here, unnecesary -- and so on Now, as you can figure out i use an external file index with all the values and all that, so that a list can be created with each individual name and file names, and looks something like this moddinglist = { -- ["Name"] = { "file", "txdfile", vehID, isTXD } } Finally, I have a question. I want to setup the script so that players could download all the files listed all at once, how could I do that, without eating out all my server's resources?
  4. yes I do, but it's just a reskin, and it works fine with the hardcoded blip (i.e. where I have the parameters in a list). I don't think that is faulty
  5. So, first of all greetings. These days, i was trying to make a script that would allow you to create custom blips and save them to a database. The creation and saving (in the DB) part went well, but i am having problems when trying to load them back into the game. Here's part of the code that handles that: function loadOneBlip( ) local result = mysql:query_fetch_assoc("SELECT x AS x1, y AS y1, z AS z1, icon AS icons, size AS sizes FROM `blip`") --loading the data from the DB if result then while true do local row = mysql:fetch_assoc(result) --make it so i can select the data from a string if not row then break end --if there is no result end the operation local blip = createBlip( row.x1 , row.y1 , row.z1 , row.icons , row.sizes, 255, 0, 0, 0, 0, visibleDistance) --creating the actual blip outputChatBox("loading one blip (#"..blips..")", thePlayer, 255,255,255) --count them ingame to see if it loads completely blips = blips + 1 end mysql:free_result(result) else outputDebugString("blip failed",1) --something went wrong end end addCommandHandler("loadblip",loadOneBlip,false,false) addEventHandler("onResourceStart",root, loadOneBlip) And for more thoughts, yes, the connection to the DB is running good. The script is made serverside. And i also think i did something very wrong here, that being in when i execute the command, neither the blip gets created nor the error message display.
  6. So, first of all greetings. These days, i was trying to make a script that would allow you to create custom blips and save them to a database. The creation and saving (in the DB) part went well, but i am having problems when trying to load them back into the game. Here's part of the code that handles that: function loadOneBlip( ) local result = mysql:query_fetch_assoc("SELECT x AS x1, y AS y1, z AS z1, icon AS icons, size AS sizes FROM `blip`") --loading the data from the DB if result then while true do local row = mysql:fetch_assoc(result) --make it so i can select the data from a string if not row then break end --if there is no result end the operation local blip = createBlip( row.x1 , row.y1 , row.z1 , row.icons , row.sizes, 255, 0, 0, 0, 0, visibleDistance) --creating the actual blip outputChatBox("loading one blip (#"..blips..")", thePlayer, 255,255,255) --count them ingame to see if it loads completely blips = blips + 1 end mysql:free_result(result) else outputDebugString("blip failed",1) --something went wrong end end addCommandHandler("loadblip",loadOneBlip,false,false) addEventHandler("onResourceStart",root, loadOneBlip) And for more thoughts, yes, the connection to the DB is running good. The script is made serverside. And i also think i did something very wrong here, that being in when i execute the command, neither the blip gets created nor the error message display.
  7. Hello, I am trying to start a roleplay server but it seem i am not able to do something essential, that being replacing specific police car models and textures. When i go into the game the cars are purely stock, and i can't seem to be able to change them. I tried using pre-built mod-loaders, and building my own script, here it is, sorry for it being so long. function applyPDModels() -- tags tag4 = engineLoadTXD("copcarla.txd") -- files are in the same folder as the .lua and meta.xml engineImportTXD(tag4, 596) -- using the game ids for the car tag5 = engineLoadDFF("copcarla.dff") engineReplaceModel(tag5, 596) tag6 = engineLoadTXD("copcarsf.txd") engineImportTXD(tag6, 597) tag7 = engineLoadDFF("copcarsf.dff") engineReplaceModel(tag7, 597) tag8 = engineLoadTXD("copcarvg.txd") engineImportTXD(tag8, 598) tag9 = engineLoadDFF("copcarvg.dff") engineReplaceModel(tag9, 598) end addEvent(applyPDModels, true) addEventHandler("onClientResourceStart", getResourceRootElement(), applyPDModels) So, what should I do? So far my research has led to nothing, because these are the only client side commands that can do the job, but they don't function, please help me. P.S. the files are added in the meta.xml, and also the script.