• Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Salem

  • Rank


  • Gang

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  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 "" 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.
  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: Link: 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?