Jump to content

Lord Henry

Other Languages Moderators
  • Posts

    3,981
  • Joined

  • Last visited

  • Days Won

    181

Everything posted by Lord Henry

  1. That's true. I didn't find an uncompiled version of this...
  2. Wow, thanks a lot by answering me. I didn't expect this... Keep up your perfect job. Do not worry, I'm not in a hurry. Haste does not match with perfection.
  3. Hello Everyone. My suggestion is to change the Blending Weather System. Nowadays, the only way to change the blending duration is using setMinuteDuration. But this isn't enough because my server uses real time minute duration (60000 miliseconds every minute). While this, the blending weather needs 2 real time hours to complete it's cycle, this is too much! Also, there's some weather IDs that I want to have different blending durations from the others, but if I change the minute duration, this will change the server clock 'speed. I think there should be more arguments to the setBlendingWeather, like blending duration. Example: If I want to blend a storm in 3 real time minutes (3 game hours). I could use: setWeatherBlended (8, 180000) This will blend the weather ID 8, in 180000 miliseconds, like the 'setTimer'. By default, this timer will always be 120000 because it's 2 game hours. If I use the current code: setWeatherBlended (8) This is the same as this: setWeatherBlended (8, 120000) PS: Using the setMinuteDuration client side is not an option.
  4. System: The ambilights should be sync with audio, not with video. You should add an Exit button, when someone wants to add a commandHandler to open the panel without a bind key. Example: /yt (without the exit button, the player will need to use F8 to use the /yt command because the chat is disabled while the panel is visible.) Remove the F2 bind key, add a commandHandler to open/close the panel. Like /yt. It would be great if remove the option to set night time (and never change the server time) and add the option to enable or disable vehicles inside the cinema. (Like the weapons) There's a bug when the player search for a video using the search bar: When I pressed a binded key (like B) it triggered the resource that it was attached to, but it should not happen, it should be like searching for a resource name on Admin Panel. Add an option to enable/disable HUD while the panel is open. It always bug the non-original HUDs. Remove all "My Options" buttons. None of then works. Remove "M" bindkey, keep only /mute command. Make /proper always enabled by default. Keep all the messages on a XML file, so anyone can translate it without edit the source code. (like the Admin Panel) On a far away future: Staffs can schedule videos to run. Staffs can schedule the cinema to open only from one period of the day to another. Map: Remove the parking machines. When someone destroys them, it leaves money on the ground that can not be collected. Remove the trees on the sidewalk, there's always someone hitting on them. Add a Parking place and put some cars as examples to the players. Keep the perfect job. This is the best cinema of the Universe of GTA.
  5. ERROR: killcamc.lua is invalid. Please, re-compile at https://luac.multitheftauto.com/ Please, fix this.
  6. ERROR: idlevehicles.lua:34: table index is nil Warning: idlevehicles.lua:34: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] function onPlayerDeathHandler(totalAmmo, killer, killerWeapon, bodypart, stealth) local thePlayer = source timers[theVehicle] = setTimer( isVehicleStatic(theVehicle) and respawnVehicle or destroyElement, 20000, 1, theVehicle )--line 34 end addEventHandler( "onPlayerWasted", root, onPlayerDeathHandler)
  7. And this is the final version, I added a function to stop the timer when the vehicle is exploded and a timer of 10 seconds to respawn it or destroy it. --[[You need to change all .map files with vehicles to make this script respawn them instead of destroy them. Example: <vehicle id="vehicle (Patriot) (2)" paintjob="3" interior="0"[...........]></vehicle> Change only the 'vehicle id' to: <vehicle id="server_vehicle (Patriot) (2)" paintjob="3" interior="0"[...........]></vehicle> You need to do it with all vehicles in all your .map files. Open the .map files with notepad++ 60000 = 60 seconds. --]] local timers = {} function onVehicleEnterHandler(thePlayer, seat, jacked)--This stops the timer when a player enters the vehicle or the vehicle is exploded. local theVehicle = source if isTimer( timers[theVehicle] ) then killTimer( timers[theVehicle] ) end end addEventHandler( "onVehicleEnter", root, onVehicleEnterHandler) addEventHandler( "onVehicleExplode", root, onVehicleEnterHandler) function onVehicleExitHandler(thePlayer, seat, jacked)--This starts a 60s timer when the player exit the vehicle. local theVehicle = source timers[theVehicle] = setTimer( isVehicleStatic(theVehicle) and respawnVehicle or destroyElement, 60000, 1, theVehicle )--This time must be lower than Freeroam setting 'MaxIdleTime' or it will return a warning to Console because it will try to destroy a vehicle that was already destroyed by Freeroam. I recommend that you set the Freeroam 'MaxIdleTime' to 70000. end addEventHandler( "onVehicleExit", root, onVehicleExitHandler) function onVehicleExplodeHandler(thePlayer)--This starts a 10s timer when the vehicle is exploded. This happens after the original timer is stoped. local theVehicle = source timers[theVehicle] = setTimer( isVehicleStatic(theVehicle) and respawnVehicle or destroyElement, 10000, 1, theVehicle )--This time must be lower than Freeroam setting 'MaxIdleTime'. end addEventHandler( "onVehicleExplode", root, onVehicleExplodeHandler) function isVehicleStatic(theVehicle)--This checks if the vehicle is from a map server or from a player. if isElement( theVehicle ) and getElementType( theVehicle ) == "vehicle" then if getElementID(theVehicle):find("server_") then return true end end return false end The unique problem happens if the player is killed while he's inside a vehicle. The vehicle doesn't respawn because the player didn't exited it. The freeroam also doesn't destroy it.
  8. Here is the full code. function checkVehicle (thePlayer) local v = getPedOccupiedVehicle(thePlayer); if (v) then local n = (not vehicleIsStatic(v)) and ("player") or ("map"); --outputChatBox("This vehicle is from " .. n) --Tell the player if the vehicle was created from a map (server) or was created by a player. --else --outputChatBox("You aren't in a vehicle!") end end addEventHandler("onVehicleEnter", getRootElement(), checkVehicle) function vehicleIsStatic(element) if(getElementType(element) == "vehicle") then local tag = getElementID(element); if(tag and (string.find(tag, "server_"))) then return 1; end end end function respawnExplodedVehicle () if(not vehicleIsStatic(source)) then -- Is not a vehicle from map --outputChatBox("The vehicle " .. getVehicleName(source) .. " will be destroyed");--Tell the player that the vehicle was destroyed and will not respawn again. setTimer(destroyElement, 10000, 1, source) --destroyElement(source) else setTimer(respawnVehicle, 10000, 1, source) --outputChatBox("The vehicle " .. getVehicleName(source) .. " will respawn");--Tell the player that the vehicle will respawn again where the map created it. end end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle) function respawnIdleVehicle () if(not vehicleIsStatic(source)) then -- Is not a vehicle from map --outputChatBox("The idle vehicle " .. getVehicleName(source) .. " will be destroyed"); setTimer(destroyElement, 30000, 1, source)--This will always return a Warning to Console when the player exit a vehicle and explode it. Because the script will try to destroy the idle vehicle after the time but it doesn't exist anymore. else setTimer(respawnVehicle, 30000, 1, source) --outputChatBox("The idle vehicle " .. getVehicleName(source) .. " will respawn"); end end addEventHandler("onVehicleExit", getRootElement(), respawnIdleVehicle)
  9. I think you should record all animations that the actor is doing and objects changes. Like, player entering vehicle, it should record the entering animation and the door opening animation.
  10. There's still one problem. The timer should stop when someone enters the vehicle (as driver or passenger) and restart when the vehicle goes empty (with no driver and no passenger).
  11. Done function checkVehicle (thePlayer) local v = getPedOccupiedVehicle(thePlayer); if (v) then local n = (not vehicleIsStatic(v)) and ("player") or ("map"); outputChatBox("This vehicle is from " .. n) else outputChatBox("you are't in a vehicle") end end addEventHandler("onVehicleEnter", getRootElement(), checkVehicle) function vehicleIsStatic(element) if(getElementType(element) == "vehicle") then local tag = getElementID(element); if(tag and (string.find(tag, "server_"))) then return 1; end end end function respawnExplodedVehicle () if(not vehicleIsStatic(source)) then -- Not is vehicle from map outputChatBox("The vehicle " .. getVehicleName(source) .. " was destroyed"); destroyElement(source) else setTimer(respawnVehicle, 10000, 1, source) outputChatBox("The vehicle " .. getVehicleName(source) .. " will respawn"); end end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle) Test this.
  12. I tried here, but nothing happens. The message telling if the vehicle is or not from map doesn't appear. I changed the .map file but still nothing happens.
  13. Cool! Now try explode both of them but respawn only the map vehicle. The player vehicle should disappear. (destroyed)
  14. Let's use an example. I have a map with a Patriot. How will I differentiate that Patriot of the .map from a Patriot created by a player?
  15. I was thinking about creating a bool variable. If created by map map = true else map = false If map = true respawnVehicle if map = false destroyElement (vehicle)
  16. Hello everyone. I need to destroy a vehicle that is idle for 60 seconds (Freeroam already has this function, so this part is unnecessary to make.) It starts counting when the vehicle becomes totally empty, (with no driver and no passengers), if someone enters in it before 60 seconds (as passenger or driver), the counting stops and restarts when the vehicle becomes empty again.) (Freeroam already works like this.) BUT If the car is from a .map, it need to be respawned to its original position on the map. Else if the car was created by a player (F1, command, Admin Panel, scripts, etc) so it will be destroyed. How can I differentiate the vehicles created by the .map from those created by the players? Also, when the vehicle gets exploded: if it is from a .map it will respawn after 10 seconds, else if was created by a player it will be destroyed after 10 seconds. I have a little script that respawn all vehicles that have been exploded. But it respawns all the vehicles created by players too... -- 1 second = 1000 function respawnExplodedVehicle() setTimer(respawnVehicle, 10000, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle)
  17. Yes... The resource have a client sided script and a server sided script. It calls the blips on the client sided script.
  18. ERROR: editor_test\portaoilhaFAs.lua:12: attempt to call global 'getPedOccupiedVehice' (a nil value) Solved! gateilhaFA1 = createObject ( 968, -3341.7001953125, 458.5, 10.5, 0, 270, 270 ) ZonailhaFA1 = createColCuboid ( -3356.7001953125, 459.89999389648, 9.6999998092651, 15.0, 5, 5.0 )--Zona em cubo de colisão. function GateIlha1Open (hitElement) if hitElement and getElementType ( hitElement ) == 'player' then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup("MapEditor")) then outputChatBox ( "Acesso permitido.", hitElement, 0, 255, 0, true ) moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, 90, 0 ) local veh = getPedOccupiedVehicle(hitElement) if veh then setElementFrozen(veh, true) end setElementFrozen( hitElement, true ) toggleAllControls( hitElement, false ) setTimer ( function( player ) local veh = getPedOccupiedVehicle(player) if veh then setElementFrozen(veh, false) end setElementFrozen( player, false ) toggleAllControls( player, true ) end, 3000, 1, hitElement ) outputChatBox ( "Aguarde o portão se abrir.", hitElement, 0, 255, 0, true ) else outputChatBox ( "Acesso negado.", hitElement, 255, 0, 0, true ) end end end addEventHandler ( "onColShapeHit", ZonailhaFA1, GateIlha1Open ) function GateIlha1Close () moveObject ( gateilhaFA1, 1000, -3341.7001953125, 458.5, 10.5, 0, -90, 0 ) end addEventHandler ( "onColShapeLeave", ZonailhaFA1, GateIlha1Close ) 8. local veh = getPedOccupiedVehice(hitElement) and 15. local veh = getPedOccupiedVehice(player) I changed to "Vehicle". Thanks by the help! It's working well now
  19. WARNING: editor_test\portaoilhaFAs.lua:8: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] ERROR: editor_test\portaoilhaFAs.lua:8: attempt to concatenate a boolean value
×
×
  • Create New...