Jump to content

^.^

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by ^.^

  1. Yes, but the client code doesn't output a text the 2nd time
  2. Hey, I have some problem with a trigger. I trigger some tables to the client to load them. That works fine. After I die it should trigger some other tables with the same function again to the client, but after the 1st trigger it doesn't trigger it anymore. The Code: function setUPDMPlayer(player,spawn,o,m,p) --outputChatBox(#spawn) if spawn then toggleControl(player,"vehicle_secondary_fire",true) toggleControl(player,"vehicle_primary_fire",false) local rand = math.random(tonumber(#spawn)) spawnPlayer(player,spawn[rand].posX,spawn[rand].posY,spawn[rand].posZ) setElementDimension(player,1) local vehicle = createVehicle(spawn[rand].modelID,spawn[rand].posX,spawn[rand].posY,spawn[rand].posZ,spawn[rand].rotX,spawn[rand].rotY,spawn[rand].rotZ) end triggerClientEvent(player,"loadMapDM",root,mapDM,o,m,p) outputChatBox("Triggered Event") end Mabey you have a solution for my problem. Regards
  3. As GMorte already said you can compare the serial from the table and the serial of the player. You can also use the IP but that's not the best solution. Regards
  4. You have to use latentEvents, but ffs and TG have a special method for compressing their files I heard.
  5. ^.^

    [TUT]latentEvents

    Of course I explained the the use of triggerLatentClientEvent. Well I used always the file size cause the files were not over a size of 1 MB so it works perfectly. I'll add it to the code.
  6. Hey Guys, as an experienced member from TG said to me I should show you how to use latentEvents for loadingFiles I thought why not. So heres a small tutorial on how to use latentEvents. In this case it's for music and mod files. You can use latentEvents for every file you want to transfer to the client. triggerLatentClientEvent: This stands for triggering a client event. Either to transfer some kind of stuff or only to start a function. I'll explain it now more exactly. triggerLatentClientEvent([sendTo = the Element you wish to trigger it for], the Eventname, [the bandwith = how much bytes it should transfer in 1 second], [persist = [true/false]If the source resource stops and persist = true the latentEvent will be continued otherwise it will be interrupt], theElement = should be the root Element, [arguments = the files you want to trigger]) [ ] means that the are not needed So let's start with an easy example. If the resource starts a file should be opened and should get transfered to the client. Serverside: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),function() local file = fileOpen("yourFile.txt") local buffer if file then --Just asking if the operation was successfull buffer = fileRead(file,fileGetSize(file)) --the buffer is now our argument we want to trigger local output = {buffer} --more comfortable to transfer for _, p in ipairs(getElementsByType("player")) do --we send it now to every player on the server --to set the transferspeed we can use the filesize if not too high or an wishingvalue triggerLatentClientEvent(p,"sendFile",50000 or fileGetSize(file),false,root,output) end end end) Clientside: addEvent("sendFile",true) addEventHandler("sendFile",root,function(buffer) local newFile = fileCreate(":resource/yourFile.txt") --creating the clientfile for r, p in ipairs(buffer) do --getting the content out of the table by using a loop fileWrite(newFile,p) --writing the content into the new file end fileClose(newFile) --closing the file, this will also flush the file end)( Thanks for reading this short tutorial and if there are any questions please ask me or give me some ideas on how to improve this small tutorial. Best Wishes
  7. ^.^

    [SELL]Huntertimes

    You think I didn't have made that script? Do you have any proofs of that. I guess my one looks not really the same, but it's your opinion. If you don't believe me I can give you some proofs what I can do. So If you wish to check that pm me.
  8. ^.^

    [SELL]Huntertimes

    Evenmore what if client changes IP? If the Key exists. The IP will change in the database. @Anderl thank you for let know what I already know. Now back to topic!
  9. ^.^

    [SELL]Huntertimes

    I won't discuss with you about the security . You are right thath users can decompile that script, but the most normal users don't have a decompiler.
  10. ^.^

    [SELL]Huntertimes

    Well thats correct, but there is some kind of security to prevent that. Cause the Key Launcher is standalone so if you delete all this files this won't work anymore.
  11. It's nice from you to share this script with us. It seems that there are some mods to download. You could replace the download with fileWrite and latentEvents to save the client much time
  12. Hey, I want to sell my huntertimes cause I made a much better script. Price: 5€ via PayPal Included in Price: Changing the design to your wishes, 1 Update for the script, Licensekey to avoid copies ( ServerIP will be added to a database) You can test it here: mtasa://85.190.173.79:22003 Screen:
  13. I think this would help you: https://wiki.multitheftauto.com/wiki/Main_Page or this: https://wiki.multitheftauto.com/wiki/Sc ... troduction
  14. Well for first if you want to create an Image for 2 minutes use a timer and then print it on the playerscreen with a GUIImage otherwise you can use the dxDraw Functions and calculate the showing time with the tickcount. For your second problem there is something difficult. You can't change the gamemode for one player. If you want to do that it's like an arenagameode. So you have to work more clientside, ... If you want to use the dxFunctions dxDrawImage getTickCount For GUI guiCreateStaticImage setTimer
  15. I thought the solution would be more difficult. At the end all files get downloaded within some seconds without a timeout.
  16. Well Thanks for your answers. Anderl you brought me to an idea.
  17. Hello Community, I am working on a loading system for downloading files. Sometimes when I download music or textures via the system I get network trouble. That's the line for triggering the event to the server. triggerLatentServerEvent("startFileDownload", 900000, getLocalPlayer(), serverFile, clientFile, gameModeID) I am downloading files at a size of about 3-4 MB. Thanks for your help
  18. Hey Guys, i have a question. All time when I buy a map via Mapshop I got an error. Mapmanager: Invalid map specified The Code: I put it in race/racevoting_server.lua function buyNextMap(player, buyMap) if not g_ForcedNextMap then if tonumber(getElementData(player,"race.donator")) > 0 then setElementData(player,"race.money",tonumber(getElementData(player,"race.money"))-2500) else setElementData(player,"race.money",tonumber(getElementData(player,"race.money"))-5000) end outputChatBox("#ff6666[sHOP] #ffffffNext map set to "..buyMap.." by "..getPlayerName(player).."", root, 255, 255, 255, true) setElementData(player,"race.mapsbought",tonumber(getElementData(player,"race.mapsbought"))+1) g_ForcedNextMap = buyMap elseif g_ForcedNextMap ~= nil then outputChatBox("#ff6666[sHOP] #ffffffNext map is already set", player, 255, 255, 255, true) end end addEvent("map:buy",true) addEventHandler("map:buy",root,buyNextMap) I hope you can help me. Thank you
  19. Hey Guys, I got a strange problem today. I made a mapshop but the script outputs an error that guiGridListAddRow is a boolean value. How can guiGridListAddRow() be a boolean value? Here's the code: addEvent("panel:fillmap",true) addEventHandler("panel:fillmap", getRootElement(), function(gamemodeMapTable,gamemode,map,s) if gamemodeMapTable then guiGridListClear(msGridlist) local row = guiGridListAddRow(msGridlist) aGamemodeMapTable = gamemodeMapTable; for id,gamemode in pairs (gamemodeMapTable) do if (gamemode.name == "Race") then for id,map in ipairs (gamemode.maps) do if s then if string.find(string.lower(map.name),string.lower(s)) then guiGridListSetItemText(msGridlist,guiGridListAddRow(msGridlist),gColumn,map.name,false,false); end else guiGridListSetItemText(msGridlist,guiGridListAddRow(msGridlist),gColumn,map.name,false,false); end end end end end end) Thank you for your help!
  20. Ach der nächste Vio Lite Server der mit Startepacket lockt. Das ist einfach nur sowas von unrealistisch.
  21. ^.^

    Call function error

    I solved the problem. I try to use this Code serverside and now it works!
  22. Das Problem war, dass sich der Mapmanager nicht Clientseitig callen lassen hat.
  23. Hey Community, Ich habe ein Problem mit meinem Map Script. Ich versuche die kompatiblen Maps mit meinem Gamemode via call zu erhalten. Jedoch erhalte ich immer folgende Fehler. Error-Code: ERROR: call: failed to call 'mapmanager:getRunningGamemode' ERROR: call: failed to call 'mapmanager:getMapsCompatibleWithGamemode' Code: ( Clientside) gmodes = call(getResourceFromName("mapmanager"), "getRunningGamemode") local maps = call(getResourceFromName("mapmanager"), "getMapsCompatibleWithGamemode",gmodes) for id,map in ipairs(maps) do maptable[id] = {} maptable[id].info = getResourceName(map) maptable[id].author = getResourceInfo(map,"author") local row = guiGridListAddRow(gMapGrid) guiGridListSetItemText(gMapGrid,row,1,getResourceName(map),false,false) end
  24. Hey Guys, I have a trouble with my map script. I want to get all maps which are compatible with the race gamemode. I try it via call function but i get a error. Error-Code: ERROR: call: failed to call 'mapmanager:getRunningGamemode' ERROR: call: failed to call 'mapmanager:getMapsCompatibleWithGamemode' my Code: ( Clientside) gmodes = call(getResourceFromName("mapmanager"), "getRunningGamemode") local maps = call(getResourceFromName("mapmanager"), "getMapsCompatibleWithGamemode",gmodes) for id,map in ipairs(maps) do maptable[id] = {} maptable[id].info = getResourceName(map) maptable[id].author = getResourceInfo(map,"author") local row = guiGridListAddRow(gMapGrid) guiGridListSetItemText(gMapGrid,row,1,getResourceName(map),false,false) end
×
×
  • Create New...