Jump to content

Feche1320

Members
  • Posts

    461
  • Joined

  • Last visited

Everything posted by Feche1320

  1. index startRotZ value 81.996459960938 index vehModel value 522 index startPosZ value 13 index startPosY value -1675.5 index vehHealth value table: 029B50C0 index posUpdRotZ value table: 029B65E8 index posUpdZ value table: 029BA560 index pKeyState value table: 03CB5CB8 index posUpdVelX value table: 03CC2BB0 index posUpdRotY value table: 03CC1770 index startRotY value 0 index posUpdX value table: 03CC0230 index startRotX value 0 index posUpdY value table: 03CA00C8 index posUpdRotX value table: 03CAA9B8 index startPosX value 2495.7998046875 index posUpdVelZ value table: 03CA71D8 index posUpdVelY value table: 03CA53A8 index pKey value table: 029BBA38 index pVeh value userdata: 00000D6D
  2. I already did a test.. client-side the table is OK, when I send it to the server is where the problem comes... I think that it's a MTA bug or something, but not the script.
  3. Server: g_Root = getRootElement() ACCURACY = 200 --200ms POS_UPDATE = 2500 --2500ms playTimer = nil tmpPosUpdCount = 1 pRecordingInfo = {} playbackSettings = { gPed = nil, gVeh = nil, vehModel = nil, lastTick = nil } addEvent("preparePlaybackForStart", true) addEventHandler("preparePlaybackForStart", g_Root, function(info) pRecordingInfo = info playbackSettings.gPed = createPed(264, pRecordingInfo.startPosX, pRecordingInfo.startPosY, pRecordingInfo.startPosZ) playbackSettings.gVeh = createVehicle(pRecordingInfo.vehModel, pRecordingInfo.startPosX, pRecordingInfo.startPosY, pRecordingInfo.startPosZ, pRecordingInfo.startRotX, pRecordingInfo.startRotY, pRecordingInfo.startRotZ) warpPedIntoVehicle(playbackSettings.gPed, playbackSettings.gVeh) createBlipAttachedTo(playbackSettings.gVeh, 0, 2.5, 255, 255, 0, 200) outputDebugString("[starting playback..]") playTimer = setTimer(startGhostPlayback, ACCURACY, 0) end ) function startGhostPlayback() if pRecordingInfo.pKey[tmpPosUpdCount] then triggerClientEvent("setControlState", g_Root, playbackSettings.gPed, pRecordingInfo.pKey[tmpPosUpdCount], pRecordingInfo.pKeyState[tmpPosUpdCount]) if not playbackSettings.lastTick then playbackSettings.lastTick = getTickCount() end if getTickCount() - playbackSettings.lastTick > POS_UPDATE then setElementPosition(playbackSettings.gVeh, pRecordingInfo.posUpdX[tmpPosUpdCount], pRecordingInfo.posUpdY[tmpPosUpdCount], pRecordingInfo.posUpdZ[tmpPosUpdCount]) setElementRotation(playbackSettings.gVeh, pRecordingInfo.posUpdRotX[tmpPosUpdCount], pRecordingInfo.posUpdRotY[tmpPosUpdCount], pRecordingInfo.posUpdRotZ[tmpPosUpdCount]) setElementVelocity(playbackSettings.gVeh, pRecordingInfo.posUpdVelX[tmpPosUpdCount], pRecordingInfo.posUpdVelY[tmpPosUpdCount], pRecordingInfo.posUpdVelZ[tmpPosUpdCount]) setElementHealth(playbackSettings.gVeh, pRecordingInfo.vehHealth[tmpPosUpdCount]) playbackSettings.lastTick = getTickCount() end tmpPosUpdCount = tmpPosUpdCount + 1 else killTimer(playTimer) tmpPosUpdCount = 1 pRecordingInfo = {} destroyElement(playbackSettings.gPed) destroyElement(playbackSettings.gVeh) outputChatBox"Finished!" end end Client: g_Root = getRootElement() g_Me = getLocalPlayer() keysTimer = nil ACCURACY = 200 --200ms POS_UPDATE = 2500 --2500ms lastKeysChecked = {} keysState = {} posTickUpd = nil keyNames = { "special_control_up", "special_control_down", "special_control_right", "special_control_left", "vehicle_look_right", "vehicle_look_left", "handbrake", "sub_mission", "horn", "brake_reverse", "accelerate", "steer_back", "steer_forward", "vehicle_right", "vehicle_left", "vehicle_secondary_fire", "vehicle_fire" } -- 17 local pRecordingInfo = { startPosX, startPosY, startPosZ, startRotX, startRotY, startRotZ, pVeh = nil, vehModel = nil, pKey = {}, pKeyState = {}, vehHealth = {}, posUpdX = {}, posUpdY = {}, posUpdZ = {}, posUpdRotX = {}, posUpdRotY = {}, posUpdRotZ = {}, posUpdVelX = {}, posUpdVelY = {}, posUpdVelZ = {} } addEvent("startRecording", true) addEvent("setControlState", true) addEventHandler("startRecording", g_Root, function() --resetRecordInfo() pRecordingInfo.pVeh = getPedOccupiedVehicle(g_Me) pRecordingInfo.startPosX, pRecordingInfo.startPosY, pRecordingInfo.startPosZ = getElementPosition(pRecordingInfo.pVeh) pRecordingInfo.startRotX, pRecordingInfo.startRotY, pRecordingInfo.startRotZ = getElementRotation(pRecordingInfo.pVeh) pRecordingInfo.vehModel = getElementModel(pRecordingInfo.pVeh) keysTimer = setTimer(recordKeys, ACCURACY, 0) outputDebugString("[Recording started]") end ) addEventHandler("setControlState", g_Root, function(ped, key, state) if key == "continue" or state == "continue" or key == "nothing" or state == "nothing" then else setPedControlState(ped, key, state) end end ) addEventHandler("onClientPlayerWasted", g_Root, function() resetRecordInfo() outputDebugString("[Recording stopped]") end ) function recordKeys() local veh = getPedOccupiedVehicle(g_Me) if veh then -- Got the hunter if getElementModel(veh) == 425 then if isTimer(keysTimer) then killTimer(keysTimer) end posTickUpd = nil lastKeysChecked = {} outputDebugString("[Recording finished]") return end -- Record the keys for i, k in ipairs(keyNames) do local state = getControlState(k) if state then if not lastKeysChecked[k] then table.insert(pRecordingInfo.pKey, k) table.insert(pRecordingInfo.pKeyState, state) lastKeysChecked[k] = true outputDebugString("getControlState key: " ..k.. " state: true") keysState[i] = nil else table.insert(pRecordingInfo.pKey, "continue") table.insert(pRecordingInfo.pKeyState, "continue") outputDebugString("getControlState key: " ..k.. " state: continue") end else if not state then if lastKeysChecked[k] then table.insert(pRecordingInfo.pKey, k) table.insert(pRecordingInfo.pKeyState, false) outputDebugString("getControlState key: " ..k.. " state: false") lastKeysChecked[k] = false else keysState[i] = true end end end end if getPressedKeys() == 17 then table.insert(pRecordingInfo.pKey, "nothing") table.insert(pRecordingInfo.pKeyState, "nothing") outputDebugString("getControlState key: nothing state: nothing") end -- Position update if not posTickUpd then posTickUpd = getTickCount() end if getTickCount() - posTickUpd > POS_UPDATE then local tmpX, tmpY, tmpZ = getElementPosition(veh) table.insert(pRecordingInfo.posUpdX, tmpX) table.insert(pRecordingInfo.posUpdY, tmpY) table.insert(pRecordingInfo.posUpdZ, tmpZ) tmpX, tmpY, tmpZ = getElementRotation(veh) table.insert(pRecordingInfo.posUpdRotX, tmpX) table.insert(pRecordingInfo.posUpdRotY, tmpY) table.insert(pRecordingInfo.posUpdRotZ, tmpZ) tmpX, tmpY, tmpZ = getElementVelocity(veh) table.insert(pRecordingInfo.posUpdVelX, tmpX) table.insert(pRecordingInfo.posUpdVelY, tmpY) table.insert(pRecordingInfo.posUpdVelZ, tmpZ) table.insert(pRecordingInfo.vehHealth, getElementHealth(veh)) posTickUpd = getTickCount() outputDebugString("[Pos update]") end else --resetRecordInfo() outputDebugString("[Error while recording, aborting..]", 0, 255, 0, 0) end end function resetRecordInfo() if isTimer(keysTimer) then killTimer(keysTimer) end pRecordingInfo = { startPosX, startPosY, startPosZ, startRotX, startRotY, startRotZ, pVeh = nil, vehModel = nil, pKey = {}, pKeyState = {}, posUpdX = {}, posUpdY = {}, posUpdZ = {}, posUpdRotX = {}, posUpdRotY = {}, posUpdRotZ = {}, posUpdVelX = {}, posUpdVelY = {}, posUpdVelZ = {}, vehHealth = {} } posTickUpd = nil lastKeysChecked = {} end function getPressedKeys() local count = 0 for i = 1, #keysState do if keysState[i] then count = count + 1 end end return count end addCommandHandler("asd", function() triggerServerEvent("preparePlaybackForStart", g_Root, pRecordingInfo) end ) addCommandHandler("data", function() local cc = 1 local second = 2500 setTimer( function() outputChatBox("Second " ..second.. " X: " ..pRecordingInfo.posUpdX[cc].. "Y: " ..pRecordingInfo.posUpdY[cc].. "Z: " ..pRecordingInfo.posUpdZ[cc]) second = second + 2500 cc = cc + 1 end , 2500, 0) end )
  4. Yes, I did check it, client side values are ok, the problem is when I send it to server side..
  5. Basicly, it's this: local tmpX, tmpY, tmpZ = getElementPosition(veh) table.insert(pRecordingInfo.posUpdX, tmpX) table.insert(pRecordingInfo.posUpdY, tmpY) table.insert(pRecordingInfo.posUpdZ, tmpZ) I get the vehicle position, and insert it to the table, after all that, I send the table to the server using 'triggerServerEvent'.
  6. Yes. table.insert(pRecordingInfo.posUpdX, tmpX)
  7. outputChatBox(pRecordingInfo.posUpdX[1]) -- Gives me a nil value, it should give me a X coordinate.
  8. Actually, I made that code here, that's why it had that typo.. This is the original code: addEventHandler("preparePlaybackForStart", g_Root, function(info) pRecordingInfo = info -- Here is where I set the information.. playbackSettings.gPed = createPed(264, pRecordingInfo.startPosX, pRecordingInfo.startPosY, pRecordingInfo.startPosZ) playbackSettings.gVeh = createVehicle(pRecordingInfo.vehModel, pRecordingInfo.startPosX, pRecordingInfo.startPosY, pRecordingInfo.startPosZ, pRecordingInfo.startRotX, pRecordingInfo.startRotY, pRecordingInfo.startRotZ) warpPedIntoVehicle(playbackSettings.gPed, playbackSettings.gVeh) createBlipAttachedTo(playbackSettings.gVeh, 0, 2.5, 255, 255, 0, 200) outputDebugString("[starting playback..]") playTimer = setTimer(startGhostPlayback, ACCURACY, 0) end )
  9. I am recording keys that player press client-side, but when I send the table to server-side using 'triggerServerEvent', It seems that it doesn't send all data.. Here is an example: local pRecordingInfo = { startPosX, startPosY, startPosZ, startRotX, startRotY, startRotZ, pVeh = nil, vehModel = nil, pKey = {}, pKeyState = {}, vehHealth = {}, posUpdX = {}, posUpdY = {}, posUpdZ = {}, posUpdRotX = {}, posUpdRotY = {}, posUpdRotZ = {}, posUpdVelX = {}, posUpdVelY = {}, posUpdVelZ = {} } -- Put all the info on each table, etc triggerServerEvent("sendPressedKeys", g_Root, pRecordingInfo) -- Server side table = nil addEvent("sendPressedKeys", true) addEventHandler("sendPressedKeys", g_Root, funtion(info) table = info end ) outputChatBox(table.startPosX) -- Works good outputChatBox(table.posUpdX[1]) -- Gives me a nil value So, whats the problem? Thanks
  10. THANK YOU FOR YOUR HUGE HELP! /sarcasm off I could help, if possible! But as it is not possible, try to give my simple opinion:] I believe that a new release almost every week is not the best thing to do! It precipitated the release of version 1.1, and 1.2 more ... better come and TAKE GOOD FAST and what you see ... DEFECTIVE since version 1.1 lost my FPS acceptable and I'm trying to get used to having no more than 45fps ... (looking down on maps "Race-Dm" I get amazing 15 FPS in heavier) I know that work for free and blablabla, so could take a little longer in updates and focus on fixing bugs (working for free of course would take longer to release new versions), optimize the game (parts that ultimately is what matters most to who plays), rather than to focus on new features (at this rate will create useless, do not create servers so do not dare say anything now) and new frills that ultimately may bring even more bugs ... 1.0.5 MTA miss that was lighter, simpler and more fun! (Old Times) wait about 5 months at least to the 1.4 release, if possible, it would be wise ... using a translator Check this http://bugs.mtasa.com/view.php?id=6732
  11. Is there any way to desync for the player all other players? I'm trying to make a FPS booster, but I don't see to suceed..
  12. http://bugs.mtasa.com/view.php?id=6826&nbn=18 They are on it, give them time
  13. Nevermind, fixed it, seems that server Linux r3795 was causing the crash.
  14. b7e91000-b7e92000 rw-p 00002000 08:02 94149286 /lib/libdl-2.12.1.so b7e92000-b7f71000 r-xp 00000000 08:02 94250033 /usr/lib/libstdc++.so.6.0.14 b7f71000-b7f75000 r--p 000de000 08:02 94250033 /usr/lib/libstdc++.so.6.0.14 b7f75000-b7f76000 rw-p 000e2000 08:02 94250033 /usr/lib/libstdc++.so.6.0.14 b7f76000-b7f7d000 rw-p b7f76000 00:00 0 b7f80000-b7f83000 rw-p b7f80000 00:00 0 b7f83000-b7f9f000 r-xp 00000000 08:02 94149269 /lib/ld-2.12.1.so b7f9f000-b7fa0000 r--p 0001b000 08:02 94149269 /lib/ld-2.12.1.so b7fa0000-b7fa1000 rw-p 0001c000 08:02 94149269 /lib/ld-2.12.1.so bfd69000-bfd7e000 rw-p 7ffffffe9000 00:00 0 [stack] Aborted That's all what it says and server closes.. what is it?
  15. What does inflict on RAM usage on a MTA server? Becouse I've seen that my server sometimes is using more RAM with less players than with more players.. For example, now it's using 558.8 MB, with 32 players. Yesterday with 24 players it was using almost 700 MB.
  16. But the MTA team could check twice before releasing, MTA 1.3 is worst than 1.2.. timeouts, crashes.. Also, I did help, never got a reply.. http://bugs.mtasa.com/view.php?id=6796 http://bugs.mtasa.com/view.php?id=6732
  17. You will still have to update for fixes.
  18. Nah 1.3 has terrific lags problem.. with 1.2 I can't download maps, and with 1.3 I keep getting random disconnections and massive lags.
  19. The second download is slower, it looks fast becouse HyperCam acelerates the video somehow..
  20. I've just noticed something, the first time that you connect to the server and download the map, the download is fast and smooth, here is a vid: https://www.youtube.com/watch?v=zFiplMHO1z4
  21. I do too, but atleast the download finishes MTA:SA 1.3 r3673 MTA:SA Server 1.3 r3672 But it's unplayable, to download a 1.30mb map it takes 2 - 5 minutes when with my internet connection I can download it in less than 30 seconds..
×
×
  • Create New...