Jump to content

Solstice.

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Solstice.

  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?
  15. Solstice.

    loop

    You'll probably use it because it eliminates redundancy. myonlake's example is good. You can also use it to trigger certain functions on numerous objects instead of having to call the functions on each object individually. It helps to give structure to your code and saves space.
  16. MySQL because it's more universal.
  17. Get the vital features such as an account system, inventory system, asset ownership and interiors in general and so forth. Get some of the core features the VG script has to par with their standards. Think about redundancy. Make export functions you can re-use. It'll save you a lot of work. You don't really need anything special because nobody cares about it anyway. Announce your script only when it's near-done or people might get hyped up and get disappointed. But not sure if a project of this size would be really worth it at this point in time, though that's probably not what you want to hear. If you want to go from scratch alone, be ready to put months of work into it. Best of luck!
  18. Making a script from scratch for roleplay is simply not rewarding which is why people don't do it. It's just a matter of who gets to be the biggest controversial bad-boy server owner. Just look at all the servers with the stolen resources. They're the ones with players. The players simply don't care. Not to mention whatever remains of the roleplay community in MTA is below mediocre. It's all gone bad. That's why all the decent developers abandoned even trying.
  19. *Coughs* *Coughs* Choking.... Hold on... *Coughs* Errr.... right... phew... did I just see you wanting to run someone's else server ? Arsenic closed down because the lack of players and some hosting issues... but geez.... what do you get from hosting someone's else hard work ? And to being with... the Owner of Arsenic didn't make his resources "Public" so you actually have a leaked version. Therefore.... sitting here wandering what the hell you expect in the outcome is really bothering me... I mean look m8... its simple. Make your OWN .lua coding and maybe.. you would be successful in the field of Roleplay. Implying succes in roleplay servers is not a popularity contest but is dependent on how original your script is.
  20. I can't seem to understand how despite all the promoting a lot of decent roleplay servers go unnoticed. We always see the weekly vG rip-offs come and go but as far as I'm concerned there's still Aria (so much for advertising my own server) and Kinetic and a bunch of other servers. Probably because all them servers get bumped because rather than patting the rewarding projects on their back people would rather start a flame war for the sake of rewarding them with negative attention. It's either you're all blind or provide bad for an excuse to justify the temptation to lead your own community. God, the roleplay community in MTA is this twisting void of blatant ignorance moving in a vicious circle and destroying everything in its path. uG was ripped apart by its legal owner and some of his mates jumped along on the failboat. It may rise up again but the quality will remain bad as is until the man comes around for what they did to rG. If your eye for quality is that, then for the love of god just reconsider setting an example for roleplay by leading your own. Not to mention the things the owners get away with; the same things a chubby basement dweller got his ass whipped for not too long ago. Advice per request: MTA doesn't need yet another roleplay server as competition is already struggling with an active playerbase. RP largely died after rG shut down. Logically smearing out whatever playerbase is left across yet another sector isn't going to help you or anyone else.
  21. That script is a server-side script.
  22. Solstice.

    Timing

    Note I didn't create the variables for the waypoints for you. This is just a basic script idea. You'll have to tweak it but I hope you get the general idea. local seconds = 0 function leaveCol () -- When you leave the colshape the timer 'timer' starts. timer = setTimer(seconds_function, 1000, 0) end addEventHandler("onColShapeLeave", getRootElement(), leaveCol) function seconds_function () -- The timer triggers function 'seconds_function' infinitely each second so you basically simulate a stopwatch. seconds = seconds + 1 end function hitCol (hitCol, matchingDimension) -- So if the element is in the same dimension as the colShape waypoint and the waypoint that was hit is the next waypoint it kills and resets the timer and stopwatch. if matchingDimension == true and hitCol == nextWaypoint then -- Resets the timer back to 0 and outputs the time taken to reach the waypoint in the chatbox towards the source player. outputChatBox(seconds, source) killTimer(timer) resetTimer(timer) -- Resets the stopwatch to 0. seconds = 0 end end addEventHandler("onColShapeHit", getRootElement(), hitCol)
  23. That'd work if there was just one player or interior, yeah. Although assuming if we'd have interior A and B using the same objects to build the interior and player A would be in interior A and player B would be in interior B all the objects giving shape to that interior should be in both interior A's dimension and interior B's dimension. Switching dimensions from one to another would just cause it to disappear on another player's client.
  24. Basically I'll have multiple interiors mapped for common use and royalty free to players. Thing is if I load a map to my server all it does is put it in one interior and one dimension. The interior's alright; needs to stay like that so I don't get it to pop up on the LV airport in interior world 0. Much like pre-made client-side interiors that are bound to GTA: SA itself I want to make it so if I go stand in an interior and switch dimensions all it does is set the player element to another dimension rather than all the objects with it, so I can create teleport markers bringing people to XYZ + dimension without having to create the objects seperately for a similar interior in another dimension. It'd be a colossal problem when perceiving it from a perspective wherein 10 people should be able to use the same map each their own interior. tl;dr how do I make objects overlap in multiple dimensions without having to add a seperate line to the script for each object per dimension.
×
×
  • Create New...