Jump to content

Mini-Me

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Mini-Me

  1. The message is shown via a function "showMessage" that is defined in [race]/race/util_server.lua. It uses TextCreateTextItem to actually show it, but that function does not support font selection. Either you will have to rewrite the function "showMessage" and related functions to hide it again using a function like DxDrawText or create a new similar message display/hiding system using mentioned function to use that one instead of "showMessage".
  2. eAi is not your slave . He and the error message have given you enough information to find your mistake: Godmother\Fraktionen\Mafia\russia.lua:17 This is not only the path and filename of the file where the error is in, behind the colon it tells you the line number!
  3. Hmm, I now think it seems to be cached globally on the computer and when downloaded filtered based on the version you're running. Because I went through all MTA versions (1.0.5, 1.1, 1.2) to test something else and it now shows up the release news for the older versions in 1.3, too. But if you never had used MTA before and install 1.3 it apparently wont show any news at all, is that intended by the devs?
  4. Hi folks, Quite long ago already I noticed that MTA doesn't show the latest news in the main menu properly anymore. On my laptop (Windows 7 Home Professional, previously "Kaspersky Security Suite CBE 11" as Anti-Virus software, firewall & etc. but recently replaced with Microsoft Security Essentials & Windows Firewall) it originally showed news that also were up to date, but the "latest" entry in the meantime is "Version 1.2 is out", even though the version number in the main menu reads 1.3 . On my desktop computer (Windows XP MCE SP3, MSSE & Windows Firewall) I even see no news at all in version 1.3, similar to what Perfect screenshotted in his topic Timed out (I hope he doesn't mind me hijacking his picture): Now having started version 1.2 to see if Slothbot's edf works in there I noticed though that it has one single news entry: "1.3 released" (Well, maybe that is cached). So what is up with that? Is it only meant to show "relevant" news? Or is it an issue on my end that you can assist me in troubleshooting it? Cheers, Mini-Me
  5. I'm trying to do exactly that, but it fails because the button for the flags does not appear anymore. Debugscript outputs a relevant message: WARNING: editor_gui\client\me_gui.lua:172: Bad file path @ 'guiStaticImage' [] Version string of the server is "MTA:SA Server v1.3-release-4400". EDIT: Oh well, the lack of any documentation on how to do the path creation in the editor made me forget I had to scroll the mouse when I'm hovering over the default icons for objects, markers, etc.. I now at least have the generic icon that shows up when the actual Icon can't be loaded. But the point that the actual icon (flag) meant to be used doesn't show up still remains.
  6. My apologies if I annoy you with this, but since I didn't get any reaction on it yet after a whole month I somewhat want to draw your attention (after all our software developer at work also asks us to send them a mail when we submit a ticket or update notes): If I create a marker and listen for its onClientMarkerHit event (clientside, duh) it works alright and as expected, but if create the same marker with a handler to onMarkerHit attached to it (serverside...) I have to raise it by a few digits and have it floating to work as expected. Can anybody confirm this behavior? I think I should've described it quite perfectly in my comment on issue 0005513: Marker's with a size <= 1 do not trigger any marker hit/leave events. Cheers, Mini-Me
  7. @BinSlayer1: So the software quality characteristic maintainability is just based on laziness? @arezu and CrystalMV: Thinking about it again that is actually the better idea, since I also change the palyer's dimension in a second script. I suggested that in my first post to point out that I could've written that myself, but thanks though.
  8. @Kenix: For a test I created a new resource. It only contains your code, plus this: addCommandHandler("dimension", function(commandName, arg1) arg1 = tonumber(arg1) if (arg1 ~= nil) then setElementDimension(getLocalPlayer(), arg1) else outputChatBox("You need to provide a number as argument!") end end) If I now ingame use the command, my dimension is changed, however I do not get the message from your event handler. Also, there is no error output (that would show up with /debugscript 3). @BinSlayer1: That's not the point, it is that I wouldn't want to change the resource at all. Imagine I download a resource from the webpage here. I'd have to edit it each time when there is an update to it. But as there is no other way really, I'll have to use it.
  9. @Kenix: That wont work. Like I said, when the "dimension" attribute of an element changes, the event "onClientElementDataChange" is NOT triggered. @BinSlayer1: I guess that's my only option then (apart from the loop I mentioned above). I actually wanted to keep resources separate so that if I were to use a foreign resource I don't have to keep changing the scripts when I download an update, but in this special case the other resource is actually mine as well. Oh, and thank you for the quick answers.
  10. Hi fellow scripters, basing on the dimension a player is in I want to use the in MTA 1.3 new functions removeWorldModel and restoreWorldModel, and automatically do that when an other resource changes the player's dimension. Is there an event that gets triggered when a player(/element) changes the dimension? I tried the following code, but if I get it right then that only works with custom data attributes (those ones that are not posX, dimension, etc., for example added with "setElementData ( thePlayer, "tempdata.originalnick", sPlayerNickname )") and it doesn't work: addEventHandler ( "onClientElementDataChange", getRootElement(), function ( dataName, oldValue ) if getElementType ( source ) == "player" and dataName == "dimension" then outputChatBox ( getPlayerName(source).."'s new dimension is "..getElementData (source, "dimension").." and was " .. oldValue .. "!" ) end end ) Is there an other easy way or will I have to write me a loop that constantly check's an element's dimension to then trigger a custom event? Thanks for your answers already, Mini-Me
  11. Well, no. Like in my first quote, it does tell you the command it binds to the key, but it doesn't tell about the parameters.
  12. No, these commands: bind 5 spawncar 520 bind 5 down spawncar 520 bind 5 down "spawncar 520" all output: And: bind 5 "down" "spawncar 520" Outputs: EDIT: Uh, yeah. It works with the non-Num 5... but still the response of the console is misleading as far as I see it.
  13. Short question: Is there any way to bind a command with a parameter to a key from the ingame console or the chat? Similar to: /bind c "spawncar 520" ... which of course does not work, otherwise I wouldn't be asking . This only binds the command "spawncar" to the key. I'm afraid though that the answer is going to be no .
  14. It appears that the quite short time interval of the timer struggled the server. As soon as I commented out the call of the observeRcDummy function the network troubles stopped appearing. I now increased the time interval and it seems to work better.
  15. Hello MTA community, some weeks ago I started to write a gamemode for SA-MP, that should port a singleplayer modification to a multiplayer experience. However once I got to the point where I had to code animated objects in, I noticed SA-MP didn't suit my needs and took a look at MTA:SA. And wow, I've been pretty amazed. It seemed to be a multiplayer modification for GTA:SA that's more solid than SA-MP. Also the Lua scripting seemed more modern to me than SA-MP's Pawn coding. So I now coded what I already had in SA-MP, the object animation is working just fine, and went further. However, now I ran into a different issue: I need to code an RC mode and checked MTA's wiki for useful functions. However, I didn't find any, so I coded a workaround: The player is made invisible, put in the car and in his original spot a dummy ped is created. On that ped I loop a function recursively via a timer to copy his health over to the actual player, in case the dummy ped gets hurt. This works fine if I try to play it locally on my own server, but once other people try to do that the problems begin: I see them getting into RC mode just normally, however they only drive straight without steering. Then, after some meters the car disappears and it takes some time till it reappears in the place where the dummy also is. And after some more time both, player and car reappear in the spots they have been before. The other player sees himself driving fine, until the message "*network troubles*" appears on his screen. See an example of that happening in this video: Now here's the code I scripted for this: lastVehicleDriven = {} function saveLastVehicleDriven(thePlayer, seat, jacker) lastVehicleDriven[thePlayer] = source end addEventHandler("onVehicleExit", getRootElement(), saveLastVehicleDriven) rcDummy = {} function enterRcMode(keyPresser, key, keyState) if not getPedOccupiedVehicle(keyPresser) and isElement(lastVehicleDriven[keyPresser]) then if not isVehicleBlown(lastVehicleDriven[keyPresser]) and (getElementDimension(keyPresser) == getElementDimension(lastVehicleDriven[keyPresser])) then local posX, posY, posZ = getElementPosition(keyPresser) local rotX, rotY, rotZ = getElementRotation(keyPresser) local dimension = getElementDimension(keyPresser) local playerModel = getElementModel(keyPresser) local health = getElementHealth(keyPresser) setPlayerNametagShowing(keyPresser, false) local r, g, b, a local elements = getAttachedElements(keyPresser) if elements then for k,v in ipairs(elements) do if (getElementType(v) == "blip") then r, g, b, a = getBlipColor(v) destroyElement(v) end end end local driver = getVehicleOccupant(lastVehicleDriven[keyPresser], 0) -- move the driver to the passenger seat, the car can be "jacked" with the RC local passenger = getVehicleOccupant(lastVehicleDriven[keyPresser], 1) -- if there already is someone in the passengerseat just let MTA kick the driver out of the car if driver and not passenger then warpPedIntoVehicle(driver, lastVehicleDriven[keyPresser], 1) end warpPedIntoVehicle(keyPresser, lastVehicleDriven[keyPresser], 0) setElementAlpha(keyPresser, 0) giveWeapon(keyPresser, 0, 0, true) -- if the player has an SMG it would poke out of the window, we don't want that rcDummy[keyPresser] = createPed(playerModel, posX, posY, posZ) setElementRotation(rcDummy[keyPresser], rotX, rotY, rotZ) setElementDimension(rcDummy[keyPresser], dimension) setElementHealth(rcDummy[keyPresser], health) giveWeapon(rcDummy[keyPresser], 40, 0, true) -- give the dummy ped the remote control observeRcDummy(rcDummy[keyPresser], keyPresser) createBlipAttachedTo(rcDummy[keyPresser], 0, 2, r, g, b, a) end end end function observeRcDummy(rcDummy, assignedPlayer) if isElement(rcDummy) and isElement(assignedPlayer) then local health = getElementHealth(rcDummy) setElementHealth(assignedPlayer, health) -- if the dummy gets hurt, hurt the player it belongs to if not (getElementDimension(rcDummy) == getElementDimension(assignedPlayer)) then exitRcMode(assignedPlayer) -- end RC mode if the dummy and the player it belongs to go to different dimensions. Players can easily switch dimensions on our server end setTimer(observeRcDummy, 100, 1, rcDummy, assignedPlayer) -- loop this until the dummy or the car disappear end end function isPlayerInRcMode(thePlayer) if isElement(rcDummy[thePlayer]) then-- and getPedOccupiedVehicle(thePlayer) then return true end return false end function exitRcMode(keyPresser, key, keyState) if isPlayerInRcMode(keyPresser) then local rotX, rotY, rotZ = getElementRotation(rcDummy[keyPresser]) local posX, posY, posZ = getElementPosition(rcDummy[keyPresser]) local dimension = getElementDimension(rcDummy[keyPresser]) local r, g, b, a local elements = getAttachedElements(rcDummy[keyPresser]) if elements then for k,v in ipairs(elements) do if (getElementType(v) == "blip") then r, g, b, a = getBlipColor(v) destroyElement(v) end end end destroyElement(rcDummy[keyPresser]) removePedFromVehicle(keyPresser) getElementRotation(keyPresser, rotX, rotY, rotZ) setElementPosition(keyPresser, posX, posY, posZ) setElementDimension(keyPresser, dimension) setElementAlpha(keyPresser, 255) setPlayerNametagShowing(keyPresser, true) createBlipAttachedTo(keyPresser, 0, 2, r, g, b, a) end end function joinHandler() spawnPlayer(source, 1959.55, -1714.46, 17) fadeCamera(source, true) setCameraTarget(source, source) bindKey(source, "r", "down", enterRcMode) bindKey(source, "enter_exit", "down", exitRcMode) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) Other resources I have running with this are the following: admin, ajax, defaultstats, helpmanager, joinquit, killmessages, mapcycler, mapmanager, parachute, playerblips, resourcebrowser, resourcemanager, scoreboard, spawnmanager, votemanager, webadmin They are in their default state as they come with MTA:SA. Soo, can anybody help me out and tell me why it is doing that to us?
×
×
  • Create New...