Jump to content

XetaQuake

Members
  • Posts

    561
  • Joined

  • Last visited

Everything posted by XetaQuake

  1. I think you need to remove the maths and the "depth" Oh well - i hope you release it
  2. Hi I tested it now. Unfortunately, it doesn´t work too. setElementData works, but, not realy. /msave function: function saveObjID ( player, cmd ) if playerobj[player] then for i=0,maxobjects do if objectid[i] == playerobj[player] then if marker[player] then destroyElement(marker[player]) end local numstr = tostring(i) outputChatBox ( "Object saved as ID: " ..numstr.. "", player ) playerobj[player] = nil break elseif objectid[i] then --do nothing else creator = player creatorNick = getClientName ( player ) creatorUser = getAccountName ( getClientAccount ( player ) ) setElementData ( creator, "creatorUserSave", creatorUser ) setElementData ( creator, "creatorNickSave", creatorNick ) objectid[i] = playerobj[player] if marker[player] then destroyElement(marker[player]) end local numstr = tostring(i) outputChatBox ( "Object saved as ID: " ..numstr.. "", player ) playerobj[player] = nil break end end else outputChatBox ( "No object selected to be saved.", player ) end end addCommandHandler( "msave", saveObjID ) /savemap function: function saveThisMap ( player, cmd, mapname ) if mapname then local madeFile = fileCreate("" ..mapname.. ".o23") -- attempt to create a new file fileWrite(madeFile, "--File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! \r\n \r\n") for i=0,maxobjects do if objectid[i] then local model = getObjectModel (objectid[i]) local x, y, z = getElementPosition(objectid[i]) local rx, ry, rz = getObjectRotation(objectid[i]) local creatorUserLoad = getElementData ( creator, "creatorUserSave" ) local creatorNickLoad = getElementData ( creator, "creatorNickSave" ) fileWrite (madeFile, "objectid[" ..i.. "] [user: " .. creatorUserLoad .. " ] [Nick: " .. creatorNickLoad .. " ] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") end end outputChatBox ( "Map saved as: " ..mapname.. "", player ) fileClose ( madeFile ) else outputChatBox ( "No map name specified. Please use /savemap <name>", player ) end end addCommandHandler( "savemap", saveThisMap ) It saves all objects under the same player: The player who finaly saves the map. So it looks like this: Three objects are not created by me, but i saved the map using /savemap - and now stands my name on all objects Any ideas pleas?
  3. Server side ban basis on the hardware? For example the MAC Not possible to change it, until you change your harware - because of a ban
  4. I doesn´t know what do you mean exacly. But the idea is good, i tried it, but it doesn´t work. I added the element data to the function that gets fired with /msave, and loaded them in the /savemap function to get and save the player account-name in the file. setElementData (line 15, 16, 17 are new): function saveObjID ( player, cmd ) if playerobj[player] then for i=0,maxobjects do if objectid[i] == playerobj[player] then if marker[player] then destroyElement(marker[player]) end local numstr = tostring(i) outputChatBox ( "Object saved as ID: " ..numstr.. "", player ) playerobj[player] = nil break elseif objectid[i] then --do nothing else creator = player creatorUser = getAccountName ( getClientAccount ( player ) ) setElementData ( creator, creatorUser, true ) objectid[i] = playerobj[player] if marker[player] then destroyElement(marker[player]) end local numstr = tostring(i) outputChatBox ( "Object saved as ID: " ..numstr.. "", player ) playerobj[player] = nil break end end else outputChatBox ( "No object selected to be saved.", player ) end end addCommandHandler( "msave", saveObjID ) getElementData (line 12 are new, 13 are modified): function saveThisMap ( player, cmd, mapname ) if mapname then local madeFile = fileCreate("" ..mapname.. ".o23") -- attempt to create a new file fileWrite(madeFile, "--File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! \r\n \r\n") for i=0,maxobjects do if objectid[i] then local model = getObjectModel (objectid[i]) local x, y, z = getElementPosition(objectid[i]) local rx, ry, rz = getObjectRotation(objectid[i]) local creatorUserLoad = getElementData ( creator, creatorUser ) fileWrite (madeFile, "objectid[" ..i.. "] [user: " .. creatorUserLoad .. " ] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") end end outputChatBox ( "Map saved as: " ..mapname.. "", player ) fileClose ( madeFile ) else outputChatBox ( "No map name specified. Please use /savemap <name>", player ) end end addCommandHandler( "savemap", saveThisMap ) And i get this error: http://d.imagehost.org/view/0604/error.png I don´t want to upload the complete script on pastebin, because its not my script and i don´t know what OffRoader23 would think about it, so, just download the map-editor (I´m using version 1.3.0) when anybody want to see the whole script. Possible other users are interesting in this idea too (to save the nickname and username)?
  5. What? Work´s! (Its a exact copy from my map file) I already scripted it, but the Problem is, that the script writes the SAME Username and Nickname on every object - because it gets the Username and Nickname with the function to let /savemap working. Its difficult to explain, but, for example, when there three users who build a little bit around with the editor, and i saves it, there is writen my username and nickname on EVERY object - because i typed /savemap But i want to saves the usernames and nicknames for every single object, and not for the final user who saves the map.
  6. Hi all, i know this thread is rreeaallyy old, but i have a problem with a little modification. Currently i try´s to modify the editor a little bit, i want to save the Nickname and Account Name from the object creators in the map file. But i´m only able to save the Nickname and Account name from the user, wo have SAVES the MAP FILE, with /savemap I modifies this (see line 11 and 12, its new): function saveThisMap ( player, cmd, mapname ) if mapname then local madeFile = fileCreate("" ..mapname.. ".o23") -- attempt to create a new file fileWrite(madeFile, "--File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! \r\n \r\n") for i=0,maxobjects do if objectid[i] then local model = getObjectModel (objectid[i]) local x, y, z = getElementPosition(objectid[i]) local rx, ry, rz = getObjectRotation(objectid[i]) local creator = getClientName ( player ) local creatorUser = getAccountName ( getClientAccount ( player ) ) fileWrite (madeFile, "objectid[" ..i.. "] [user: " .. creatorUser .. " ] [Nick: " .. creator .. " ] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") end end outputChatBox ( "Map saved as: " ..mapname.. "", player ) fileClose ( madeFile ) else outputChatBox ( "No map name specified. Please use /savemap <name>", player ) end end addCommandHandler( "savemap", saveThisMap ) but - i think you can see it - this saves only the Player Name and Account Name from the person who has writen /savemap. But i want to save every single object along with the creator names, so it looks like this: Can anybody help me pleas
  7. And maybe you add a else, not sure but i think that can prevent warnings. XetaQuake //EDIT: add a local befor Player = getLocalPlayer()
  8. Oh, well, thanks LordAzamth Now i use: triggerClientEvent ( "invincible", invisiblePlayerSource, "allowed", invisiblePlayerSource ) But i have the same problem, anybody is invincible. And, anyway, for my eyes it looks a little bit stupid ^^ two times invisiblePlayerSource?
  9. Oh realy? Thats to bad! But thanks for answer Then i doesn't use setElementAlpha, i think i let the player glow - is also nice. But, pleas don´t forgot, this code snippet is only a LITTLE part from my script. Also the player who should getting invisible, should be get invincible. But: All players get invincible, but my script to set the player invincible is client-side: function setPlayerInvincible ( authorization ) if ( authorization == "allowed" ) then addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelEvent ) else ... end end So any damage get ignored. And i fire the client-side script using triggerClientEvent on "nextFunction": (this lines was not on the old post, because i thought i can get the answer with my invisible problem) function nextFunction( source ) setElementAlpha ( invisiblePlayerSource, 110 ) triggerClientEvent ( "invincible", invisiblePlayerSource, "allowed" ) outputChatBox ( invisiblePlayerName.." ist now invisible", getRootElement(), 255, 188, 178, true ) else end end But there is a similar problem: Anybody gets invincible - but WHY? I also tries it with source instead of invisiblePlayerSource (to answer Doomed_Space_Marine´s post), but its the same problem Ideas pleas?
  10. Hey, i have a strange problem, and its realy strange to explain it ^^ but i try it, and hope somebody can help me: When a player write a command, let´s say /test, then a triggerEvent launches. And now there comes the problem: triggerEvent fires a server-side function, to set the player invisible who has writen /test in the other function. But now all players get invisible, not only the player who has writen /test. Normaly, its easy to fix it when you use source or so, but the problem in my issue is, that not the source fires the function to set the player invisible - the triggerEvent is firing it. I hope you can understand it. Here is a little part of my code (translated in english and also cutted for this post): Function that starts when player writing /test on function testFunction ( source, command, status ) invisiblePlayerName = getClientName ( source ) invisiblePlayerSource = getPlayerFromNick ( invisiblePlayerName ) if ( status == "an" ) or ( status == "on" ) then setTimer ( triggerEvent, 30000, 1, "nowFireNextFunction", invisiblePlayerSource ) else outputChatBox ( "Pleas use ''/test on''", source, 201, 201, 244, true ) end end addCommandHandler ( "test", testFunction ) addEvent( "nowFireNextFunction", true ) addEventHandler ( "nowFireNextFunction", getRootElement(), nextFunction ) Function there get firing with triggerEvent on previous code function nextFunction( source ) setElementAlpha ( invisiblePlayerSource, 110 ) outputChatBox ( invisiblePlayerName.." ist now invisible", getRootElement(), 255, 188, 178, true ) else end end I hope you can help me, the problem is (i´m think so) that´s triggerEvent is not a source player, and so no source-player launches the second function - only triggerEvent. And so there´s no source player to set him invisible I would prefer to set the player invisible client-side (so i can use getLocalPlayer), but then its not synchronized Any tips for me? - Pleas XetaQuake
  11. It´s an Community resource, but nobody help us Gamesnert made realy good work with the engine, i scripts the design, whats now?! I think two peaple there scripts is a little bit to less for a COMMUNITY resource ... But yea...when there´s more persons there help us, its can going on
  12. Oh man, nobody haves a idea? I think its not possible to get the axis about a object, can pleas the team include functions for this in dp3, when its not possible? It's realy needed I am at my wit's end
  13. Thanks Gamesnert, i found a mistake in my server side script, now the player rotates around is own axis too ( ) Soooooo, the last and whole problem is to set the player rotating around the object´s axis! Oh well i thought already its anything with mathematic (...i hate it ) Its realy advanced lua stuff i think, i have not a hunch how it works at this time. Knows somebody how it works correctly?
  14. First: Thanks that you tried it for me, but i don´t understand it, my object haves elementdata "moving". See here: function tanker_1_go() ... ... ... setTimer ( moveObject, 1000, 1, tanker_1, 25000, tanker_1_waypoint_1_x, tanker_1_waypoint_1_y, transport1_z, 0, 0, tanker_1_waypoint_1_rz ) setTimer ( moveObject, 26000, 1, tanker_1, 6000, tanker_1_waypoint_2_x, tanker_1_waypoint_1_y, transport1_z, 0, 0, tanker_1_waypoint_2_rz ) setTimer ( moveObject, 31000, 1, tanker_1, 30000, tanker_1_waypoint_3_x, tanker_1_waypoint_3_y, transport1_z, 0, 0, tanker_1_waypoint_3_rz ) setElementData(tanker_1,"moving",true) end addCommandHandler ( "go", tanker_1_go ) hm, now thats realy weird, can do you send me your serverside script, so i can test it with the same script as you. The player rotates around is own axis? Oh well i thought that already, but its nice that he rotates Hopeful we get a working workaround-script for this problem. ideas to get the player rotating around the objects axis?
  15. Nobody knows whats wrong with this script? local localPlayer = getLocalPlayer() local lastRotation local root = getRootElement() addEventHandler("onClientRender",root, function() outputChatBox("A") local contactElement = getPlayerContactElement(localPlayer) if contactElement and getElementData(contactElement,"moving") and getElementType(contactElement) == "object" then outputChatBox("B") local a,a,z = getObjectRotation(contactElement) lastRotation = lastRotation or z local difference = z - lastRotation setPlayerRotation ( localPlayer, (getPlayerRotation(localPlayer) + difference)%360 ) lastRotation = z else outputChatBox("C") lastRotation = nil end end ) When i'm not touch the object, i get the output A and C (because of the outputChatBox in the script), and when i on the object, i get A and B - so it SHOULD work, but the player doesn´t rotates. So my Problem: setPlayerRotation in this script doesn´t work Any Ideas pleas?
  16. Note: And when i don´t touch the object, i get A and C, but i think thats normal. I doesn´t know whats %360 stands for, maybe any other peaple? Talidan? ^^ /EDIT: Oh, Ace_Gambit was faster - thanks for answer
  17. Hey there comes A and B in the same time So, its weird and there is something wrong ^^ Here is the ServerSide script, to set the elemtdata from the object: function tanker_1_go() ... ... ... setTimer ( moveObject, 1000, 1, tanker_1, 25000, tanker_1_waypoint_1_x, tanker_1_waypoint_1_y, transport1_z, 0, 0, tanker_1_waypoint_1_rz ) setTimer ( moveObject, 26000, 1, tanker_1, 6000, tanker_1_waypoint_2_x, tanker_1_waypoint_1_y, transport1_z, 0, 0, tanker_1_waypoint_2_rz ) setTimer ( moveObject, 31000, 1, tanker_1, 30000, tanker_1_waypoint_3_x, tanker_1_waypoint_3_y, transport1_z, 0, 0, tanker_1_waypoint_3_rz ) setElementData(tanker_1,"moving",true) end addCommandHandler ( "go", tanker_1_go ) Any ideas
  18. Hey Talidan, thanks for update Its still doesn´t work But! - the Warning is away There comes no warnings, no errors and no infos - nothing. (Script is running)
  19. No, i was on foot, same like the movie i posted, i makes the same way everytime: Flying with a Jetpack to the object, deaktivate the Jetpack 1 metre above the object and jump on it - now i am on it. So, there was no vehicle I doesn´t understand why this Warning comes, what's wrong with this script?
  20. Hey all. Thanks for all the Replays =) Talidan, i tries your new and nice code, but i get a WARNING and so it doesn´t works. Here a the Debugscript 3 warning message: This is Line 12: setPlayerRotation ( localPlayer, getPlayerRotation(localPlayer) + z ) Now the strange thing: why it doesn´t work? "localPlayer" should be correctly: local localPlayer = getLocalPlayer() Any ideas?
  21. Hey guys First: thanks for all the replays I tested Talidans great script. Here is a movie, pleas look it, so you understand the last problems. There are, as Gamesnert and Talidan already discuss it, two Problems. First: you are not able to run freely, because the rotation gets updated every time. Second: You rotate around your own axis, so you still fall down (see movie) I think its needed to set the rotation relatively to the object or so, but i don´t know how its possible to get a axis from an rotating object Any ideas? PS: I think Talidan has mentioned this problem in his last post, right?
  22. Are you crazy That should not so healthy for a Server moreover, 50 miliseconds are to slow to let it works smoothly Also i am not sure that´s the idea to rotate the player works, BECAUSE: The object is long, so, when it rotates and you stand on the end, you fall down. Now, when you just rotate the player, the player rotates around his own axis - and he still fall down.
  23. Yea but onClientRender is Client Side. And the Object that moves are Server-Side. I am not able to make a bright between it I understand Client side, i understand Server side - but not to use it together
  24. Can anyone help me pleas? I have a Idea, possible it works when i get the rotation of the object and add it to the player. But the Problem is that such a function can´t launches so many times...and stuff like "OnClientRender" are also not a perfect solution - also its Client-Side. Any ideas?
  25. The Problem: thats exactly what i don´t want, the player should be free in movement during the objects moves and rotates
×
×
  • Create New...