Jump to content

Salem

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by Salem

  1. Salem

    Editor help

    Thanks, but the problem is I don't want to reset my config. If I do so it works, but when I change some bind (even one) it either works as previous set or doesn't at all. It looks like some major bug as some kind of conflict between game binds, mta binds and/or editor binds. Don't have time to investigate so must work with some half-solutions. Maybe I should delete all hardcoded binds from script but it wouldn't be this.
  2. Hi. I have something like this: addCommandHandler( 'wrem', function( player, command, radius ) if radius then radius = tonumber( radius ) else radius = 10 end local t = false; local x,y,z = getElementPosition( player ) for i=500,20000 do t = removeWorldModel( i,radius, x, y, z ) if t == true then outputChatBox( "[WREM] First object found: model "..i..", radius "..radius, player ) break end end outputChatBox( "[WREM] Done.", player ) end ) This function should return first met object but it returns true for every iteration. I want to ask someone who really knows what's up - who knows how to find and call, for example, function used in editor which returns world object on click. I didn't study that code yet, so if someone can give some hint will be appreciated.
  3. Salem

    Editor help

    I tried. Still no response. Only movement doesn't work.
  4. Salem

    Editor help

    I've updated the MTA. Could anyone tell me why I can't move camera in map editor? Everything else seems to work. I restared few times, changed binds, whatever, but this ersatz don't want to cooperate.
  5. Thanks for this suggestion - it's probably the only way to do this, so I did as follows: function to check is target on via camera: function isTargetingActivated( ) local slot = getPedWeaponSlot( me ) if getPedWeapon( me, slot ) == 43 then outputDebugString( "you have camera dude" ) return true else outputDebugString( "wrong tool dude" ) return false end end addEventHandler( "onClientPlayerTarget", getRootElement(), isTargetingActivated ) and to release the cilium: function tryMakePhoto( button, press ) if ( button == "mouse1" ) then if ( press ) then outputChatBox( " Set proper cilium to make well photographs.", 100, 160, 200 ) --sns = getTickCount() else -- when released if photojob == true then if isTargetingActivated( ) then outputDebugString( " Target Activated." ) triggerServerEvent( "sendScreenShot", getLocalPlayer(), scrX, scrY ); --local cilium = sns - getTickCount() outputChatBox( " You made a photo. View gallery how it's like.", 100, 120, 200 ) else outputDebugString( " Target de-Activated." ) end end end end end addEventHandler( "onClientKey", getRootElement(), tryMakePhoto ) Photos are much better. You decide when to release the "bird" but still a major issue remains: how to get rid of camera target on its lens?? If I press fire button it disappears but is still on photos. Any ideas? It's funny, because if you release target button before the cilium you got selfie (from behind) =)
  6. How to get the only one weapon I currently use? This function returns all weapons I have in all slots. Ok, found it: int getPedWeaponSlot ( ped thePed )
  7. Do you know how to get names of functions. There are numbers like objects data. The letter keys are not returned. I mean, I need a list like in menu -> binds. This function is promising but doesn't work for me. I mean, I'm asking because want to use something like this: function playerPressedKey( button, press ) local boundKey = getKeyBoundToFunction( 'horn' ); if button == boundKey then if ( press ) then ACTION = false outputDebugString( "You pressed the "..button.." key!" ) end end end addEventHandler( "onClientKey", root, playerPressedKey ) which should work that way - I use horn to speed up ped's slow walking on the street. But don't know where's horn binded.
  8. So I guess this starting event doesn't work properly. I think I haven't got any instead. However, On wiki is written: OnClientPlayerWeaponFire This event is called when a player fires a weapon. This does not trigger for projectiles, melee weapons, or camera. But in my case it triggers the camera but probably after the clip. So that's why the images are not sharp. Any ideas?
  9. Thanks for replying. Honestly, my last solution works. The only error was (which I didn't visualize) in getRealDateTimeNowString function. It had : characters in string. Now it's ok. I've corrected typo and changed fileWrite( newFile, pixels ) The file is written to local resource. local newFile = fileCreate( iname..".jpg" ) Now, the problem is the jpegs are horrible comparing with manual screenshots. The camerea targets are on and flash glows the screen. It seems like trigger is too late. I can't set up timer with negative values.
  10. I'm trying to save it directly: addEvent( "onPlayerScreenShot", true ) addEventHandler ( "onPlayerScreenShot", getRootElement(), function( theResource, status, pixels, timestamp, tag ) if status == "ok" then local iname = tag.."_"..getRealDateTimeNowString(); outputDebugString( "[IMAGE] "..iname ) local newFile = fileCreate( "e:/"..iname..".jpg" ) -- attempt to create a new file if ( newFile ) then -- check if the creation succeeded fileWrite( newFile, "This is a test file!" ) -- write a text line fileClose( newFile ) -- close the file once you're done with it outputDebugString( "[IMAGE] saved." ) else outputDebugString( "[IMAGE] not saved." ) end else outputDebugString( "Image failed by "..tag.." at "..getRealDateTimeNowString() ) end end ); but error 'image not saved' appears.
  11. Hi. I try to save screenshot on disk taken by player. Following the only wiki help I have below functions. on client: addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), function( weapon, _, _, _, _, _, element ) if ( weapon == 43 ) then -- camera triggerServerEvent( "sendScreenShot", getLocalPlayer(), scrX, scrY ); end end ); it's ok, sends data to the server, but: addEvent( "sendScreenShot", true ) addEventHandler ( "sendScreenShot", getRootElement(), function( scrX, scrY ) local name = getPlayerName( source ) takePlayerScreenShot( source, scrX, scrY, name, 30 ); outputDebugString( "image taken by "..name.." of "..scrX.."x"..scrY ) end ); addEvent( "OnPlayerScreenShot", true ) addEventHandler ( "OnPlayerScreenShot", getRootElement(), function( theResource, status, pixels, timestamp, tag ) if status == "ok" then outputDebugString( "image taken by "..tag ) outputDebugString( "at "..tostring(timestamp).." with "..pixels.." size" ) local name = tag.."_"..timestamp; else outputDebugString( "image failed by "..tag.." at "..tostring(ts) ) end end ); And everything passes ok. Now I have some data and the image (I guess). My question is: how to save it on disk as JPEG? What functions should I use? I guess, I need to use FileCreate and dxDrawImage but how to use it together?
  12. Fixed some resolution problem. http://www7.zippyshare.com/v/yKhIPo3L/file.html
  13. Hi. I've done little game. It's not GTA mirror but very simplistic simulator. I guess it's playable (for me surely) so enjoy if you want. Just couldn't find anything like this. Read the guide for some info. (I can't login to mta resources so post it here) Image: https://imgur.com/a/sMaEg Link: http://www118.zippyshare.com/v/bTtCDMtX/file.html Merry Christmas!
  14. I don't understand why ped[1][1] works if it's in one place (like in code above) but doesn't when calling from other function (nor ped[1] doesn't). the table is global variable in server-side script and I've used such approach earlier in my scripts and it was ok, but here is not. I really don't know what gremlin is in my code. It looks like initializing this table ( taxidf = { { } } ) in one function doesn't save it on global scope. But in all previous scripts it was ok. The only difference here is that I put objects inside not values. Can it be a bug? What kind? Maybe I have some baby mistake?
  15. Haha, You haven't read carefully Lopsided_ - ped[0] is null. But I've found partially the solution: how to kill the ped ped = createPed( tonumber( id ), x, y, z) table.insert( taxidf[player].ped, { ped } ) x = taxidf[player].ped; setTimer( killPed, 6000, 1, x[1][1] ) Couldn't believe ped[1][1] was the solution. So it works if its in one place. Not, if it's in other functions. It didn't help why I had null in further stage of my script but it's out of scope here, I mean it's not connected with tables themselves.
  16. Thanks for reply. It's no point to paste 400+ lines of code, I guess I was clear with this snippets. As you say, ped[1] should be something - I got null. If you can help me please reproduce this and say have you got back the element.
  17. Hi. I have some issue and can't really deal with it. I have a table: declaration, initialization... local taxidf = { { } }; taxidf[player] = { player = getPlayerName(player), ped = {}, blip = {}, mark = {}, endblip = {}, endmark = {} }; Then to this table I put some values (one of them is below): local ped = createPed( tonumber( id ), DTM_PTS[startPoint][2], DTM_PTS[startPoint][3], DTM_PTS[startPoint][4] + 0.5 ) table.insert( taxidf[player].ped, { ped } ) No matter what's in these DMTs - I need to sketch the problem... Ped is created indeed. And when I want to receive the data later: I get local ped = taxidf[player].ped; I got a message the table length is 1 but table is nil. So I have a question: how should I take the object from this table? What am I doing wrong? To visualize the output I : outputDebugString("ped : "..tostring(ped)..", len: "..tostring(#ped)..", "..tostring(ped[0])..", "..tostring(ped[1]) ); results: `ped: table : 0af4gf3t len : 0, nil, nil` So ped[0] is null, ped is a table.... what to deal with it?? I just want to have back the object in the exact way I do this. Please some suggestions. My target is to: setTimer( killPed, 60, 1, ped ) --- error: [expected element at arg.1, got table] or setTimer( killPed, 60, 1, ped[1] ) --- error: [expected element at arg.1, got nil] you understand... I can't kill this ped!
  18. I like your maps. Some are really excellent quality and, what's most important, so racy. I still play this game very sometimes, but it's still good with best maps. I'd like to map sometimes but have terrible issues with map editor. Which one do you use? Can you run old mtasarace_v1.1.2 on Win 7? Cheers.
  19. Can't use this editor honestly. Anyone know how to run old mtasarace_v1.1.2 on Windows 7? I could use VM but this wastes so much disk space for system, another GTA:SA copy plus some memory declaration. Damn it!
  20. I can't find nitro and repairs on pickups list. What's going on??
  21. Hi. I've just started using the Map Editor and after installation loaded a map. But I've encountered a problem while trying to move the camera. Only 'a' and 'd' keys work but 'w' and 's' don't. What's wrong? Just installed newest version. Anyway, using 'w', 's', etc. is not comfortable and I'd like to change it on arrows. Please, give me some hints because couldn't find any help on web. Those tutorials are already one step forward. There's another annoying thing: I can move camera using pad (mouse) left button but forward only, not backward, and this is kind of mess because it selects every encountered object. Please I need quick help because can't make maps. Cheers.
  22. I like your new maps. You're getting better and better. Small tip: try to hide checkpoints. Make corners to be takeable without em. That's only my preposition for optimalizing circuit maps
  23. Dupa. This also didn't work. And adding these objects to map: also doesn't work. Can't find any other models of these objects. This should work in my opinion. These methods are good for any other objects I used to date.
  24. Yep. Why couldn't be sure? Tested it in many places, not also of this mentioned above. If there's some error in my script it could be different model number of identical object, I'll check it oyt, but these objects look like being loaded client-side. Hmm. Ok, I'll try to use it client-side.
×
×
  • Create New...