Jump to content

Xabache

Members
  • Posts

    134
  • Joined

  • Last visited

Everything posted by Xabache

  1. So i've created lists of removeWorldModel and createObject and have seen them work, but am not sure should this be a client side function or server side? if either, advantage to which?
  2. function onClickLogin(button,state) if(button == "left" and state == "up") then if (source == btnLogin) then username = string.upper(guiGetText(editUsername)) outputChatBox("Debug: 001a") setPlayerName( getLocalPlayer() , username) outputChatBox("Debug: 002a") password = guiGetText(editPassword) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts) xmlFileHandler() end end end not working to force the login nick "a1" to appear on screen in chat as "A1" instead of the MTA client set nickname JohnDoe... setPlayerName( getLocalPlayer() , username) ..ideas?
  3. [2015-01-09 19:57:57] WARNING: freeroam\gui.lua:442: Bad argument @ 'guiSetText' [Expected gui-element at argument 1, got boolean] 439: function setControlNumber(...) 440: local args = {...} 441: local num = table.remove(args) 442: guiSetText(getControl(unpack(args)), tostring(num)) 443: end This error is filling my clientscript.log with 1mb of error messages an hour on multiple machines, the only error elsewise in the file is the luac notice. The second machine has no luac files added to it but is on the same server: GTA3SA - Note the error Immediately follows the luac notice, the first error in the file, but it was several hours before I added my first .luac [2015-01-09 09:12:33] ERROR: Loading script failed: fileblock\p.luac is invalid. Please re-compile at https://luac.multitheftauto.com/ [2015-01-09 09:12:39] WARNING: freeroam\gui.lua:442: Bad argument @ 'guiSetText' [Expected gui-element at argument 1, got boolean] ..... ideas?
  4. givePlayerMoney(name , score ) Bad arguement @ givePlayerMoney [Expected Element at argument 1, got strng 'ExuberantHarbor7']
  5. little help here... givePlayerMoney ... not working. why> how fix? addEventHandler("driftNuevoRecord", root, function(score, name) outputChatBox("-" .. name .. score .. "-",source,255,255,255,true) givePlayerMoney(player name , score ) if score > drift_mejor then drift_mejor = score drift_nombre = name triggerClientEvent(root, "driftActualizarRecord", root, drift_mejor, drift_nombre) end end)
  6. Ny goal is primarily to create and remove world objects, and manipulate their properties as is easily available in the .map files, with all those properties such as collision and double sided, but hidden away from prying eyes, within an encoded .luac file Create: createObject() remove: ???
  7. I would like to make ultra secure easter eggs. Have i seen money pick up spawn points in .lua? Can i make map modifications, which might tip off pickup points, to be within .luac files? Example can I put something akin to this within a .luac by whatever means <object id="object (cxrf_floodlite_) (6)" breakable="true" interior="0" collisions="false" alpha="255" model="3398" doublesided="false" scale="1" dimension="0" posX="643.20001" posY="958" posZ="-5.5" rotX="0" rotY="0" rotZ="180"></object>
  8. ...So I enter the Bank System (bank) to deposit the money acquired through the above mentioned method givePlayerMoney(math.floor(score)) to find this money is not real, it is theme only... how to solve this? I had no problem depositing $5 given to me by my admin console. Full Link to see right side of image: http://www.robertskyler.com/op/Fake-Money.jpg
  9. Often at first arrival i respond to a posting, in perfect detail answering every question and providing all needed info, press submit in the Quick Reply input box, only to find I am not logged in, my message disappears, back button fixes nothing, and I have to rewrite my post. Please force login before or after. Otherwise fine service
  10. thanks i solved that with math.floor(x) the main question remains unsolved how to make .. score .. = money 4 points = $4 dollars to $00000000 I have tried a dozen unrelated examples for givePlayerMoney setPlayerMoney and cannot make any work in this example. outputChatBox("This works 002 " .. score .. " okay") it should go near this line ^^
  11. Thank you NearGreen, for directing me how to make 4.25 the whole number, or integer 4. Leaving the primary problem, with no direction, how to award that number to the player with a raise in the Game's total $00000004?
  12. At the center of the following otherwise fine top half of a function is my first successful code insertion outputChatBox("This works 002 " .. score .. " okay") Where it displays in the chat box This works 002 4.25 okay, with 4.25 being any score achieved, typically not a whole number. I want to make this number a whole number, if possible, then give that number in money to the player. I have tried a thousand times in a thousand ways... function showText() dxDrawText(string.format("",global_nombre,global_mejor),44,screenHeight-43,screenWidth,screenHeight,Yellow,1,"pricedown") vehicle = isValidVehicle() if not vehicle then return end if size > 1.3 then modo = -0.01 elseif size < 1.2 then modo = 0.01 end size = size + modo tick = getTickCount() local angulo,velocidad = angle() local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Last Drift", anterior) outputChatBox("This works 002 " .. score .. " okay") total = total+anterior setElementData(player, "Total Drift", total) if score > mejor then mejor = score setElementData(player, "Best Score", mejor) end triggerEvent("onVehicleDriftEnd", rootElem, tick-driftTime-750) score = 0 end
  13. So no one has written a basic description to these 180+ functions? Seems like a good project for someone to put their name on. Their guide may look forward to my respect. For each server operator to independently explore each one of these resources to discern its exact and complete function on their own, op after op, would be a waste of time so great that it would surely lead to the downfall of mankind. That someday one may come along and write a comprehensive description to these valid resources, much honor awaits them...
  14. I've noticed that regardless my efforts nothing overwrites what is set in MTA > Settings > Multiplayer > Nick. Whatever is set in the MTA client is what i see in the chat room regardless of there being a totally different login name set on the client.lua side. Example: Xabache password as the client.lua login, is ignored and subject to ehcabaX as set in MTA > Settings > Multiplayer > Nick, and what i see on the map, above the user, and in the chat. How do i force it to use client.lua Login nick only and ignore MTA > Settings > Multiplayer > Nick in all cases.
  15. Ten years ago when i started mIRC scripting i found it most helpful when someone with skills came along and solved one or two problems in total. That I may learn from their example. As I have done for new mirc scripters ever after The example I hope to learn from you from is an MTA New Player Regitration Entry nickname filter with hopefulyl all of the following rules forced at the entry point or rejected by the server once entered - No Colored Nicks allowed #FFFFFF - Characters A-Z, 0-9, - _ only - 4-10 characters required/limited - ALL CAPS - A Profanity Nick name filter position would be nice too if (UCKYOU isin $nick) echo BAd Nickname ...sort of thing Rejection at the typing level, the nickname entry level into the client would seem best, but a rejection message server side is also fine The Client Lua: ---------------------------------- -----------| Settings |----------- ---------------------------------- blackLoginScreen = false -- Set to 'true' to display a black screen to the player untill they log in or choose to play as a guest. enableKickPlayer = true -- Set whether to kick the player after they fail to login specified amount of times. disallowLogout = false -- Set whether to show the userpanel to the players if they log out of their accounts. removeBlackScreenTime = 4 -- The time it takes for the black screen to dissapear - If you choose to display the black screen. [iN SECONDS] maxLoginAttempts = 19 -- Set the maximum incorrect login attempts before the player gets kicked - If player kicking is enabled. ---------------------------------- -- Set the text you want displayed in the "rules" window here - use '\n' to go into the next line infoText = "------ Rules ------ \n\n* 1) No Insults!\n* 2) No Spamming!" -- Screen and GUI window sizes screenWidth,screenHeight = guiGetScreenSize() mainWidth,mainHeight = 749,472 regWidth,regHeight = 439,344 -- Generate the XML file name function getServerName() triggerServerEvent("onClientLoginLoaded",getLocalPlayer()) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getServerName) function setXmlFileName(sName) xmlFileName = tostring("login_"..sName..".xml") loginPanel() end addEvent("onGetServerData",true) addEventHandler("onGetServerData",getRootElement(),setXmlFileName) ---------------------------------- addEvent("onRequestIncreaseAttempts",true) addEvent("onRequestDisplayPanel",true) function loginPanel() -- Check if autologin is enabled - If yes, then log the player in, else create and show the userpanel local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then status = xmlNodeGetAttribute(xmlFile,"autologin") if (status == "true") then local username = tostring(xmlNodeGetAttribute(xmlFile,"username")) local password = tostring(xmlNodeGetAttribute(xmlFile,"password")) if not (username == "") and not (password == "") then triggerServerEvent("onRequestAutologin",getLocalPlayer(),username,password) end else if blackLoginScreen == true then fadeCamera(false,0,0,0,0) end mainWindow = guiCreateWindow(screenWidth/2-mainWidth/2,screenHeight/2-mainHeight/2,mainWidth,mainHeight,"Login panel",false) guiWindowSetSizable(mainWindow,false) mInfo = guiCreateMemo(21,36,411,278,infoText,false,mainWindow) guiMemoSetReadOnly(mInfo,true) editUsername = guiCreateEdit(53,364,187,25,"",false,mainWindow) guiEditSetMaxLength(editUsername,30) editPassword = guiCreateEdit(53,421,187,25,"",false,mainWindow) guiEditSetMaxLength(editPassword,30) guiEditSetMasked(editPassword,true) lblUsername = guiCreateLabel(67,330,158,38,"Username:",false,mainWindow) guiLabelSetColor(lblUsername,0,85,255) guiLabelSetVerticalAlign(lblUsername,"center") guiLabelSetHorizontalAlign(lblUsername,"center",false) guiSetFont(lblUsername,"default-bold-small") lblPassword = guiCreateLabel(67,389,158,38,"Password:",false,mainWindow) guiLabelSetColor(lblPassword,0,85,255) guiLabelSetVerticalAlign(lblPassword,"center") guiLabelSetHorizontalAlign(lblPassword,"center",false) guiSetFont(lblPassword,"default-bold-small") btnLogin = guiCreateButton(280,368,242,74,"Login",false,mainWindow) guiSetFont(btnLogin,"sa-header") btnToggleRegister = guiCreateButton(490,246,206,68,"Register an account",false,mainWindow) guiSetFont(btnToggleRegister,"default-bold-small") registerWindow = guiCreateWindow(screenWidth/2-regWidth/2,screenHeight/2-regHeight/2,regWidth,regHeight,"Registration",false) guiWindowSetSizable(registerWindow,false) editRegistrationUsername = guiCreateEdit(98,138,242,25,"",false,registerWindow) editRegistrationPassword = guiCreateEdit(98,195,242,25,"",false,registerWindow) guiEditSetMasked(editRegistrationPassword,true) editRegistrationRepeatPassword = guiCreateEdit(99,252,242,25,"",false,registerWindow) guiEditSetMasked(editRegistrationRepeatPassword,true) lblRegister = guiCreateLabel(24,24,391,97,"Register",false,registerWindow) guiLabelSetColor(lblRegister,0,85,255) guiLabelSetVerticalAlign(lblRegister,"center") guiLabelSetHorizontalAlign(lblRegister,"center",false) guiSetFont(lblRegister,"sa-gothic") lblRUsername = guiCreateLabel(98,113,242,17,"Username:",false,registerWindow) guiLabelSetColor(lblRUsername,0,85,255) guiLabelSetVerticalAlign(lblRUsername,"center") guiLabelSetHorizontalAlign(lblRUsername,"center",false) guiSetFont(lblRUsername,"default-bold-small") lblRPassword = guiCreateLabel(98,171,242,17,"Password:",false,registerWindow) guiLabelSetColor(lblRPassword,0,85,255) guiLabelSetVerticalAlign(lblRPassword,"center") guiLabelSetHorizontalAlign(lblRPassword,"center",false) guiSetFont(lblRPassword,"default-bold-small") lblRepeatPassword = guiCreateLabel(98,230,242,17,"Repeat password:",false,registerWindow) guiLabelSetColor(lblRepeatPassword,0,85,255) guiLabelSetVerticalAlign(lblRepeatPassword,"center") guiLabelSetHorizontalAlign(lblRepeatPassword,"center",false) guiSetFont(lblRepeatPassword,"default-bold-small") btnCancel = guiCreateButton(232,292,179,38,"Cancel",false,registerWindow) guiSetFont(btnCancel,"default-bold-small") btnConfirmRegistration = guiCreateButton(29,292,179,38,"Confirm & register!",false,registerWindow) guiSetFont(btnConfirmRegistration,"default-bold-small") guiSetVisible(mainWindow, true) guiSetVisible(registerWindow, false) guiSetInputEnabled(true) showCursor(true) addEventHandler("onClientGUIClick",btnLogin,onClickLogin) addEventHandler("onClientGUIClick",btnToggleRegister,onClickRegisterToggle) addEventHandler("onClientGUIClick",btnConfirmRegistration,onClickRegisterConfirm) addEventHandler("onClientGUIClick",btnCancel,onClickCancel) addEventHandler("onRequestIncreaseAttempts",getRootElement(),increaseAttempts) attemptedLogins = 0 end xmlUnloadFile(xmlFile) else xmlFileHandler(true) end addEventHandler("onRequestDisplayPanel",getRootElement(),logoutHandler) end --addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),loginPanel) -- Disable autologin function removeAutoLogin() local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then local status = xmlNodeGetAttribute(xmlFile,"autologin") if status == "true" then xmlNodeSetAttribute(xmlFile,"autologin","false") outputChatBox("#0000FF* #FFFFFFAuto-login is now #FF0000DISABLED#FFFFFF!",255,255,255,true) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) else outputChatBox("#0000FF* #FFFFFFAuto-login is already #FF0000DISABLED#FFFFFF!",255,255,255,true) xmlUnloadFile(xmlFile) end end end addCommandHandler("disableauto", removeAutoLogin) -- Enable autologin function addAutoLogin() local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then local status = xmlNodeGetAttribute(xmlFile,"autologin") if status == "false" then xmlNodeSetAttribute(xmlFile,"autologin","true") outputChatBox("#0000FF* #FFFFFFAuto-login is now #00FF00ENABLED#FFFFFF! You will be automatically logged in every time you join the server.",255,255,255,true) setTimer(outputChatBox,1000,1,"#0000FF* #FFFFFFTo #FF0000DISABLE#FFFFFF auto-login, use #ABCDEF/disableauto#FFFFFF!",255,255,255,true) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) else outputChatBox("#0000FF* #FFFFFFAuto-login is already #00FF00ENABLED#FFFFFF!",255,255,255,true) xmlUnloadFile(xmlFile) end end end addCommandHandler("enableauto", addAutoLogin) -- LOGIN PLAYER function onClickLogin(button,state) if(button == "left" and state == "up") then if (source == btnLogin) then username = guiGetText(editUsername) password = guiGetText(editPassword) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts) xmlFileHandler() end end end -- REGISTER PLAYER function onClickRegisterConfirm(button,state) if(button == "left" and state == "up") then if (source == btnConfirmRegistration) then username = guiGetText(editRegistrationUsername) password = guiGetText(editRegistrationPassword) passwordConfirm = guiGetText(editRegistrationRepeatPassword) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password,passwordConfirm) end end end -- Open registration window function onClickRegisterToggle(button,state) if(button == "left" and state == "up") then if (source == btnToggleRegister) then guiSetVisible(registerWindow, true) guiBringToFront(registerWindow) guiSetInputEnabled(true) showCursor(true) end end end -- Cancel registration function onClickCancel(button,state) if(button == "left" and state == "up") then if (source == btnCancel) then guiSetVisible(mainWindow, true) guiSetVisible(registerWindow, false) guiSetInputEnabled(true) showCursor(true)
  16. same problem no solution. tried everything set static internal ip opened all ports singly and in mass Cisco Linksys Router E900 openports and https://nightly.multitheftauto.com/ports/ both report all ports are closed Port 22126 UDP is closed. Players can not browse! Port 22003 UDP is closed. Players can not join! Port 22005 TCP is closed. Players can not download!
  17. And could i implement these in my loginpanel_client.lua or loginpanel_server.lua, or is this an mta client change?
  18. I would like to enable the thieving van, night time house prowling, and drop-off garage for payment with night time limit to my Bank Sytem (bank) account in my MTA game.... any ideas how some or any of this can be done?
  19. I need to force user nicknames (as visible in chat and on screen) to 4-10 characters, no color codes, in all caps. I know it is the mta client which defines the nickname you see despite the login panel account name, can I change this with my login_panel, or any other way?
  20. Why is the sky blue? And where is a basic description to MTA > Host Game > Resources? Example: "as-supermarket" resource... what is this and what does it and the 100 other non-descriptively named Stock MTA resources do?
  21. I am thinking about hosting my own game. What considerations should i be concerned with for hosting a long term large room. 1) Do i need a lot of ram? 2) Can i run MTA 1.4 in a dedicated mode with no visual interface for game play to reduce processor load on an i3 3.2? 3) What is the bandwidth dependency on me per user for a racing game? (do they connect P2P or is all interaction through me?) 4) How many users would a rock solid 5mb dsl support? ..anything else i should be concerned with?
×
×
  • Create New...