Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/03/21 in all areas

  1. By setting items client-side you are inviting "hackers" to your server. Be aware that someday someone will exploit that you've doing it incorrectly, which will result in player copying items and so on.
    2 points
  2. More like something like this: function onLogin(username) if isAccountAdmin(username) then givePlayerAdminRights() -- put here the stuff you use to give players admin access end end function isAccountAdmin(username) local admins = {} -- creates the table in which will be added the accounts of "Admin" group local group = aclGetGroup( "Admin" ) if (group) then for _, object in ipairs(aclGroupListObjects(group) or {}) do local objType = gettok( object, 1, string.byte('.') ) -- objType: gets the object type only, which can be either "user" or "resource" if (objType == "user") then -- checks if it's a player account local _name = gettok( object, 2, string.byte('.') ) -- ignores "user." by separating that from the account name table.insert( admins, _name ) -- adds the account name to the "admins" table end end end for i, name in ipairs(admins) do -- loop through the table "admins" if name == username then return true -- we found a match end end return false -- if nothing was found end *used the 2nd example in the wiki BUT if the server is big and there are many players logging in it might cause performance issues. To prevent that you can use the code from the "isAccountAdmin" to store the admin usernames in a table but on resource start so it won't do all the operations every time someone logs in. And when a player logs in use the loop to go through all the admin usernames and check whether the player's account name is one of them or not.
    1 point
  3. Yes, I could notice that too. That's weird, because the x, y and z axis don't seem to have this behaviour, it's just the rotation. Dunno what you should do to solve it, without some workaround.
    1 point
  4. Welcome to the forums! For all the SQL operations you should use executeSQLQuery as you have already noticed. There are many examples in the wiki page which you could use. I will show you an example how your first executeSQLUpdate will be with executeSQLQuery. executeSQLQuery("UPDATE stats SET cash=?, dms=?, wins=?, owner=?, skill=?, pts=? WHERE player=?", statsCash[playerName], statsDms[playerName], statsWins[playerName], statsOwner[playerName], statsSpts[playerName], statsPts[playerName], playerName) I guess now you know how to make the other ones. Don't hesitate to ask if there is a problem!
    1 point
  5. منطقيا الموضوع حله تشوف وش هي احداثيات ورقم العالم الي فيه السجن وتحطها في كود الي ينقل اللاعب إلى السجن.
    1 point
  6. This is awesome to hear. I read through the specification document for the new community site and it looks very well scoped. Exciting things are in the works. I started my journey in MTA with mapping, then moving onto programming, and now I have worked professionally for 2 years as a product manager & software developer at a few startups. I would love to explore how I might be able to add value to the new community site. That is, if you guys are interested and have room for me! @jhxp who would be the right person to get in touch with on this? It is lovely to see MTA continue to thrive.
    1 point
  7. 1 point
×
×
  • Create New...