Jump to content

botder

MTA Team
  • Posts

    524
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by botder

  1. for i, map in ipairs(...) do -- ... Maps[i] = getResourceInfo(map, "name") end I wanted to tell you that this code may leave empty nil slots in the table Maps, which will make your loop later fail. That is how your table may look like (= No map found) Maps = { [1] = nil, [2] = "Map Name A", [3] = nil, [4] = nil, [5] = nil, [6] = "Map Name B", [7] = "Map Name A" }
  2. Create your ship.png as texture when the resource starts. (use DXT5 compressed and textureEdge "clamp") dxCreateTexture
  3. Are those floats/booleans same for each player? Why do not simply use the trigger_Event functions?
  4. function createteam () Police = createTeam ( "Police", 0, 0, 255 ) end addEventHandler("onResourceStart", getRootElement(), createteam) Replace getRootElement() with resourceRoot immediately.
  5. It's probably a serverside function and does not exist clientside.
  6. You should add debug to know what happens and what not. I didn't mean warnings/errors in debugscript. https://wiki.multitheftauto.com/wiki/Debugging
  7. Add more debug code to check what gets called and what not. (outputDebugString)
  8. I don't understand your problem. Do you have any warnings/errors in debugscript? What should happen, what does not happen and what is it doing now?
  9. botder

    [HELP] Tables

    The backpack is not an element, you can't use destroyElement on it. Anyway, that should be enough to delete the backpack: Backpack.list[player] = nil
  10. Maps[i] = getResourceInfo(map, "name") Change it to: Maps[#Maps + 1] = getResourceInfo(map, "name")
  11. Maybe some resources don't exist clientside (only the running ones)?
  12. local accountID = getElementData(source, "account:id") Variable source does not exists in that scope (= nil). function getMysql(accountID) -- ... end addCommandHandler("mysqlm", setMysql) The command handler function, getMysql, has always 2 parameters at the front: function command_handler( element player, string commandName, ... args ) That means, you have to replace the parameter accountID with player and add a line in that function, which creates the accountID variable with the accountID from the player. function getMysql(player) local accountID = getElementData(player, "account:id") if not accountID then return outputChatBox("You have to login to use this command", player) end -- ... end
  13. It should be pretty easy to find my skype. Anyway, here is your fail, maybe: local result = mysql:query("SELECT job FROM accounts WHERE id='" .. accountID .. "'") SELECT job FROM accounts WHERE id='5' Your `id` column should be an INTEGER type and you compare it with a STRING type. You have to remove the single quotation mark '. SELECT job FROM accounts WHERE id=5
  14. WHERE id='5' You query is probably comparing a number with a string, example: WHERE 5='5'
  15. result = "SELECT * FROM accounts WHERE id=?",accountID setElementData (source,"Job",result[1].Job) You didn't even use 'mysql_query' to grab the result.
  16. botder

    help me!

    https://wiki.multitheftauto.com/wiki/Se ... tagShowing
  17. botder

    HASH

    Well, the MTA source code also shows you the same piece of code, but in C++. // SHA256 + salt + type m_strSha256 = strPassword.SubStr( 0, 64 ); m_strType = strPassword.SubStr( 64, 1 ); m_strSalt = strPassword.SubStr( 65, 32 ); //-- SHA256 + type + salt $strSha256 = substr( $hash, 0, 64 ); $strType = substr( $hash, 64, 1 ); $strSalt = substr( $hash, 65, 32 );
  18. botder

    [HELP] Tables

    You have to create a backpack for each player. There is no magic done behind my "class" which will automatically give each player an individual backpack. You have to do that part on your own. I had the time and extended that class: items.lua http://pastebin.com/EukyHHfH backpack.lua http://pastebin.com/07HPp8kr player.lua http://pastebin.com/0UzmRhys
  19. botder

    about php

    http://php.net/manual/en/function.isset.php if (!isset($info["servername"])) { }
  20. botder

    [HELP] Tables

    How do you use that Backpack "class" in your code? Your given example code gives me no errors.
  21. botder

    [HELP] Tables

    What do you mean with slots? This backpack "class" allows unlimited items. You could of course give the items more variation by adding weight, expiration time, poison level, alcoholic level, max stack size. Furthermore, your backpack could also have more variation by adding different types with other base-weight, slot count (you probably mean that), durability and more.
  22. Edit: You could also copy the "util" code to each resource but you would have to maintain the code in each resource. Resource A: (e.g. called util) This resource only serves the code by calling its exported function. <meta> <script src="script.lua"/> <export function="getCode"/> </meta> LUACODE = [===[ local _outputChatBox = outputChatBox function outputChatBox(message, target, _, _, _, colorcoded) return _outputChatBox(message, target, 0, 255, 0, colorcoded) end ]===] function getCode() return LUACODE end Resource B This resource has to load the code from util on start. <meta> <include resource="util"/> <script src="script.lua"/> </meta> loadstring(exports.util:getCode())()
  23. You could only change the texture with shaders, not the complete model.
  24. for i, v in pairs ( e ) do for i, v in pairs ( v ) do Does that even work? You may try giving your variables other names. By the way, you should give your variables better names, because it's pain to read your code with all the shortcuts "x, y, z, a, b, v, c"
  25. botder

    HASH

    I don't know if the algorithm is still working, but I found this piece of PHP code: https://wiki.multitheftauto.com/wiki/Account_PHP
×
×
  • Create New...