Jump to content

Solstice.

Members
  • Posts

    42
  • Joined

  • Last visited

Details

  • Location
    South Africa, Cape Town

Recent Profile Visitors

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

Solstice.'s Achievements

Rat

Rat (9/54)

0

Reputation

  1. for _, cars in ipairs( getElementsByType( "vehicle" ) ) do if getElementData( cars, "mapeditor" ) == 1 then respawnVehicle( cars ) end end Add elementdata in the spawn function for normal vehicles to distinguish.
  2. The benefit of the script is being able to just load a .map file with a command instead of having to plow through the XML adding the LODs manually.
  3. I added a loop to try and get the LOD and it doesn't get a LOD. local result3 = exports.sql:query_assoc( "SELECT * FROM remove_objects WHERE mapID = " .. data.mapID .. " ORDER BY objectID ASC" ) if result3 then for k, value in ipairs( result3 ) do removeWorldModel( value.model, value.radius, value.x, value.y, value.z ) --outputChatBox( LOD_MAP[ tonumber(value.model) ) --removeWorldModel( LOD_MAP[ tonumber(value.model) ], value.radius, value.x, value.y, value.z ) for _, objs in ipairs( getElementsByType( "removeWorldObject" ) ) do if getElementModel( objs ) == value.model then local LOD = getLowLODElement( objs ) if LOD then outputServerLog("bitch") local LODID = getElementModel( LOD ) removeWorldModel( LODID, value.radius, value.x, value.y, value.z ) end end end end end
  4. Make a loop that sums up the ammo of the same type.
  5. I don't have the LOD model of the buildings I'm trying to remove. I copied the LOD_MAP table from mapEditorScriptingExtension_s. On instance the element model of the object I'm trying to remove is 5408 (the nightclub in singleplayer) but that model isn't in there, as with the gas station in Idlewood. I was thinking of trying to use getLowLODElement but I'm not sure how to acquire the parent element I'm removing that the LOD is attached to.
  6. I'm loading XML nodes from a .map file to load maps into a server. I'm trying to add removeWorldObject nodes but for some buildings the LOD element is still there. I tried to use setOcclusionsEnabled but it's not working. Is there a way to find a work around? I was thinking of using getLowLODElement but I'm not sure how to get the world element from the model ID. I tried using the LOD_MAP from the scripting extension but it doesn't seem to work either. for k, value in ipairs( result3 ) do removeWorldModel( value.model, value.radius, value.x, value.y, value.z ) removeWorldModel( LOD_MAP[ tonumber(value.model) ], value.radius, value.x, value.y, value.z ) end
  7. One of the parameters for onPlayerWasted is the killer.
  8. Make it so you can only press the button once in a while. Use toggleControl and setTimer to re-enable..
  9. http://www.lua.org/pil/2.5.html blips = { } -- Defines a table called 'blips' with no elements in it. function consoleCreateObject ( thePlayer, commandName, id ) if ( thePlayer ) then teamElement = getPlayerTeam( thePlayer ) if getTeamName(teamElement) == "Camorra" then local x, y, z = getElementPosition ( thePlayer ) local object = createObject ( tonumber(id), x, y, z, 0, 0, 0 ) -- You want it to be local so you can only use the variable in this function. table.insert( blips, object ) -- Insert the object into a table here. Read more on the LUA programming reference about tables. if ( object ) then outputChatBox ( "Created Your Camorra group object",thePlayer,0,255,0, false ) else if not ( object ) then outputChatBox ( "Error Wrong Element ID",thePlayer,255,0,0, false ) else if getTeamName(teamElement) ~= "Camorra" then outputChatBox ( "You have to be in Camorra group to use this command",thePlayer,255,0,0, false ) end end end end end end function destroyEverything( ) for key, object in ipairs( blips ) do -- We loop through the entire blips table.. destroyElement( object ) -- ..and destroy all objects. end end addCommandHandler( "destroyobjects", getRootElement( ), destroyEverything ) Script is untested.
  10. Solstice.

    Radar

    You need to draw a smaller image section. If your map is 6000 x 6000 then the player position can be an exact pixel. local x, y, z = getElementPosition( getLocalPlayer( ) ) local sx, sy = guiGetScreenSize( ) local radarWidth = 250 local radarHeight = 250 dxDrawImageSection ( sx/2 - radarWidth/2, sy/2 - radarHeight/2, radarWidth, radarHeight, x - mapWidth / 2,y - mapWidth / 2, 250, 250, "map.jpg" )
  11. Basically this. When the resource starts or a player joins the server it puts all data in a table. You can create a timer to update the MySQL database every 30 minutes. Make a function for the updating then call that function every 30 minutes for all players using setTimer. And onPlayerQuit would trigger the update for that player aswell.
  12. Just look for the function that spawns the zombie, and add the setElementDimension function in it. So if the variable that specifies the zombie spawned is "zombie" then you add a line in that function: setElementDimension( zombie, 2 )
  13. I barely modified the players resource and sql is left untouched. Idk if you're running it with multiple people on the server. The lag is only noticable when you have around ten people on it, and more causes more and heavier lagspikes. I'll try running a clean paradise mod and see what happens.
  14. Hello, Working on a small RP gamemode for me and some friends using MTA paradise. Thing is server performance is just horrid. There's a lot of lag. The host is perfectly fine though. I first thought it was an issue with the MySQL server but it's on the same server, so this can't be it. I get CPU spikes on the sql and players resource, and sometimes the vehicles resource. I have bandwidth reduction disabled and bullet sync is enabled in the configuration files. IPB Warning: sql is using 206% CPU IPB Warning: vehicles is using 156% CPU IPB Warning: players is using 84% CPU There's two events, CallIdle1 and CallIdle2, that seem to trigger every minute and cause a lagspike, but I'm not sure where to find these events. I don't think they're part of the paradise gamemode but it's all I'm running. I've checked all paradise documents for an event with this name but it doesn't exist. 15:52:41.433 - Started timing checkpoints [Ver:1.3.5-9.06162] [Date:2014-03-01] 15:52:53.788 - >Detected slow frame: 854ms (Prev frame was 5ms) (Game time 00:00) 15:52:53.789 - Frame slow points: [CorePostFrame2 847ms (calls:1)] [OnPresent2 6ms (calls:1)] 15:52:56.306 - >Detected slow frame: 1800ms (Prev frame was 2ms) (Game time 12:00) 15:52:56.311 - Frame slow points: [CallIdle1 118ms (calls:1)] [CGame_Process 112ms (calls:1)] [CClientGame::DoPulses 62ms (calls:1)] [NetPulse 62ms (calls:1)] 15:53:02.076 - >Detected slow frame: 128ms (Prev frame was 1ms) (Game time 09:51) 15:53:02.076 - Frame slow points: [CallIdle2 127ms (calls:1)] [CClientGame::DoPulses 127ms (calls:1)] [NetPulse 126ms (calls:1)] 15:53:02.157 - >Detected slow frame: 54ms (Prev frame was 1ms) (Game time 09:51) 15:53:02.157 - Frame slow points: [CallIdle2 53ms (calls:1)] [CClientGame::DoPulses 53ms (calls:1)] [NetPulse 52ms (calls:1)] [pcall 11ms (calls:60)] How do I fix this lag?
×
×
  • Create New...