Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. There is no problem, you're just not rendering the image inside a renderer.
  2. myonlake

    JetPack

    How about you do that yourself, since it's not that hard. Here's the function you need: https://wiki.multitheftauto.com/wiki/BindKey
  3. You can use some real-time bump mapping for a little bit more of an effect.
  4. Well, it would do what the OP asks though. You can calculate crashes just fine on MTA.
  5. You can do it with shaders. It's just really complicated to make.
  6. I wouldn't be hugely surprised if it was taken down, though. There have been a few multiplayer projects of which all were taken down by lawyers, not because of lack of interest to continue project.
  7. Same could be done with any other files (scripts, maps), to be honest, not just file...files. At the moment we can do this but it will require a separate watch script to implement the functionality.
  8. Unable to reproduce with the script provided. Do you have the full script? Something else must be interfering with the camera. Another resource, perhaps? Spawn doesn't affect camera target.
  9. myonlake

    Car Rotators

    Like I said, if you don't care about order, you probably don't care which you use. So pairs is a fine solution, if you're concerned of a couple ticks here and there. But when you're iterating 10,000,000+ table elements, you're most likely not concerned about order anyway, so you'd always be defaulting to pairs in your code. I've ran scripts with tens of thousands of vehicles and items, one pairs loop didn't make any noticeable difference in loading. The real deal is after 100,000,000+ table elements in which pairs loop does indeed improve loading time somewhat noticeably, and I tested this as well. What I'm trying to say here is I doubt no one in this forum has any active server with 100,000,000 table elements for any dynamic loading situations; meaning, no one should use pairs over ipairs only because "it's faster in some situations". I quite often like to have order because it affects things client-side or the map or so. There is no noticeable difference in time with the table sizes we here have to deal with. P.S. If you didn't know, iterating with just the table size for i=1,size... is almost twice as fast than pairs or ipairs... so, if you were to over-optimize your scripts, there's your solution.
  10. myonlake

    Car Rotators

    You can start questioning the use of ipairs when you're iterating 10,000,000+ table elements (at this point you probably wouldn't care about order anyway, and you should do it in a dedicated instance if you work something like this). We're talking about a couple ticks when it's in the low millions and less... so, in theory, yes, there is a difference, in practice: no one cares. With small tables, which people normally have, the difference is zero to two ticks (meaning your optimization does practically nothing).
  11. myonlake

    SNow map

    What do you mean? What kind of a snow map? Here's a shader that makes San Andreas seem like it's been snowing: https://community.multitheftauto.com/index.php?p=resources&s=details&id=3361
  12. Exactly. We're lucky to have survived this far, in my honest opinion. (Seeing what they've done to other multiplayer modifications)
  13. That's not how event handlers work, you cannot return back information just like that. You need to make a callback function which is triggered from server-side which returns the state (client refill request -> server says ok -> client refill). So, for example: Client-side function fuelRefill( ) if ( not isPedInVehicle( localPlayer ) ) then return end triggerServerEvent( "onFuelRefill", localPlayer ) end addEvent( "onFuelRefillSuccess", true ) addEventHandler( "onFuelRefillSuccess", root, function( ) local p_veh = getPedOccupiedVehicle( localPlayer ) if ( not isElement( p_veh ) ) or ( not isElement( marker ) ) then return end for _, marker in ipairs( refill_stations ) do if ( isElementWithinMarker( p_veh, marker ) ) and ( fuel < 100 ) then fuel = fuel + r_rate end end end ) Server-side addEvent( "onFuelRefill", true ) addEventHandler( "onFuelRefill", root, function( ) if ( source ~= client ) or ( not isPedInVehicle( client ) ) then return end if ( getElementData( client, "player state" ) == "alive" ) then triggerClientEvent( "onFuelRefillSuccess", client ) end end ) Not tested. However, I would suggest doing what you did originally and just make sure player state is synchronized to the client (fourth parameter of setElementData, it is true by default).
  14. It will not work the way the OP wants it to.
  15. Maybe someone would do it for the experience, perhaps if they have less experience in the field and need a real project to work on? I think only those who can really prove themselves as good scripters should be paid anyway (I have hourly pay even on MTA projects).
  16. Perhaps it isn't player state? Or perhaps that data is server-side only? Or perhaps player state isn't supposed to be spectating? It should work just fine if you do it like that.
  17. Just math.floor it, then. function pay_function(player,cmd,playername,money) money = tonumber(money) and math.floor(tonumber(money)) or nil if not (playername) or not (money) then outputChatBox("[Help]: #ffffff/" .. cmd .. " [Name] [Amount]", player, 255, 0, 0, true) else local targetPlayer = exports.enExport:findPlayer(playername, player) if targetPlayer then if (targetPlayer==player) then outputChatBox("[Error]: #ffffffYou cant give money to yourself.", player, 255, 0, 0, true) elseif money <= 0 then outputChatBox("[Error]: #ffffff Bigger than 0", player, 255, 0, 0, true) elseif getPlayerMoney(player) >= money then givePlayerMoney(targetPlayer,money) takePlayerMoney(player,money) outputChatBox("[PAY]: #ffffffYou gaved $" .. money .. " to " ..getPlayerName(targetPlayer).. "", player, 255, 0, 0, true) outputChatBox("[PAY]: #ffffff"..getPlayerName(player).." #ffffff gaved you $" .. money .. "", targetPlayer, 255, 0, 0, true) else outputChatBox("[Error] #ffffffyou dont have enough money.", player, 177,9,45, true) end end end end addCommandHandler("pay",pay_function)
  18. Well, how do you define someone a spectator? Element data perhaps? A variable? You can simply just add that to the not isPedInVehicle check and make it return nothing when they are a spectator.
  19. So... script it yourself? It isn't hard to add one line of code or move one line of code. isPedInVehicle getPedOccupiedVehicle
  20. This is one of those topics I like to bookmark.
×
×
  • Create New...