Jump to content

UnchiuDawg

Members
  • Content Count

    32
  • Joined

  • Last visited

Everything posted by UnchiuDawg

  1. Thank you, it's everything I needed to know.
  2. Hello, from what I've seen on the forum and the wiki, I understand that it's like this: You can either: - delete the clientsided script file after it's loaded by using fileDelete() at the end (it gets downloaded to the hard drive, loaded, then deleted). - download the clientsided script directly to the cache by using the cache setting in the meta.xml, so it never reaches the hard drive. My questions are: Are the client scripts always kept loaded in the cache while the client is connected to the server? Will they unload for whatever reason while the player is still on t
  3. I've meant to attatch the event to the resourceRoot, not the root. It was already working when attatched to the root. Biistamais' method works the way I wanted it to be ^^ But thanks anyway
  4. Yeah I've added that argument by mistake, it shouldn't be there, I'll remove it. Thank you for the help, it works properly now and I also understand what I did wrong ^^
  5. I have tried it like that too, but it still won't work if on the serverside I attatch the event "sendPedVoices" to the resourceRoot, it still has to be attatched to the root.
  6. Hello, I have a little trouble understanding why attatching an event to the resourceRoot won't work on the serverside. Here's the script: -- serverside ballas1 = createPed (102, 1092, -1386, 14, 180,true) ballas2 = createPed (103, 1093, -1386, 14, 180,true) ballas3 = createPed (104, 1094, -1386, 14, 180,true) ballas4 = createPed (185, 1095, -1386, 14, 180,true) ballas5 = createPed (293, 1096, -1386, 14, 180,true) function sendPedVoices() triggerClientEvent("applyVoicesClient", source, ballas1, ballas2, ballas3, ballas4, ballas5) outputChatBox ( "#FF0000zzzzzz", source, 231, 217, 17
  7. Thank you everybody, I managed to make it as accurate as possible by using onClientCursorMove. To answer a few questions: I would drag the scroll bar by comparing the absolute position clicked (by using onClientClick) with the float position returned by getCursorPosition multiplied by the screenHeight. I used math.ceil in order to move the scroll bar if there was even a slight difference to approximate the distance between those two positions to one unit. The "problem" was that sometimes the absolute position clicked and the float multiplied by the scren height would not be
  8. I realised my typo, I meant to say that multiplying the float returned by getCursorPosition with the screen height is not accurate. I'd like to know if there is a way to get a more accurate position ^^ Thanks for replying anyway.
  9. Hello, I am trying to make a scroll bar that can be dragged using the dx functions. Long story short, want to compare the absoluteY returned by onClientClick with the absoluteY of the current frame (by using onClientRender). The only way to get the current cursor location this way is by using getCursorPosition, which does not return an absolute position. I couldn't find any other function to do this and dividing the screen height by the float returned by getCursorPosition is not accurate. Is there any way to do this? Am I missing something? plz halp lol
  10. If a player sets their fps_limit cvar in their client by using the console I am not able to overwrite that limit with setFPSLimit. I tried using it on both serversided and clientsided scripts. I want to run my server at 60fps and I every player to have their framerate as close to it as possible in order to avoid weird desyncing or abusing game glitches affected by the framerate (such as swimming speed, shooting speed, whatever). This is literally the third time I'm explaining it, what is it that you don't understand? lol
  11. It makes perfect sense, I want to force the MAXIMUM fps limit, not the MINIMUM. I'm not asking the computer to perform that amount of frames and nothing less, I'm asking it to perform up to that number IF there is enough computing power available. Yes, different FPS limits on different clients will cause them to have different gameplay experiences. My example was regarding the swimming speed difference between low FPS ( 20 fps swimming speed is huge ) and high FPS ( 90 fps would barely move). Your example is an even better one. There are also things like boat speeds being different on
  12. Hello, I am wondering if it is possible to overwrite a client's maximum FPS or to set it to match the server's maximum FPS. I am aware of the setFPSLimit function, but there's this: "Note: When set client side, the actual limit used is the lowest of both the server and client set values" As some of you might already know, many game physics are affected by the FPS (swimming speed, shooting speed, maybe even more). I've discovered a client command on some german MTA forum that can change the client FPS, fps_limit, but I couldn't find any information on the wikipedia or this forum.
  13. Alright I see, thanks for the help
  14. Hello, I want to change some places using the map editor and I'm encountering some weird lighting that probably originates from the buildings I'm using. Here's a screenshot example: I would like to fix these or at least make them less obvious. They only look this weird at night. Are there any clientside functions I could use to do it? The only function I've seen on the wiki that seems to be able to help would be engineApplyShaderToWorldTexture, but I think that would change all the buildings that share this model, which I don't want to since the original one would
  15. Hello! Is there a way to add a black outline or something like that to the chat text? I've noticed there are lots of interface settings that can be changed for the chat, but couldn't find anything like that.
  16. That's the thing, GTA San Andreas does have this slowdown effect and MTA does it the way it is supposed to be. It's 100% the same as it is in single player without any mods. I was just wondering if there was any possible way to just skip that slowing animation in order to make players harder to hit and to give them more mobility, but I guess it's impossible I've done some research but couldn't find any SA-MP setting or scripting function that would affect this, I guess it was unintentionally hardcoded like that lol
  17. Thank you, I thought it had to be written in the config file in order for it to be enabled.
  18. Here's the video, I tried to synchronize them as much as possible, please note that on the MTA side I sometimes stop, that's the thing I'm talking about, I'm changing direction but it gets stuck for a second before walking in the other direction which is slow and weird. I am not talking about the time needed to break out of this animation and walk freely, nor the speed at which you can walk in one direction, I'm talking about it getting stuck when trying to switch directions like from left to right or from forward to backward.
  19. Hello, I want to make sure my server's players are synced as good as possible without having any strange glitches happening on the server. While I was looking through the config file and on the wikipedia for more information, I've noticed that there is a setting called "threadnet" (https://wiki.multitheftauto.com/wiki/Server_mtaserver.conf#threadnet), but this setting was not added in the config file by default, and it is missing from the setServerConfigSetting arguments on the wiki page, although it says it can be changed by using that function. Does this setting still exist or was
  20. Hello, I am trying to remove the movement slowing that happens when you're aiming a weapon, walking in one direction and then changing it to the opposite direciton. The reason for which I'm trying to do this is because I have played a lot of SA-MP on deathmatch servers and this movement slow feels very unconfortable when coming from there (for various reasons). I am aware that the movement is supposed to be like this, as it is in the single player game, but I'm just wondering if there's a way to skip/cancel that slowing animation and turn into the opposite direction directly. I
  21. I've found my mistake: getPlayerFromName is not case sensitive. I can't edit/delete the post above, that's why i'm double-posting.
  22. Hello, I'm trying to make a function that would return a table with players that contain a letter or pattern or whatever in their name. I've "inspired" myself from this: https://wiki.multitheftauto.com/wiki/GetPlayerFromPartialName , however that only returns one player and I want a table with multiple players. Here's what I've done on serverside: -- serverside function getPlayersFromPartOfName(name) if name then local playerlist = {} local checkplayer = getPlayerFromName(name) if checkplayer then local checkname = getPlayerName(checkplayer) if checkname == name then
  23. EDIT: I managed to do it properly clientside, thank you for the help. --clientside function cancelShooting(key, press) local keys = getBoundKeys ( "fire" ) for keyName, state in pairs(keys) do if key == keyName and press then if getControlState("aim_weapon") then outputChatBox("aiming") else outputChatBox("not aiming") cancelEvent() end end end end addEventHandler("onClientKey", getRootElement(), cancelShooting)
  24. I've already tried doing this, but it permanently disables the fire control after I shoot once and basically the only way to turn it back on is to shoot while aiming, which is impossible because shooting is now disabled. I also tried setControlState (which you wrote before editing) and it stops firing after the first bullet, but if I click again I can shoot again and again. I guess I must use setControlState(source, "fire", false) before the event actually happens somehow?
  25. Hi, I'm trying to make it impossible to shoot a weapon unless you're aiming it, but I can't figure out how to do it properly. -- serverside.lua function isPlayerAiming() if getControlState(source, "aim_weapon") then outputChatBox("aiming", source) else outputChatBox("not aiming", source) cancelEvent() -- should not shoot the weapon if not aiming end end addEventHandler("onPlayerWeaponFire", getRootElement(), isPlayerAiming) It does output the correct message when I'm shooting the weapon, but I don't know how to cancel the event when I'm not aiming. Am I using the wrong event
×
×
  • Create New...