Jump to content

Oscuro87

Members
  • Content Count

    23
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Oscuro87

  • Rank
    Civilian

Details

  • Gang
    i don't know
  1. I'm not sure about the mechanics behind it (even though pretty much anything is possible i guess...) But I strongly support this idea. Cheers!
  2. Hmmm I just tried this, and again it triggers twice. It's bizarre 'cause logically, this should work nicely. Might aswell consider it's an MTA bug. Well if this remains like this, i can just say : if the total salary is == 0, then i don't trigger the server event or anything. It's really using duct tape, but whatever! EDIT: Or not... If i do the totalSalary trick, vehicle won't get deleted.
  3. Oh yes sure, First i separated both jobs into 2 distinct functions, i thought it was clearer that way. Here it is : function showSweeperGui(player) if player == localPlayer and getElementType(player) == "player" and not isPedInVehicle(player) then if getElementData(source, "markerJOB") == "streetsweeper" and not isPedInVehicle(player) then triggerServerEvent("onPlayerToggleMouse", localPlayer) guiSetVisible(gui,true) end end end addEventHandler("onClientMarkerHit", root, showSweeperGui) function stopSweeperJob(player)
  4. Hey, thanks for the reply! I just tried your solution, and it fixes half of the problem indeed. Instead of triggering 4 times, it triggers twice, which is an improvement already. I just dunno why it still triggers 2 times as i blocked the "vehicle" element type. Kind of unsure on this one.
  5. Ohai I come today with a new oddity MTA came up with today. When any player is in a vehicle, and drives onto a marker, it triggers it not only once, but 4 times. Code might help, so : function showSweeperGuiOrStopJob() if getElementData(source, "markerJOB") == "streetsweeper" and not isPedInVehicle(localPlayer) then triggerServerEvent("onPlayerToggleMouse", localPlayer) guiSetVisible(gui,true) elseif isPedInVehicle(localPlayer) and getElementData(source, "markerJOB") == "streetsweeper" then local veh = getPedOccupiedVehicle(localPlayer) if
  6. Ahhh I see, so I was still doing it wrong. I should learn to read the wiki more thoroughly (or learn English idk...) Thanks a bunch Karthik_184!
  7. Hi, it's me again! (oh noes! ) Ok i'll briefly describe my problem : My world is loading twice when I use "onResourceStart" to setup all the stuff. Here is how I setup vehicles for example : function setupAllVehicles() [Here is the stuff to spawn vehicles, all that] end addEventHandler("onResourceStart", root, setupAllVehicles) I already checked several possibilities, including : me spawning the cars twice, but nope, I don't do that. IMPORTANT NOTE : This only happens when I first start the server (aka, when i double click on the MTA server icon to run it.) When
  8. Sorry for the late reply, i was off for a couple of days! Yes i know it returns an indexed table indeed, my question was more like : "Does this indexed table has a particular order? Like, is the nearest objects from the center of the colsphere at index 1 in the table? Or has the table a random order?" Sorry i wasn't clear! D: Thanks though!
  9. Hi! Just a quick question regarding getElementsWithinColShape: Does the table that results from this function have a particular order? Example : Assume there are at least 2 elements detected with the function getElementsWithinColShape(x,y), also assume that the colShape is a sphere, and is attached to the player. Would the resulting table's first element be the one that is the nearest to the player? Or would the first element of the table be the furthest element from the player? Or even, would the table's elements not have any particular order? (random?) Thanks in advance! (And don't
  10. Thanks to both of you who just pointed something important I was missing. Indeed, I personally thought that Mysql was actually more memory consuming than XML. But I see your point, especially when i see the function "xmlUnloadFile" (something like that), which means everything I do in XML is temporarily written in RAM memory... I should have noticed that earlier hehe.. So I guess i'm gonna go for mysql, as setting up a mysql database is easy as eating as sandwich. Thanks for the precisions!
  11. Hmmm I see your point, thanks for the enlightement! This thread is still open to people who want to add details/personal experience, btw.
  12. Yep, that's the idea. Tho I recently found out that if i want to use ID's when using xml files, i have to do a lot of manipulations on the file. For example, I store a lot of statically set coordinates in an XML file. Removing an entry in the middle of the file would create a hole in it, and, if un-managed, might also come to having duplicate ID's in the xml table. But at the same time, and as you said, MYSQL would be a bit big to just store static coordinates, but it has ID management. (kind of ) It also concerns me to use mysql too often, because in my mind it's a lot of extra overhead fo
  13. First of all, hi everyone! So today i come up with a new question : When should i pick mysql or xml, and for what type of job? I have in mind, speed of execution, but also i'm trying not to use a cannon to catch a fly. For now, I try not to use mysql for "lesser" jobs like storing static coordinates values i need to create markers. Then i use setElementData for storing what i load from MYSQL directly "in" the object. Of course i could be totally wrong in this method, as i might not be aware of performance issues caused by any of mysql/xml/setElementData methods. Could someone post how t
  14. Man!! I found the answer as i was fiddling around in my code. Then I thought like "if the clicks works with admin panel, then it must be using some kind of different click that i use or something". In fact, i was making the GUI CURSOR appear from the client side, aka with "guiSetInputEnabled" which is wrong! I had to make the cursor appear with the serversided function "showCursor".............. I told you it was retarded lol! This will teach me for mixing clientside and serverside... My basic idea was like : ok my gui and my click are client side, so my client will detect the ped and tel
  15. Well of course, otherwise how could i click it?
×
×
  • Create New...