Jump to content

The_GTA

Helpers
  • Posts

    822
  • Joined

  • Last visited

  • Days Won

    86

Everything posted by The_GTA

  1. I have released another milestone since I am busy with the model management patch for MTA. Enjoy
  2. Maybe some of you have seen my video of MTA:United Liberty City already. My converter has done quite a good job to import the GTA:United LC2SA scene into a MTA resource. I made this video to show you guys that I will be working on a MTA managed model loader patch and will most likely shedule it for MTA 1.2 You guys probably know the collision and model failures combined with engine replacement, that is going to be a thing of the past. I will think about enabling support for new models, yeah, new vehicle, ped or object ids. Wanted to share that with you guys, I am revin' my best.
  3. Sorry for dropping support for 1.0.5 so early. I plan a major overhaul, so the code of 1.0.5 was simply in my way.
  4. Probably. But why does the sound element not get destroyed? And it is wierd that the stream can be paused multi times while still playing synchronised. BASS is using such a big sound buffer? Alright, the timeout theory seems to be correct. BASS also buffers data which it collected since the stream paused; pretty weird but okay. Thanks for your help!
  5. It just, works. I think that the pausing of the live stream should stop the procession of sound input to the driver, not the keepalive of the stream.
  6. I am planning to do a radio resource. One of it's features shall be the management of live streams alongside with the internal GTA:SA ones. The live streams start up (playSound) and once onClientSoundStream triggers, they get paused (setSoundPaused(sound, true)). They remain paused until the user selects them; basically, the currently playing channel gets paused and the next one unpaused. Well, it does not work flawlessly. The streams tend to suddenly stop playing with no error output or sound element destruction. Is this supposed to happen? Do you guys have any experience with this problem? Am I forgetting something? Is BASS unable to handle some live streams? Or is pausing live streams bad? -- Another thing is onClientSoundChangedMeta and getSoundMetaTags. The event does not seem to trigger all the time and the function does not provide the promised stream_title.
  7. New version is out and I forgot a crucial bugfix, which would render auto indent undo useless. You have to temporarily put this into the resources folder to fix it (for experienced users only, MTA 1.1). http://www.megaupload.com/?d=CA4KK6SJ I hope you guys enjoy some auto indent editing By the way, before you do anything, edit your access.xml please.
  8. Java Minecraft is caching the terrain by huge polygon sections. You cannot really create memory resident models in MTA Lua and draw them in the world. Does not matter if you can group the blocks, the triangle count is gonna' be high as crap.
  9. Thank you for the suggestions, Remi. I figure them out
  10. The_GTA

    Player Control

    Check out the code above. I have updated it
  11. Yup, Default MTA Server. Spent some fun evening with .:SDK:.
  12. Hey! You should have come to my MTA 1.1 server Anyone, who wants to have some coding fun with me, join me in my MTA 1.1 server.
  13. The_GTA

    Player Control

    Haha, yeah. Here is some code I made for you which apparently does not fully work in MTA 1.1 (trololo). Stuff it into a resource and do /control *playername* /cancelcontrol Try_client.lua local controlSessions = {}; local forwardControls = { "fire", "next_weapon", "previous_weapon", "forwards", "backwards", "left", "right", "zoom_in", "zoom_out", "change_camera", "jump", "sprint", "look_behind", "crouch", "action", "walk", "aim_weapon", "conversation_yes", "conversation_no", "group_control_forwards", "group_control_back", "enter_exit", "vehicle_fire", "vehicle_secondary_fire", "vehicle_left", "vehicle_right", "steer_forward", "steer_back", "accelerate", "brake_reverse", "radio_next", "radio_previous", "radio_user_track_skip", "horn", "sub_mission", "handbrake", "vehicle_look_left", "vehicle_look_right", "vehicle_look_behind", "vehicle_mouse_look", "special_control_left", "special_control_right", "special_control_down", "special_control_up" }; local remoteControlStates = {}; local remoteMatrix = {}; local controlling = false; function clearControlStates() for m,n in ipairs(forwardControls) do remoteControlStates[n] = false; end triggerServerEvent("onControlReset", controlling); return true; end addEvent("onClientControlAttach", true); addEventHandler("onClientControlAttach", getRootElement(), function(controller) outputDebugString(getPlayerName(source) .. " is being controlled by " .. getPlayerName(controller)); if (controller == getLocalPlayer()) then controlling = source; setCameraTarget(source); clearControlStates(); remoteMatrix = {}; return true; end if not (source == getLocalPlayer()) then return true; end; for m,n in ipairs(forwardControls) do --toggleControl(n, false); end end ); addEvent("onClientControlDetach", true); addEventHandler("onClientControlDetach", getRootElement(), function() outputDebugString(getPlayerName(source) .. " has been given back control"); if (source == controlling) then controlling = false; return true; end if not (source == getLocalPlayer()) then return true; end; for m,n in ipairs(forwardControls) do --toggleControl(n, true); end setCameraTarget(getLocalPlayer()); end ); addEvent("onClientControlReset", true); addEventHandler("onClientControlReset", getRootElement(), function() local m,n; for m,n in ipairs(forwardControls) do setControlState(n, false); end end ); addEvent("onClientControlStateUpdate", true); addEventHandler("onClientControlStateUpdate", getRootElement(), function(state, active) setControlState(state, active); end ); addEvent("onClientControlMatrixUpdate", true); addEventHandler("onClientControlMatrixUpdate", getRootElement(), function(matrix) setCameraMatrix(unpack(matrix)); end ); addEventHandler("onClientPreRender", getRootElement(), function() if not (controlling) then return true; end; -- Emulate vehicle controls if (isPedInVehicle(controlling)) and not (isPedInVehicle(getLocalPlayer())) then if not (remoteControlStates["accelerate"] == getControlState("forwards")) then remoteControlStates["accelerate"] = getControlState("forwards"); triggerServerEvent("onControlStateUpdate", controlling, "accelerate", getControlState("forwards")); end end local m,n; for m,n in ipairs(forwardControls) do if not (getControlState(n) == remoteControlStates[n]) then remoteControlStates[n] = getControlState(n); triggerServerEvent("onControlStateUpdate", controlling, n, getControlState(n)); end end local newMatrix = { getCameraMatrix() }; if not (remoteMatrix == newMatrix) then remoteMatrix = newMatrix; triggerServerEvent("onControlMatrixUpdate", controlling, remoteMatrix); end end ); addCommandHandler("control", function(command, name) if not (name) then return false; end; local player = getPlayerFromName(name); if not (player) then outputChatBox(name .. " player not found"); return false; end if (player == getLocalPlayer()) then outputChatBox("You cannot remote control yourself!"); return false; end triggerServerEvent("onControlRequest", player); end ); addCommandHandler("cancelcontrol", function(command) if not (controlling) then return false; end; triggerServerEvent("onControlCancel", controlling); setCameraTarget(getLocalPlayer()); end ); Try_server.lua local playerData = {}; function initPlayer(player) local data = { controlledBy = false }; playerData[player] = data; return true; end local m,n; local ap = getElementsByType("player"); for m,n in ipairs(ap) do initPlayer(n); end addEventHandler("onPlayerJoin", getRootElement(), function() initPlayer(source); end ); function attachControl(control, controller) local pData = playerData[controller]; local controlData = playerData[control]; if (control == controller) then return false; end; if (controlData.controlledBy == controller) then return true; elseif (controlData.controlledBy) then return false; end if (pData.control) then detachControl(pData.control); end pData.control = control; controlData.controlledBy = controller; triggerClientEvent("onClientControlAttach", control, controller); return true; end function detachControl(control) local pData = playerData[control]; if not (pData.controlledBy) then return true; end; local controllerData = playerData[pData.controlledBy]; controllerData.control = false; pData.controlledBy = false; triggerClientEvent("onClientControlDetach", control); return true; end addEvent("onControlRequest", true); addEventHandler("onControlRequest", getRootElement(), function() local pData = playerData[client]; attachControl(source, client); end ); addEvent("onControlCancel", true); addEventHandler("onControlCancel", getRootElement(), function() local pData = playerData[client]; if not (pData.control == source) then return false; end; detachControl(pData.control); end ); addEvent("onControlStateReset", true); addEventHandler("onControlStateReset", getRootElement(), function() local pData = playerData[client]; if not (pData.control == source) then -- HAX kickPlayer(client); return false; end triggerClientEvent(source, "onClientControlStateReset", getRootElement()); end ); addEvent("onControlStateUpdate", true); addEventHandler("onControlStateUpdate", getRootElement(), function(state, active) local pData = playerData[client]; if not (pData.control == source) then -- HAX kickPlayer(client); return false; end triggerClientEvent(source, "onClientControlStateUpdate", getRootElement(), state, active); end ); addEvent("onControlMatrixUpdate", true); addEventHandler("onControlMatrixUpdate", getRootElement(), function(matrix) local pData = playerData[client]; if not (pData.control == source) then -- HAX kickPlayer(client); return false; end triggerClientEvent(source, "onClientControlMatrixUpdate", getRootElement(), matrix); end ); addEventHandler("onPlayerQuit", getRootElement(), function() local pData = playerData[source]; if (pData.control) then detachControl(pData.control); end if (pData.controlledBy) then detachControl(source); end end ); Feel free to expand it. I did not add a camera control for the controlled player, maybe you can do that.
  14. The_GTA

    Player Control

    Sigh, forget my attempt to help. I will give you some code when it is done.
  15. The_GTA

    Player Control

    I could use Resource Manager to show you the scripts I will give you. And I cannot test the script myself, eh.
  16. The_GTA

    Player Control

    If you join my server, I show you how to script it. -> MTA 1.1
  17. Well, yeah. Flobu took over once I had my build finished and sent it to Hankey, telling him to add the limits. But that is not the only thing they changed
  18. Pretty nice handling editor I can tell by looking at the screenshots. Keep up the good work! And I won't mind that MrHankey apparently forgot to credit me for the concept of the handling functions.
  19. I changed some graphical design and added the functionlist! Dictionary support is soon to come.
  20. New version is up, currently in beta stages. I just want to tell you guys that I am not gone and you should expect more feature critical releases in the 0.8.x version series
  21. Yeah, it uses the same access function, so if you do not want your vehicles to be edited, turn up the access level of your resource through ACL How to do that? Resource Manager handles access through ACL groups and their group inheritances. Simply add your resource to another 'group' node. You even could create a new group and give it a distinct ACL inheritance no other group has. I really don't know, did you try pressing F7 to view the ScriptEdit in the whole window?
  22. Okay, I did not know that resizing the "panes" was that important. I will add that to 0.8.0 And about your "Resources" suggestion. I put high value into flexibility, so I will try to add an alternative.
  23. Hey guys, Yes, it works in MTA 1.1 Hotfix: http://www.2shared.com/file/elbVNeMj/resedit.html This shall be the offical topic of the Resource Manager I am currently working on. https://community.multitheftauto.com/index.php?p=resources&s=details&id=1821 Instead of using the comment section, I ask you to give me suggestions on how to make the editor more user friendly. I plan the following features on the way to 1.0.0: Dictionary Support (register function names + description in resources 'dict.xml') Working Map Saving using object management Performance Critical colored comments Serverside Preferences Script Sessions Resource File Management ('Show Files') DirectX Elements drawing system Multi script session support Right-click menu DirectX XML editor Server Control Panel ... Please help me with this project. Any questions? Post them here. The_GTA
  24. Whatever, as you want me to post into this topic I do so. Hmm, you are mixing the clientside instance with the serverside instance. The reason your code doesnt work is that it never gets called. "onClientRender" does not exist serverside. I assume "getVehicle" is your own function somewhere, I never saw this function before in the MTA docu pages. Before you want to check something you need to think about when the value will change which you want to retrive. You are trying to retrive damage of a car, when the health reaches under 350 you mark it as "exploded", according to your "mission output". There is a event which gets triggered at vehicle damage, "onVehicleDamage"... So you want to check the health, when it reaches a specific value serverside... addEventHandler("onVehicleDamage", missionVehicle, function(loss) local vehicleHealth=getElementHealth(source); if (vehicleHealth<=350) then print("Your vehicle exploded, you fail."); -- Put some handler code here end end ); A scope... I know you dont get that word Thats why you made the "uggly" getVehicle function call. To make code be more viewable... I show you a example on how to save your mission vehicle local missionVehicle=false; function createMissionVehicle() missionVehicle=createVehicle(...); addEventHandler("onVehicleDamage", missionVehicle, function(loss) [...] end ); return true; end You notice the first line, this line was set to know that there is a variable called "missionVehicle". I often do this in my code, I set a overview of "everything" in the "headerzone", the headerzone is the zone before "executable code", every function got a headerzone, and all lua "scopes" are function level. What the [...] is? I guess its self-explanatory, you put the code from above in there, or any of your own handler code. The event "onVehicleDamage" gets triggered, whenever your mission vehicle gets damaged. Dont know if the vehicle health is updated already, or if they let you cancel the event to not make it do any damage, just retrive the health of the vehicle and you should be fine I guess... lol. If you want more details about the event, go into the development docu and look for the serverside event "onVehicleDamage". I hope you could follow me, in any way, haha If not, feel free to ask questions.
×
×
  • Create New...