Jump to content

Scooby

MTA Contributors
  • Posts

    976
  • Joined

  • Last visited

Everything posted by Scooby

  1. Scooby

    dxDrawText

    nice reply lol, i just wrote a nice reply to this only to find when pressing submit, ud beat me to it lol. good job
  2. just store the players money from getPlayerMoney in a variable every 1 second with a timer, then use this variable in your function in onClientRender, that way, it will show however much the player has on his hud every frame without calling the function every frame. something like this: local root = getRootElement() local cash function updateCashVar() cash = getPlayerMoney() end function scriptStarted() setTimer(updateCashVar,1000,0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), scriptStarted) function drawSpectators() local textX = x - spectatorSettings.xOffset local textY = spectatorSettings.yOffset dxDrawText("MIRANDO: "..tostring(#spectators), textX - 0.2, textY - 0.2, x, y, tocolor(0, 0, 0, 255), 0.4, "bankgothic") drawColor("#00FF00MIRANDO: #ffffff"..tonumber(#spectators), textX, textY, x, y, tocolor(83, 134, 139), 0.4, "bankgothic") dxDrawText("FPS: "..tostring(getElementData(getLocalPlayer(), "fps")), textX - 0.2, textY + 15 - 0.2, x, y, tocolor(0, 0, 0, 255), 0.4, "bankgothic") drawColor("#00FF00FPS: #ffffff"..tostring(getElementData(getLocalPlayer(), "fps")), textX, textY + 15, x, y, tocolor(15, 192, 252, 255), 0.4, "bankgothic") dxDrawText("$: "..tostring(cash), textX - 0.2, textY + 15 + 15 - 0.2, x, y, tocolor(0, 0, 0, 255), 0.4, "bankgothic") drawColor("#00FF00$: #ffffff"..tostring(cash), textX, textY + 15 + 15, x, y, tocolor(15, 192, 252, 255), 0.4, "bankgothic") end addEventHandler("onClientRender",root,drawSpectators) sorry but i dont have time to test it.
  3. ah so 50p used it out of habit.. ok thanks.... i see it quite a lot within code from experienced scripters but have never needed to use it myself... i wasnt sure if it had some use in Lua or not. thanks for the quick reply.
  4. is there any need for the semicolon here: outputChatBox( text ); just curious because ive never needed to use one like this.
  5. Scooby

    Element count

    ah ok thanks... i might add a few more eventually then we didnt like the spinning mta pickups as much as the ones we were used to in VC (when a player dies and drops their weps), so we wrote a resource to drop them in a circle around the player, theyre destroyed after 30 seconds and this way and players can drop and pickup ones they want or dont want. im just trying to cut down on the lag spikes we're getting, one being searching thru all the properties to find the ones which u own when u join the server... a lot of things have had to be removed because of the lag spikes its causing searching thru elements etc. we've even halved the slots from 128 down to 64 (which everyone now complains about because the server is full most of the time) well thanks a lot for the info, i keep at it i guess
  6. Scooby

    Element count

    Thanks for the quick response and detailed reply, im still none the wiser tho lol. with my property system, i use markers, i have around 850 around the map, with a property icon in the marker (which im planning on removing to cut down on the 850 icons ) i agree cycling thu them isnt easy and im sure there are ways i can improve efficiency in a lot of my scripts. what i want to know is, will it make much difference if i have 800 markers to having 1800 markers, will it increase the lag we're experiencing when joining the server. what is a safe limit of elements to use? yes i know its possible to use 65535, but whats a good workable amount? or am i ok to use 65535 without even noticing any difference?
  7. Scooby

    Element count

    Hi, i wonder if someone could clarify a few things for me, over the years i seem to have built up a lot of resources on the server... almost 100 and ive noticed over this time that it takes longer to connect, especially if u reconnect. im not talking about the actual download time but once the downloads have completed, sometimes you can be sat there with a black screen for 5 - 10 - 20 seconds waiting for everything to start up. ive been working on some of the scripts i first made to make them more efficient, im using the normal SA map with around 2000 vehicles (ive removed 3000), also, 1600 elements for properties (icon + marker), rpg/races/gangwars/casino etc.. (a lot is serverside but whatever cant be created serverside is clientside) so what i want to know is: does this sound excessive? i know the element limits etc but what is a reasonable amount to use? or is what im talking about not affected by the element count? basically i dont want to just keep adding more and more scripts with elements if thats whats causing slow connecting.
  8. many people trying to join my server have this same problem and maybe 10 or so of my regular players. the server is running on linux and the problem only started since updating to 1.1.1 they say theres no download process bar on join, but theyre downloading 'something' (after checking bandwidth usage) after waiting half an hour or so, theyve downloaded around 400mb of 'something'... no idea what. ive told them to reinstall gta and mta which im told they did but still the problem continues. it seems they can sometimes join 'normally' if there are 35 or less players, but most of the time i have 60+ players so this doesnt help them. any help on this matter would be greatly appreciated. thx.
  9. ok thanks solidsnake, i guess i'll have to make a temp fix until the mta team add a fix for this. all i can think of is, onPickupHit, destroy the pickup and set a timer to recreate it x seconds later... that should do the trick.
  10. yeah i found it on the bug reports... seems to have just turned up in 1.1 looks like i'll have to use another hack-fix.
  11. Ive been waiting for a response regarding this for a few days in the support part of the forums with little progress so i thought id post here... maybe not quite the perfect place but i might get a quicker response here. Has anyone else experienced any problems with weapon pickups in 1.1? on my server, when a player hits a pickup, it appears to work fine, the pickup is removed and the player gets the ammo/wep from the pickup. However, if u keep walking over where the pickup previously was, you can keep picking it up, over and over. I havent changed anything relating to pickups since updating to 1.1 and it worked ok before this. Ive checked through my resources and cant find any code regarding the pickups... only that they're in my .map file and start up with my gamemode. There are no visible errors showing in debug. So what i want to know is: 1)is this an mta bug or something in one of my scripts? (ive tried turning loads of them off and it still does it) 2)does anyone else have this problem? 3)any ideas on how to prevent it?
  12. Scooby

    Weapon Pickups 1.1

    yeah i think theyre meant to be like that now. thats not the same problem as im having though. i guess my question is: is this a bug? does anyone else have this problem? Edit: ive checked other servers out... they all have this same problem.. i guess this is an mta bug that needs sorting out.
  13. Scooby

    Weapon Pickups 1.1

    Hi, has anyone else experienced any problems with weapon pickups in 1.1? on my server, when a player hits a pickup, it appears to work fine, the pickup is removed and the player gets the ammo/wep from the pickup. However, if u keep walking over where the pickup previously was, you can keep picking it up, over and over. I havent changed anything since i updated and it worked ok before this. Ive checked through my resources and cant find any code regarding the pickups... only that theyre in my .map file and start up with my gamemode. Any suggestions? I would like to resolve this asap if possible.
  14. i know a few people with the same problem, did you manage to solve this? if so, it would be nice to know what u did to fix it so i can inform them.
  15. nice one man, that looks like it has what i need, thanks alot
  16. Hi, I wonder if anyone can help me with this. I want to move a created vehicle forwards using setElementVelocity, The vehicle is stationary to start with. im not sure how to get the x and y needed for setElementVelocity, from the rotation of the vehicle to move it forwards. can anyone help me out with this equation? or am i missing an easier way to do this?
  17. https://wiki.multitheftauto.com/wiki/Main_Page
  18. i dont have a link to it or i would just update the download link if i did lol. i thought he was asking for someone to send it to him so he could upload it somewhere since im too lazy ive emailed it to loads of people, if u email me, i can reply with it an attachment.
  19. SugarD-x if u still need a copy, email me and i will send it to u.
  20. Nice post JR10, sorry i didnt have time earlier to post a detailed reply.. good job man. /me gives JR10 a cookie for his hard work.
  21. he means the SQL functions built into mta: bool executeSQLCreateTable ( string tableName, string definition ) the examples on the wiki are a little confusing when u first start out.
  22. ok i see, well u can also benefit then by adding some element data to the player when he uses the boost button, that way when he collides with another vehicle u can give the extra points if the player is boosting. im sure theres a few ways u could do this, as i mentioned above, i think i would: when a players vehicle is damaged, create a temporary marker around the vehicle slightly bigger than the vehicle (invisible of course), then check to see if any other vehicles are in that marker by looping thru the other players vehicles. if one is detected in the marker, then check to see if the player is also boosting at the time. i know this isnt gonna be 100% but i dont know of a perfect way untill onMarkerHit/onColShapeHit is working on moving elements. if u need help making this, let me know. or if anyone else has any better suggestions on how this might be achieved, please say so.
  23. can you explain in detail as much as you can what is it that youre trying to do? There are a few workarounds for this.... depending on what youre after.
  24. onColShapeHit wont return who hit who it will just be triggered twice, once for each of the vehicles.(im assuming ur adding this to all ur cars?) as i mentioned earlier, i dont think u can use onColShapeHit or onMarkerHit. many other people on the forums have also said they have tried to attach a colshape to a moving element (player/car etc) and failed.
×
×
  • Create New...