• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About UnchiuDawg

  • Rank
  • Birthday 04/07/97


  • Gang
    Varrios Los Aztecas
  • Location
  • Occupation

Recent Profile Visitors

238 profile views
  1. Chatbox text outline?

    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.
  2. Changing direction slow when aiming

    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
  3. "Threadnet" server setting

    Thank you, I thought it had to be written in the config file in order for it to be enabled.
  4. Changing direction slow when aiming

    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.
  5. "Threadnet" server setting

    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 it removed in some previous versions? If I were to add "<threadnet>1</threadnet>" to my config file would it work?
  6. Changing direction slow when aiming

    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've looked all over the wikipedia and forums and couldn't find any function that does this or anybody even asking about this. Here is what I have done on clientside: -- clientside script function weaponMovementFix(key, press) local forwardkeys = getBoundKeys("forwards") local backwardkeys = getBoundKeys("backwards") local leftkeys = getBoundKeys("left") local rightkeys = getBoundKeys("right") local myweapon = getPedWeapon(localPlayer) local mycurrentammo = getPedAmmoInClip(localPlayer) if myweapon == 24 then -- only for the deagle if mycurrentammo ~= 0 then -- don't do it when reloading cause it cancels the reloading if getControlState("aim_weapon") then -- only do it when aiming if not isPedDucked(getLocalPlayer()) then -- don't do it when crouching/ducking for rightkey, rightstate in pairs(rightkeys) do if key == rightkey and press then setPedAnimation(getLocalPlayer(), "python", "python_fire", 0, false, false, true, false, 0) break end end for leftkey, leftstate in pairs(leftkeys) do if key == leftkey and press then setPedAnimation(getLocalPlayer(), "python", "python_fire", 0, false, false, true, false, 0) break end end for fwdkey, fwdstate in pairs(forwardkeys) do if key == fwdkey and press then setPedAnimation(getLocalPlayer(), "python", "python_fire", 0, false, false, true, false, 0) break end end for bkwdkey, bkwdstate in pairs(backwardkeys) do if key == bkwdkey and press then setPedAnimation(getLocalPlayer(), "python", "python_fire", 0, false, false, true, false, 0) break end end end end end end end addEventHandler("onClientKey", getRootElement(), weaponMovementFix) It kind of works, but it is still not instant, it still stops for a very short moment before changing the direction. So if let's say I keep pressing left-right-left-right, I won't move at all. I have tried changing all the arguments for setPedAnimation, or even use another animation, but this is the closes I've got to what I want. And before you ask, I have already tried using all setWeaponProperty on serverside, but none of them affect this "slowing" thing. Also, even with all glitches enabled, still no luck. Is there any better way to do this? P.S. if needed, I can upload a video with side to side aiming to show it if I haven't explained it well enough. Thank you for your help.
  7. getPlayersFromPartOfName

    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.
  8. getPlayersFromPartOfName

    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 table.insert(playerlist, checkplayer) end else for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then table.insert(playerlist, player) end end end return playerlist end return nil end function getFullName (source, cmd, thename) -- for testing if thename then local playermatchtable = getPlayersFromPartOfName(thename) for i, v in ipairs(playermatchtable) do outputChatBox(getPlayerName(v), source) end end end addCommandHandler("name", getFullName, false, false) The function "getPlayersFromPartOfName" is supposed to return a table with all the players that contain the specified argument. If the specified pattern matches the player name then the table should only contain that player. However, there is a problem: When the pattern matches the name of the player but does not match the case of the name (i.e unchiudawg ~= UnchiuDawg), the table will be returned empty. Here's an example: There are 2 players online, Player and Playertwo. /name Player will output in the chatbox "Player", which is correct. /name Playertwo will output in the chatbox "Playertwo", which is correct. /name pla (or whatever pattern that exists in both names) will output in the chatbox "Player" and "Playertwo", which is correct /name player (or playertwo) won't output anything. It should output "Player" and "Playertwo" if the argument is player, and just "Playertwo" if the argument is playertwo. But it's not doing it. Why is that happening? Thank you for your help.
  9. cancelEvent onPlayerWeaponFire

    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)
  10. cancelEvent onPlayerWeaponFire

    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?
  11. cancelEvent onPlayerWeaponFire

    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 or am I just doing this wrong?
  12. Check if string contains value from table

    Thank you very much.
  13. I'm trying to make my login panel not allow usernames that contain specific words to register. I want to use a table since there are many words that I want to be restricted (like swear words), but I don't know how I could do this. restrictedusernamewords = {"badword1", "badword2", "badword3"} for k,v in ipairs(restrictedusernamewords) do if string.match(usernameregister, v) then outputChatBox ( "Please don't include vulgar words in your username!", client ) else register the account Right now if the username doesn't contain all the words in the table, it will output the chat message and still register the account. I searched and couldn't find anybody using string.match or string.find with a table like this, am I trying to do this the wrong way?
  14. [Help]Canceling server event on clientside

    Thank you very much, it works!
  15. Hi, I'm new to lua and scripting itself. I'm trying to make a simple login panel. Almost everything works right, except this one thing: serverside: function loginHandler ( usernamelogin, passwordlogin ) local accountlogin = getAccount ( usernamelogin, passwordlogin ) if ( accountlogin ~= false ) then logIn ( client, accountlogin, passwordlogin ) fadeCamera(client, false, 1.5) setTimer(fadeCameraDelay,1500,1,client) else outputChatBox ( "Wrong username or password!", client, 255, 255, 0 ) -- the login failed end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) clientside: function clientSubmitLogin(button,state) if button == "left" and state == "up" then local usernamelogin = guiGetText(UserLogin) local passwordlogin = guiGetText(PassLogin) triggerServerEvent("submitLogin", getRootElement(), usernamelogin, passwordlogin) guiSetInputEnabled(false) -- should not happen if login failed guiSetVisible(LoginPanel, false) -- should not happen if login failed showCursor(false) -- should not happen if login failed stopSound(loginpanelsong) -- should not happen if login failed end end This is for the login button, but I don't know how to make some of the functions (the ones I put comments on) not happen when the login fails. I tried working around it but still couldn't figure it out and I kept looking on the wiki but couldn't find a way to do it. Any help is appreciated