Jump to content

Salem

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by Salem

  1. I don't get it. I need these objects to be removed while playing map on the server, not in map editor. I create script to remove objects and add it to the zip file (with map) as 'oremover.lua' in the way like this: addEventHandler("onResourceStart", resourceRoot, function() removeWorldModel( 676, 60, 873, 1709, 7 ) removeWorldModel( 681, 60, 873, 1709, 7 ) removeWorldModel( 858, 60, 873, 1709, 7 ) removeWorldModel( 904, 60, 873, 1709, 7 ) .... end) addEventHandler("onResourceStop", resourceRoot, function() restoreAllWorldModels() end) And for these palms it doesn't work.
  2. Need some tip for removing special type of object from the main world. Namely, I have problem with these little sand palms (joshuas) to remove em using function removeWorldModel( ... ). Four models: 676, 681, 858, 904 included. Everything besides is ok. Who knows some working solution? Btw. they appear in game in quite different way and times than other objects.
  3. Salem

    [Race] Sal's maps

    Sorry for no pictures. There are now over 100 maps. Typical, but good, some are very racy. No modern effects, objects, but some newer include object remover. You can download one by one and see in map editor or on the hosted server.
  4. Hello. I've just uploaded all my maps created since 2009. Its racing maps only. Old stuff, typical races on the main SA map and several custom circuits. Who played on former Freelancers' Guild knows the topic. Since 2013 i used custom handling and nitro, but you can simply remove it from map file if don't like it. Newer maps include scripts with object remover which is needed to play projected map properly. Grab and enjoy. http://chomikuj.pl/salemander/mta+maps The account will be updating from time to time. Special thanks to my inspirators since I joined to mtasa (2008): msd, Dockinoke, King Bong, Wurstfinger, Apina, zole, Pierdek, SKC guys and many others.
  5. Salem

    GTA process affinity

    Thanks. I don't know what to say. It seems to be working, but the graph looks the same. While changing affinity it tries to keep the process on selected proc, but the second one also works for the process. Maybe it's a bit better. I don't know. It's probably 1 core disadvantage. I'm stupid after this effort to optimalize my old computer. Anyway, thanks!
  6. Tremendous. I've collected about 500 of your maps on my training server, but I can't find any with formula 1 track nor car. Have you ever done something like that? If no, do you know who is the creator of e.g. MTA version of spa-francorchamps? I'm asking because I'd like to get something and learn how to make it.
  7. Salem

    GTA process affinity

    No it doesn't. This is just another MTA update and works as usual.
  8. Salem

    GTA process affinity

    Ok. It's going in right direction. But still something is wrong. Computer tries to stay with 1st proc, but when usage of MTA exceeds 50% it of course tries to use the second. But why does he use 2nd proc while 1st isn't used in 100% (like in image ~90%). Moreover, this peak on the right is strange, and in game there was 30 second pause, when I had 1 fps . Until this event playing was not bad, but this happens so often. It's something wrong in the processors communication by core or graphics in my opinion. Anyway, thanks for your advice, I'll still try to find more suitable solution. Btw. Here is displayed 46% of total cpu usage, while it was 53% of total GTA usage, so this numbers are not so representative.
  9. Salem

    GTA process affinity

    Ok. I understood your approach. Everything seems promising, but while this warning dialog is displaying, there are no any gta exes in task manager and changing affinity of MTA.exe doesn't resolve my problem. After closing warning window gta exe appear, but, as you said, it's too late indeed.
  10. Salem

    GTA process affinity

    You don't understand me. I can set affinity of 'Multi Theft Auto.exe'. However, this doesn't change anything. I cannot change affinity of the GTA process. In my process list it's named 'proxy_sa.exe', some time earlier it was 'gtasa.exe', but it doesn't matter about the name.
  11. Salem

    GTA process affinity

    Thanks for the advice mate, but it didnt help. MTA diag checked it successfully. While MTA is working on 1 proc it's ok, but when system (during the game) decides to use another proc, the core time is dividing into (2) cores, and then something wrong follows (mainly, radical fps fall). So the problem lies in the core usage by processors. I don't know how it works, but when MTA is dividing, some other (system, etc.) applications take the core time and don't want to "give" it back, and only restarting the game clears up the situation. In my opinion the problem lies in bad communication between Pentium 4 processors, or bad drivers, maybe graphics later in game uses the core time more than is likely to do on the beginning, or it's game optimalization issue. It seems to be more complicated, but one is clear - everything works fine on 1 processor. I checked it by switching off permanently one proc, but it can be change on Windows restart only and is so frustratring, because using 1 proc instead of 2 in off-game applications is not comfortable.
  12. Salem

    GTA process affinity

    I've written above. Windows XP, built 2600. I try to change by many ways: in task manager, lasso processor app, by imagecfg.exe, but most promising way seems to be using bat file in similar way I start GTA alone. Namely, I created fie: proxy_sa.bat in the same directory as proxy_sa.exe. File includes text: /AFFINITY 0x1 proxy_sa.exe and GTA starts with one processor, but this not happens with GTA launched by MTA.
  13. Salem

    GTA process affinity

    and?? Has it changed anything? I can't see and feel any difference. Change affinity --> access denied
  14. Salem

    GTA process affinity

    Hi. I have the following problem with setting process affinity: Starting 'Multi Theft Auto.exe' there appear 'proxy_sa.exe' in my task manager (Win XP). This process starts on 2 cores, and changing it into 1 core doesn't take any effect due to unsufficient rights or something like this. (My proc - Pentium 4, 2 processors). I was trying to force it with many programs, but it's not working. So then I wanna ask, if you did something with similar problem? Someone know how to run proxy_sa.exe with 1 processor of any more? Maybe there's some way to start it via bat file, like is likely to do starting gta.exe alone? But here is more complicated issue. By the way, if someone would to know, and i know that someone would to, gta game ran on 2 processors (from mta) changes processors itself, after some time, and in procs like my, with one core, it dramatically slows down the game, because the core is then taken by other applications, e.g. system threats. So the only solution is to separate gta to 1 processor only.
  15. Thanks for some suggestions, I'll think about it. The code is too complicated to post. The problem lies probably in the time of executing very database complicated query in a loop of several iterations plus loops for searching properties of world's objects (which can be large number indeedly). So my intention is not to change the code but rather to have possibilities to resume / continue the heavy execution, as I have mentioned above, it's only one in a longer time. Anyway, thanks. By the way, what you mean with 'return' IIYAMA above? Executing every 1 second is useless, because the string of database queries is executing and I can't pause it. However i can try to pause in some loops.
  16. Hi. How can I disable aborting scripts on infinite/too long execution error, or maybe set longer time to executing? I have script which ends but it works about 10-20 seconds and it stops after few and I wish to not until I'll find better solution of the way its working. I know that such running script is lame but it run very rare and must be finished.
  17. Hell.o, any one know how to draw circle on the map (F11) with specified radius and central point, which should look like radar area or eventually circlering only? It would be useful for me to see some events' radius area.
  18. No, i've changed everything. Don't really know what's goin on. On script restart the objects disappear on a moment but are loaded again when the script restart is finished.
  19. As i said in the title i have problem with this function after update to 1.3.1 MTA version. The function doesn't remove object, but in previous version 1.3.0 it was working on the same code. Anyone has the same problem, or it's my case only? Additionally, no errors in the debuger.
  20. Salem

    bindKey Joypad

    thanks arezu, problem is solved
  21. Salem

    getGroundType

    Yes, everything is handled by client rendering, but it's not such a beast as i thought before (Pentium 4, 2x3GHz core). Script changes cars' handling only once while changing ground type, so maximaly, for example, once a second or twice. Some code: addEventHandler( "onClientPreRender", root, function ( ) --............................ -- this lower the speed if ( isVehicleOnGround( veh ) and getElementData( veh, 'handled' ) == true ) then if a_type > 0 then if ( a_type == 1 and speed > 100 ) then -- concrete setElementVelocity( veh, velX-velX/200, velY-velY/200, velZ ) elseif ( a_type == 2 and speed > 50 ) then -- gravel setElementVelocity( veh, velX-velX/75, velY-velY/75, velZ ) elseif ( a_type == 3 and speed > 25 ) then -- grass setElementVelocity( veh, velX-velX/50, velY-velY/50, velZ ) elseif ( a_type == 4 and speed > 50 ) then -- dirt setElementVelocity( veh, velX-velX/100, velY-velY/100, velZ ) elseif ( a_type == 5 and speed > 25 ) then -- sand setElementVelocity( veh, velX-velX/25, velY-velY/25, velZ ) elseif ( a_type == 7 and speed > 50 ) then -- wood setElementVelocity( veh, velX-velX/150, velY-velY/150, velZ ) elseif ( a_type == 10 and speed > 25 ) then -- vegetation setElementVelocity( veh, velX-velX/30, velY-velY/30, velZ ) elseif ( a_type == 11 and speed > 0 ) then -- water setElementVelocity( veh, velX-velX/10, velY-velY/10, velZ ) elseif ( a_type == 12 and speed > 50 ) then -- misc setElementVelocity( veh, velX-velX/125, velY-velY/125, velZ ) end; if a_change ~= a_type then local x = getSurfaceHandle( a_type ) setHandlingChanges( veh, x, true ) a_change = a_type end; else if a_change ~= a_type then setHandlingChanges( veh, _, false ) a_change = a_type; end; --setVehicleHandling( veh, "tractionMultiplier", a_traction ) -- --end; end; end; --..................................... local material = getMaterial( X0, Y0, Z0 ) if ( a_material ~= material ) then local a_text = ''; local m_type = 0; if material >= 0 then m_type = MATERIALS[material+1][2]; --outputChatBox( 'Material: '..MATERIALS[material+1][1]..', type: '..material_types[m_type+1]..' ('..m_type..'), ID: '..material ) -- output on surface change only a_text = 'TERRAIN: '..MATERIALS[material+1][1]..' [iD: '..material..'], type: '..material_types[m_type+1]..' [iD: '..m_type..']'; else if material == -1 then a_text = 'No ground!' elseif material == -2 then a_text = 'Has not collided' elseif material == -3 then a_text = 'Collided with created object (not world object)' elseif material == -4 then a_text = 'Unknown material' end; end ); end; guiSetText( guiGroundLabel, a_text ); --guiLabelSetColor( guiGroundLabel, 255 - math.ceil ( FPSCalc * FPSLimit ), math.ceil ( FPSCalc * FPSLimit ), 0 ) a_type = m_type; end; a_material = material; -- FUNCTIONS function getSurfaceHandle( type ) if type == 1 then return 1.2 -- concrete elseif type == 2 then return 1.25 -- gravel elseif type == 3 then return 2.5 -- grass elseif type == 4 then return 1.5 -- dirt elseif type == 5 then return 2 -- sand elseif type == 7 then return 1.75 -- wood elseif type == 10 then return 2.25 -- veget elseif type == 11 then return 2.75 -- water elseif type == 12 then return 1.1 -- misc else return 1 end; end; function getMaterial( x, y, z ) if x then local gz = getGroundPosition( x, y, z ) if not gz then --outputChatBox( 'No ground!' ) return -1 end local hit, _,_,_,ele,_,_,_,material = processLineOfSight( x,y,z, x,y,gz-10, true,false,false,true,false,true,true,true,localPlayer, true ) if not hit then --outputChatBox( 'Has not collided' ) return -2 end if ele then --outputChatBox( 'Collided with created object (not world object)' ) return -3 end if not material then --outputChatBox( 'Unknown material' ) return -4 else return material end else return 0 end; end; It's quite wierd, and that's not everything of course, but on the other hand it's easy. The server side is complete: ---------------------------- HANDLING TEST ---------------------------- addEventHandler( "onVehicleEnter", getRootElement(), function( player, seat ) --local hset = { }; if seat == 0 then if getElementData( source, 'handled' ) == false then local mv = getVehicleHandling( source )["maxVelocity"]; setVehicleHandling( source, "maxVelocity", mv*2 ); --local ea = getVehicleHandling( source )["engineAcceleration"]; --setVehicleHandling( source, "engineAcceleration", ea-ea*0.1 ); local ei = getVehicleHandling( source )["engineInertia"]; setVehicleHandling( source, "engineInertia", ei*5 ); local bd = getVehicleHandling( source )["brakeDeceleration"]; setVehicleHandling( source, "brakeDeceleration", bd-bd*0.25 ); local sl = getVehicleHandling( source )["steeringLock"]; setVehicleHandling( source, "steeringLock", sl-sl*0.2 ); local tl = getVehicleHandling( source )["tractionLoss"]; setVehicleHandling( source, "tractionLoss", tl-tl*0.3 ); local tr = getVehicleHandling( source )["tractionMultiplier"]; local s_tr = tr+tr*0.5; setVehicleHandling( source, "tractionMultiplier", s_tr ); -- using in dynamic handling local tm = getVehicleHandling( source )["turnMass"]; setVehicleHandling( source, "turnMass", tm*1.25 ); local m = getVehicleHandling( source )["mass"]; setVehicleHandling( source, "mass", m*1.2 ); local dc = getVehicleHandling( source )["dragCoeff"]; setVehicleHandling( source, "dragCoeff", dc*0.5 ); -- wtfs setVehicleHandling( source, "ABS", true ); setVehicleHandling( source, "headLight", 1 ); setVehicleHandling( source, "tailLight", 1 ); setElementData( source, 'handled', true ); -- send values setted setElementData( source, "s_tractionMultiplier", s_tr ); else local o_tr = getElementData( source, "s_tractionMultiplier" ); local g_tr = getVehicleHandling( source )["tractionMultiplier"]; if g_tr ~= o_tr then setVehicleHandling( source, "tractionMultiplier", o_tr ) end; end; outputChatBox( '* Handling: maxV='..string.format( '%d', getVehicleHandling( source )["maxVelocity"] )..', engAcc='..string.format( '%d', getVehicleHandling( source )["engineAcceleration"] )..', engIn='..string.format( '%d', getVehicleHandling( source )["engineInertia"] )..', brkDecc='..string.format( '%d', getVehicleHandling( source )["brakeDeceleration"] )..', steerL='..string.format( '%d', getVehicleHandling( source )["steeringLock"] ), player, 20, 200, 50 ); end; end ); addEvent( 'changeHandling', true ); addEventHandler( 'changeHandling', root, function( veh, x, state ) local y = getElementData( veh, "s_tractionMultiplier" ); if state == true then setVehicleHandling( veh, "tractionMultiplier", y/x ); --outputChatBox( '* tr = '..string.format( '%.2f', y/x ), source ); else setVehicleHandling( veh, "tractionMultiplier", y ); --outputChatBox( '* tr = '..string.format( '%.2f', y ), source ); end; end ); addCommandHandler( 'abs', function( player ) -- test - dunno if it works if isPedInVehicle( player ) then local veh = getPedOccupiedVehicle( player ); if getVehicleHandling( veh )[ "ABS" ] == true then setVehicleHandling( veh, "ABS", false ) outputChatBox( '* ABS turned off.', player, 150, 50, 50 ); else setVehicleHandling( veh, "ABS", true ) outputChatBox( '* ABS turned on.', player, 150, 50, 50 ); end; else outputChatBox( '* Be in vehicle.', player ); end; end ); And very important table (it's client side, but it can be probably server side also), just copied from wiki (materials): [materials.lua] material_types = { 'Default', 'Concrete', 'Gravel', 'Grass', 'Dirt', 'Sand', 'Glass', 'Wood', 'Metal', 'Stone', 'Vegetation', 'Water', 'Misc' }; --[0..12] MATERIALS = { --[0..178] [ 'Name', type ] { 'Default', 0 }, { 'Tarmac', 0 }, { 'Tarmac (fucked)', 0 }, { 'Tarmac (really fucked)', 0 }, { 'Pavement', 1 }, { 'Pavement (fucked)', 1 }, { 'Gravel', 2 }, { 'Concrete (fucked)', 1 }, { 'Painted Ground', 1 }, { 'Grass (short lush)', 3 }, { 'Grass (medium lush)', 3 }, { 'Grass (long lush)', 3 }, { 'Grass (short dry)', 3 }, { 'Grass (medium dry)', 3 }, { 'Grass (long dry)', 3 }, { 'Golf Grass (rough)', 3 }, { 'Golf Grass (smooth)', 3 }, { 'Steep Slidy Grass', 3 }, { 'Steep Cliff', 9 }, { 'Flower Bed', 4 }, { 'Meadow', 3 }, { 'Waste Ground', 4 }, { 'Woodland Ground', 4 }, { 'Vegetation', 10 }, { 'Mud (wet)', 4 }, { 'Mud (dry)', 4 }, { 'Dirt', 4 }, { 'Dirt Track', 4 }, { 'Sand (deep)', 5 }, { 'Sand (medium)', 5 }, { 'Sand (compact)', 5 }, { 'Sand (arid)', 5 }, { 'Sand (more)', 5 }, { 'Sand (beach)', 5 }, { 'Concrete (beach)', 1 }, { 'Rock (dry)', 9 }, { 'Rock (wet)', 9 }, { 'Rock (cliff)', 9 }, { 'Water (riverbed)', 11 }, { 'Water (shallow)', 11 }, { 'Corn Field', 4 }, { 'Hedge', 10 }, { 'Wood (crates)', 7 }, { 'Wood (solid)', 7 }, { 'Wood (thin)', 7 }, { 'Glass', 6 }, { 'Glass Windows (large)', 6 }, { 'Glass Windows (small)', 6 }, { 'Empty1', 12 }, { 'Empty2', 12 }, { 'Garage Door', 8 }, { 'Thick Metal Plate', 8 }, { 'Scaffold Pole', 8 }, { 'Lamp Post', 8 }, { 'Metal Gate', 8 }, { 'Metal Chain fence', 8 }, { 'Girder', 8 }, { 'Fire Hydrant', 8 }, { 'Container', 8 }, { 'News Vendor', 8 }, { 'Wheelbase', 12 }, { 'Cardboard Box', 12 }, { 'Ped', 12 }, { 'Car', 8 }, { 'Car (panel)', 8 }, { 'Car (moving component)', 8 }, { 'Transparent Cloth', 12 }, { 'Rubber', 12 }, { 'Plastic', 12 }, { 'Transparent Stone', 9 }, { 'Wood (bench)', 7 }, { 'Carpet', 12 }, { 'Floorboard', 7 }, { 'Stairs (wood)', 7 }, { 'Sand', 5 }, { 'Sand (dense)', 5 }, { 'Sand (arid)', 5 }, { 'Sand (compact)', 5 }, { 'Sand (rocky)', 5 }, { 'Sand (beach)', 5 }, { 'Grass (short)', 3 }, { 'Grass (meadow)', 3 }, { 'Grass (dry)', 3 }, { 'Woodland', 4 }, { 'Wood Dense', 4 }, { 'Roadside', 2 }, { 'Roadside Des', 5 }, { 'Flowerbed', 4 }, { 'Waste Ground', 4 }, { 'Concrete', 1 }, { 'Office Desk', 12 }, { '711 Shelf 1', 12 }, { '711 Shelf 2', 12 }, { '711 Shelf 3', 12 }, { 'Restuarant Table', 12 }, { 'Bar Table', 12 }, { 'Underwater (lush)', 5 }, { 'Underwater (barren)', 5 }, { 'Underwater (coral)', 5 }, { 'Underwater (deep)', 5 }, { 'Riverbed', 4 }, { 'Rubble', 2 }, { 'Bedroom Floor', 12 }, { 'Kitchen Floor', 12 }, { 'Livingroom Floor', 12 }, { 'corridor Floor', 12 }, { '711 Floor', 12 }, { 'Fast Food Floor', 12 }, { 'Skanky Floor', 12 }, { 'Mountain', 9 }, { 'Marsh', 4 }, { 'Bushy', 10 }, { 'Bushy (mix)', 10 }, { 'Bushy (dry)', 10 }, { 'Bushy (mid)', 10 }, { 'Grass (wee flowers)', 3 }, { 'Grass (dry tall)', 3 }, { 'Grass (lush tall)', 3 }, { 'Grass (green mix)', 3 }, { 'Grass (brown mix)', 3 }, { 'Grass (low)', 3 }, { 'Grass (rocky)', 3 }, { 'Grass (small trees)', 3 }, { 'Dirt (rocky)', 4 }, { 'Dirt (weeds)', 4 }, { 'Grass (weeds)', 3 }, { 'River Edge', 4 }, { 'Poolside', 1 }, { 'Forest (stumps)', 4 }, { 'Forest (sticks)', 4 }, { 'Forest (leaves)', 4 }, { 'Desert Rocks', 5 }, { 'Forest (dry)', 4 }, { 'Sparse Flowers', 4 }, { 'Building Site', 2 }, { 'Docklands', 1 }, { 'Industrial', 1 }, { 'Industrial Jetty', 1 }, { 'Concrete (litter)', 1 }, { 'Alley Rubbish', 1 }, { 'Junkyard Piles', 2 }, { 'Junkyard Ground', 4 }, { 'Dump', 4 }, { 'Cactus Dense', 5 }, { 'Airport Ground', 1 }, { 'Cornfield', 4 }, { 'Grass (light)', 3 }, { 'Grass (lighter)', 3 }, { 'Grass (lighter 2)', 3 }, { 'Grass (mid 1)', 3 }, { 'Grass (mid 2)', 3 }, { 'Grass (dark)', 3 }, { 'Grass (dark 2)', 3 }, { 'Grass (dirt mix)', 3 }, { 'Riverbed (stone)', 9 }, { 'Riverbed (shallow)', 4 }, { 'Riverbed (weeds)', 4 }, { 'Seaweed', 5 }, { 'Door', 12 }, { 'Plastic Barrier', 12 }, { 'Park Grass', 3 }, { 'Stairs (stone)', 9 }, { 'Stairs (metal)', 8 }, { 'Stairs (carpet)', 12 }, { 'Floor (metal)', 8 }, { 'Floor (concrete)', 1 }, { 'Bin Bag', 12 }, { 'Thin Metal Sheet', 8 }, { 'Metal Barrel', 8 }, { 'Plastic Cone', 12 }, { 'Plastic Dumpster', 12 }, { 'Metal Dumpster', 8 }, { 'Wood Picket Fence', 7 }, { 'Wood Slatted Fence', 7 }, { 'Wood Ranch Fence', 7 }, { 'Unbreakable Glass', 6 }, { 'Hay Bale', 12 }, { 'Gore', 12 }, { 'Rail Track', 12 } }; On the screen GUI shows actual surface (dunno if it's in this code above) and everything works fine. You can of course change these parameters which handle the preferences to get stronger or weaker forces, or add some others, and the performance is (for me) exactly the same as without this. It's nice fun, try something like this yourself Note that programming like this (a bit of chaos included) causes many bugs, and it's recomended to fight'em to have really good and deliberate results.
  22. Salem

    bindKey Joypad

    Jus wanna ask about usage the function bidKey according to joypad keys. There aren't any joypad keys in the keyTable. Can I add'em and how? Manual binding on bind tab in the main menu works for keys from 'joy1' to joy15', but this: bindKey ( player, "joy1", "down", someFunction ) doesn't. Any suggestions?
  23. Salem

    getGroundType

    Thanks guys, everything works perfectly. The new real handling doesn't allow to speeding throung the sand, decreases grip on grass, etc. Great. The files are so long, but I can paste some fragments if someone wants. Now, I'm going to do some tyres events, usage and damaging options. It could be helpful to know some states of wheels, I mean, for example, if the car loses the grip or not.
  24. Salem

    getGroundType

    Eh! I used these functions, but really cannot get any satisfying result. In following code: -- PLAYER COLIZION addEventHandler( 'onClientRender', getRootElement(), function( ) local px, py, pz = getElementPosition( me ); local hit, x, y, z, elementHit, nx, ny, nz, material, li, pi, worldID = processLineOfSight( px, py, 2, px, py, -1000, true, false, false, true, false, false, false, false, me, true ) if hit then if elementHit then outputChatBox( "Hit element: "..getElementType( elementHit )..", material: "..tostring( material )..", world ID: "..tostring( worldID ) ); end else --setTimer( outputChatBox, 10000, 0, "Nothing het." ); end end ); nothing happens. I was changing coordinates, parameters, using camera and screen coords, etc., but no effect. Function with getting collisions does work for vehicles and maybe some objects, but not world ones. Does anyone have an experience with this functions or have done something similar? I guess the Client must know the surface. He returns different sounds and other reactions. Also produces a bug in custom handling made by 'setVehicleHandling...' while driving on some kinds of sand, but it can be GTA problem, i don't know this so well.
×
×
  • Create New...