Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. I'm not quite sure but this can also be done without the unpack. If I'm not mistaken, the function getCameraMatrix returns a total of 8 parameters which are enough and actually correctly used in setCameraMatrix. If you want to save your head from clusterf*cks, you can try it by simply doing; setCameraMatrix ( getCameraMatrix() ) That might even save a little tiny bit of cpu usage too.
  2. tosfera

    Few questions.

    tables, loops, outputChatBox, bindkey/addCommandHandler. What kind of settings? MTA uses the same SQL as mariaDB systems ( phpmyadmin ), so it's basically the same. Either use the db* functions from the wiki or install the MySQL plugin.
  3. --- This --- When missiles hit vehicle the vehicle does not explode that instant, instead there is a small delay, if you use fix vehicle as soon as the vehicle gets damaged, then the vehicle won't go boom. If you're not running an RP server, sure. If it's a RP script, good luck saving all the panel states, door states, wheel states, current damage and set it all back when someone hits the vehicle with their fists, an AK or something like that. Even by saying that, in an RPG server players are most likely going to ram each other, f*ck up their friends with guns and sh*t. You're going to use fixVehicle every single bullet? That's going to be insanely CPU killing. It should be removed by destroyElement. Maybe add a timer for that one too, or first set the dimension to something random, and delete it after 1 second.
  4. source; https://forum.multitheftauto.com/viewtopic.php?f=91&t=47897
  5. tosfera

    dxButton

    either hide a MTA GUI button under there with an alpha of 0, or just add an eventhandler; onClientClick, and add a "hoverButton = " in your render. If the hoverButton equals something, it clicks a button.
  6. tosfera

    !!!

    Where are your debug lines to see where it went wrong? I can at least see 6 mistakes in the function "click", go and write some debug lines in there and find out what's wrong.
  7. tosfera

    CPU Usage.

    I have seen it around somewhere, a few graphs. I guess Grafu had something like that to report fps drops in several areas, not sure if he created it himself or if it was actually released.
  8. Well if you want to fix this, why don't you do it? It seems to me like you just came here to tell us you want to fix something and that there is a "problem". Well.. sorry to say but that sucks. Good luck with fixing the error buddy! We know you can do it, I guess.
  9. What do you mean? Just respawn the vehicle? simple; onVehicleExplode, use a setTimer to avoid your new vehicle from being blown up right away, then use getElementModel, getVehicleColors, getAllElementData and getElementPosition from the old vehicle, set the onto the new one and tada. As if the explosion never happened.
  10. The servers from OVH are seriously a nice thing.
  11. Animations are being cancelled if you change the position of the element. You've to reset the animation each time after you change their position.
  12. Please note that not every table can be taken the length of with the symbol "#". You can also get the length of other objects, variables etc. Even strings.
  13. There is however another way on how to do it on 000webhost. The thing about that is though.. you'll need to call everything with a PHP script and it'll take quite long.
  14. first of all, create a command with addCommandHandler like so; addCommandHandler ( "players", function ( thePlayer ) -- logic here end ); After that, initialize a new variable called; onlinePlayers or something like that. addCommandHandler ( "players", function ( thePlayer ) local onlinePlayers = 0; -- more logic here end ); After that, use a loop ( ipairs ) and getElementsByType to get all the players and increase the count of the users; addCommandHandler ( "players", function ( thePlayer ) local onlinePlayers = 0; for i, p in ipairs ( getElementsByType ( "player" ) ) do onlinePlayers = onlinePlayers + 1; end end ); Last but not least, output it to the player; addCommandHandler ( "players", function ( thePlayer ) local onlinePlayers = 0; for i, p in ipairs ( getElementsByType ( "player" ) ) do onlinePlayers = onlinePlayers + 1; end outputChatBox ( "Online members: ".. onlinePlayers, thePlayer ); end );
  15. @OP; local minedRocks = { {828}, {868}, {896}, {987}, {898}, {899}, {900}, {901}, {905}, {906}, {1303}, {1304}, {1305}, } local rand = minedRocks [ math.random ( 1, #minedRocks ) ];
  16. tosfera

    Solved..

    the "respawnVehicle" is inside the RSP function, all you need to do is pass the "source" ( the exploded vehicle ) as a parameter into that function and respawn it. The thing which Dominos7 said will not work since onVehicleExplode is not returning any parameters. Why do you want to check the waterstate though?
  17. Might be caused by the currentlyEvent, you should try to play around with that. I don't have my own computer here so I can't mess around too much without being caught by my boss.
  18. You can use the same bindkey as I gave you, just change the "down" to "up" in the duplicate so it goes like; bindKey ( "tab", "down", guiSetVisile, window, true ); bindKey ( "tab", "up", guiSetVisile, window, false );
  19. tosfera

    Solved..

    change your timer to; setTimer ( RSP, 5000, 1, source ) after that you might have to change the RSP() to RSP ( car ) since the car will most likely not stay global ( once it exploded, the element will not be the same anymore ).
  20. depends on how you're binding the key. The most easy way to bind something like this would be; bindKey ( "tab", "down", guiSetVisile, window, not guiGetVisible ( window ) ); ( if it's client sided, of course. )
  21. You can get 3ds max or maya from Autodesk, just make sure you got a students email to get quite some free years.
  22. isPlayerInTeam is an usefull function and requires you to add that piece of code in the script itself too. If you forgot that, it's simply not going to work. either add this to the same file; function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end or change this; if (not isPlayerInTeam(plr, "Civilian Workers")) then return end to if ( getPlayerTeam ( plr ) ~= getTeamFromName ( "Civilian Workers" ) ) then return end
  23. The last parameter of the function GuiGridListAddColumn is float width. As a total this would have to come out as 1.0. As far as you've created your GUI, it's 0.7. Increase the 0.1 where needed to fill the entire list.
  24. that would do, yes. But you can also use the if ( not x ) then return end way to cancel it. No need to use type to see if it's a boolean.
  25. Well, if I get what you're trying.. you're actually looking for data that's linked to each other. As in; account linked to character. As far as my knowledge goes, a left join would do but looking at your tables; vehicles, weapons. that's not going to work. You can't just simply get both of these in 1 query, every single join you're going to write will give you massive bugs since these two are very different from each other.
×
×
  • Create New...