Jump to content

UnchiuDawg

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by UnchiuDawg

  1. 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?
  2. 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
  3. EDIT: I just realised my mistake from here: https://wiki.multitheftauto.com/wiki/Element/Object I suppose the only way to do this is to rebuild the entire map. I guess you could close this topic. Hi, I've been trying to replace the low LOD elements of the entire map objects from the low resolution ones to the normal ones by using setLowLODElement. I've tried to do it in many ways (which I figured out were wrong after reading more on the wiki about each function I tried to use). I don't think it's worth explaining what I tried since I'm very new to scripting and it might seem very dumb/not worth your time to read. I just don't know how to get the elements of the map objects (buildings, trees, roads, hills, etc.). The last thing I tried was using getElementsByType, but I still couldn't figure it out. This is the last thing I tried on serverside: function replaceLODall(source, plzwork) for k,v in ipairs( getElementsByType("object") ) do setLowLODElement ( v, v ) end end addCommandHandler ("lolcommand", replaceLODall) I've looked on the forums to check if anybody else tried this and also looked for a resource that does this, but I couldn't find any. If you're wondering why I'm trying to do this, it's because engineSetModelLODDistance is limited, and I want to see the proper model from far away (and also to see a model for those objects that lack a low LOD). I appreciate any help
  4. That's what I meant, modifying them for my server. Thanks for the help, I'll look into those functions
  5. Hello, I'm new to MTA scripting, I am aware that I can change models and textures (dff/txd files inside gta3.img), but is it possible to change other files like ped.ifp, hud.txd, pedstats.dat, etc.? I couldn't find it anywhere on the wiki/forums.
×
×
  • Create New...