Jump to content

Lpsd

MTA Team
  • Posts

    320
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Lpsd

  1. (edited answer) You are inserting the ped by doing table.insert( taxidf[player].ped, { ped } ) which makes a table inside the ped table. To retrieve the ped, you'd need to do: local ped = taxidf[player].ped[1][1]; But really, unless you need it for a specific reason, you should just change the insert line to: table.insert( taxidf[player].ped, ped )
  2. Use Google to look for other YouTube APIs. or host your own YouTube downloader/converter using youtube-dl and FFmpeg.
  3. Good stuff
  4. Lpsd

    table.concat

    You don't. You need the command syntax to be different, such as: /oxquestion This is the question text|This is the answer text addCommandHandler("oxquestion",function(player, cmd, ...) local t = table.concat({ ... }, " ") local questionTable = {} local answerTable = {} local switch = false for i,v in ipairs(t) do if v == "|" then switch = true else if switch then table.insert(answerTable, v) else table.insert(questionTable, v) end end table.remove(t, i) end end) "|" is the separator for question/answer.
  5. Lpsd

    MTA not working.

    Did you try reinstalling GTASA rather than MTA? It's a problem with a GTASA file, not MTA (at least as far as I can tell from the info provided) ...GTA:SA had trouble opening the file 'TIMECYC.DAT'... Try restoring that file from the error to original, (google for ''timecyc.dat backup'' for a download) in your GTA folder. (or it may have been removed by customization/bad modding, it should be located at Program Files (x86)\Rockstar Games\GTA San Andreas\data
  6. Does that actually compress the TXD though or the images?
  7. As far as I'm aware you can't compress TXD or DFF. You should compress the images you use rather than the actual TXD. Also don't use huge dimensions for your textures if they are for something that isn't important, or something small. I don't really use many custom TXDs in my stuff but I imagine 512x512 would be the biggest you want your images to be. Again, you can't compress a DFF. File size is linked with the amount of polys used in your models, so you should work on decreasing them - this is especially true if you're downloading free models from around the web as most of them won't be optimized.
  8. https://wiki.multitheftauto.com/wiki/SetPlayerMuted
  9. Lpsd

    antiban

    I wasn't aware cancelEvent() couldn't stop the ban, however there's no need to loop through all the bans (highly inefficient), just use the banPointer parameter provided onPlayerBan edit: just checked your errors to the script I provided, it looks to me like you either tried banning a player via console or you're using a custom ban script and not utilizing the responsibleElement argument within banPlayer()/addBan() function verifyBan(banPointer, responsiblePlayer) if not isElement(responsiblePlayer) then print("responsibleElement is Console or none stated for current ban"); return false end if getElementType(responsiblePlayer) ~= "player" then return false end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then removeBan(banPointer)--Remove the ban on admin, using banPointer addBan(getPlayerIP(responsiblePlayer), nil, getPlayerSerial(responsiblePlayer), root, "Banning other admins") --Ban the offending moderator outputChatBox (getPlayerName(responsiblePlayer).." has been banned for banning admins!", getRootElement(), 255, 0, 0) -- Output the ban. end end addEventHandler ( "onPlayerBan", getRootElement(), verifyBan )
  10. Lpsd

    antiban

    I assume you used debugscript? Can you tell me what the errors are, or what exactly it is that doesn't work?
  11. Lpsd

    antiban

    This isn't a problem you should initially be trying to solve with code. You shouldn't be giving people permissions on your server if you can't trust them. However, something like this might help. If anyone tries to ban an admin the action will be blocked and they'll get banned them-self (Serial and IP ban). function verifyBan(banPointer, responsiblePlayer) if getElementType(responsiblePlayer) ~= "player" then return false end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then cancelEvent() --Cancel the ban on admin addBan(getPlayerIP(responsiblePlayer), nil, getPlayerSerial(responsiblePlayer), root, "Banning other admins") --Ban the offending moderator outputChatBox (getPlayerName(responsiblePlayer).." has been banned for banning admins!", getRootElement(), 255, 0, 0) -- Output the ban. end end addEventHandler ( "onPlayerBan", getRootElement(), verifyBan ) Not tested, try it out and see if it works.
  12. Lpsd

    antiban

    I don't get what you're trying to do. Players shouldn't have access to ban - why would admins be getting banned?
  13. Here's an example of a PHP script I found with a quick google search https://gist.github.com/tbreuss/74da96ff5f976ce770e6628badbd7dfc Combine this with the PHP SDK (https://development.mtasa.com/wiki/PHP_SDK) and the callRemote function (https://development.mtasa.com/wiki/CallRemote) to send the Player's IP to the php script and return a result.
  14. Lpsd

    Help me Plis

    local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function webBrowserRender() dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "https://wiki.multitheftauto.com/wiki/Main_Page") addEventHandler("onClientRender", root, webBrowserRender) end ) Load this script and you should have all the information you need.
  15. Hey guys, look at this random chunk of code. Can you try and decipher what problem I'm having without giving you any information whatsoever? First of all it might help to tell us what exactly the problem is. What errors are you getting? Where are your database connection details?
  16. You can't return values like that, you have to create an event running the other way (server->client) Simple example --Clientside function getData(charid) triggerServerEvent("pushData", root, charid) --send charid to server end function receiveData(info) --do something with info end addEvent("onClientReceiveData", true) addEventHandler("onClientReceiveData", root, receiveData) --Serverside function processData(charid) local thePlayer = client --client is a predefined variable, contains the client who triggered the event --use charid to get your info triggerClientEvent(thePlayer, "onClientReceiveData", thePlayer, charid) --send info back (replace "charid" with whatever you want to send) end addEvent("pushData", true) addEventHandler("pushData", root, processData)
  17. Why don't you use exported functions instead? https://wiki.multitheftauto.com/wiki/Call
  18. You're only as fast as your slowest component. Everything in your PC is important, however the main things; Plenty of RAM Fast CPU Fast Disk (SSD pref) Powerful GPU If you were looking for suggestions on PCs to buy (I assume you're looking for pre-built), then you might want to include your budget.
  19. Lpsd

    About SLUA

    I assume you're talking about file extensions - people might name their script *.slua (or .clua for that matter) to easily sort files in a directory. Other than that it's no different to your normal MTA Lua. You could have clientside code in a script called "code.slua" and it'd function fine - what matters is the definitions in the meta (type="server/client") atleast i'm pretty sure of it...
  20. Lpsd

    Help

    https://wiki.multitheftauto.com/wiki/GuiSetInputEnabled or https://wiki.multitheftauto.com/wiki/GuiSetInputMode
  21. Lpsd

    GUI skin?

    https://forum.multitheftauto.com/forum/115-custom-gui-themes/
  22. Probably because the song doesn't have any of the data? If you go to the mp3 file itself and right click > properties > details, does it have title / artist data? @koragg should work for any sound element, whether it be a stream or local file.
  23. Lpsd

    table sort

    table.sort(myTable, function(a, b) return a[1] > b[1] end) I think...
  24. Lpsd

    string.find

    local invalid_chars = {"#", "?", "!"} addEventHandler("onPlayerConnect", root, function(nick) for i=1,#invalid_chars do local escape if not string.match(invalid_chars[i], "[^a-zA-Z0-9]") then escape = "%" else escape = "" end if nick:find(escape..invalid_chars[i]) then cancelEvent(true, "Change nickname!") return end end end) I don't know about optimal, but it's definitely easier to manage. updated code to allow for escaping special characters on :find
  25. Then you should continue with the steps, and install node/npm using yum or apt-get
×
×
  • Create New...