Jump to content

novo

Members
  • Posts

    325
  • Joined

  • Last visited

Everything posted by novo

  1. Hello, I'm having troubles when reading some map script's files because there's an ASCII character (239) appearing there, as you can see on the following images: (That symbol appearing at the beginning) http://i.gyazo.com/31cb02fa5f2e19454f714fbad07667b5.png http://i.gyazo.com/dfbead946c52e9e7dc5494eb3ca65ad9.png Here's the way I'm reading and either outputting the file's content: local hFile = fileOpen(":"..resource.."/"..name, true) if hFile then outputConsole(fileRead(hFile, fileGetSize(hFile)), root) fileClose(hFile) end And this is the file I'm reading: http://www.filedropper.com/music (I've added a download link to make sure it's the same content any time) So basically, that character is appearing and I'm not able to use loadstring because it's returning an error due to the same. I've tried by removing it but another character is appearing then (some sort of arabic character) which I'm not able to remove. I've used Linux Server 1.4 32 and 64 bits and Linux Server 1.3.5 and I've got the same problem on all. Thanks in advance.
  2. By using the command /debugscript 3 https://wiki.multitheftauto.com/wiki/Se ... ebugscript
  3. Use something like this instead: ranks = {"Founder", "Leader", "Senior", "Regular", "New", "Trial"} premissons = { ["Founder"] = { ["info"] = true, ["mote"] = true, ["kick"] = true, ["warn"] = true, ["withdraw"] = true, ["deposit"] = true, ["color"] = true, ["logs"] = true, ["invite"] = true }, ["Leader"] = { ["info"] = true, ["mote"] = true, ["kick"] = true, ["warn"] = true, ["withdraw"] = false, ["deposit"] = true, ["color"] = true, ["logs"] = true, ["invite"] = true }, ["Senior"] = { ["info"] = false, ["mote"] = true, ["kick"] = true, ["warn"] = true, ["withdraw"] = false, ["deposit"] = true, ["color"] = false, ["logs"] = false, ["invite"] = true }, ["Regular"] = { ["info"] = false, ["mote"] = false, ["kick"] = false, ["warn"] = false, ["withdraw"] = false, ["deposit"] = true, ["color"] = false, ["logs"] = false, ["invite"] = false }, ["New"] = { ["info"] = false, ["mote"] = false, ["kick"] = false, ["warn"] = false, ["withdraw"] = false, ["deposit"] = true, ["color"] = false, ["logs"] = false, ["invite"] = false }, ["Trial"] = { ["info"] = false, ["mote"] = false, ["kick"] = false, ["warn"] = false, ["withdraw"] = false, ["deposit"] = true, ["color"] = false, ["logs"] = false, ["invite"] = false } } for _, rank in ipairs(ranks) do outputChatBox(rank) for name,value in pairs(premissons[rank]) do outputChatBox(name.." => "..tostring(value)) end end
  4. He wants that when a player wins, nextmap doesn't start automatically until this player dies or reaches hunter.
  5. I also recommend you to use md5 for passwords and be sure you add security checks.
  6. novo

    Any Proplem

    addEventHandler ( 'onClientGUIClick', guiRoot, function() if ( source == GUIEditor.button[1]) then setElementModel(77,localPlayer) elseif ( source == GUIEditor.button[2]) then setElementModel(78, localPlayer) elseif ( source == GUIEditor.button[3]) then setElementModel(72, localPlayer) elseif ( source == GUIEditor.button[4]) then setElementModel(71,localPlayer) end end ) --[[function handle () if ( source == GUIEditor.button[1]) then setElementModel(77,localPlayer) elseif ( source == GUIEditor.button[2]) then setElementModel(78, localPlayer) elseif ( source == GUIEditor.button[3]) then setElementModel(72, localPlayer) elseif ( source == GUIEditor.button[4]) then setElementModel(71,localPlayer) end end for i = 1, #GUIEditor.button do addEventHandler ( 'onClientGUIClick', GUIEditor.button[i], handle) end]]
  7. There you go: (Please, note you must add some kind of security checks in order to avoid MySQL injections.). local connection = dbConnect("mysql", "dbname=testdb;host=127.0.0.1", "username", "password") if not connection then outputChatBox("Could not connect"); end -- function loginPlayer (player, username, password) local query = dbQuery(connection, "SELECT * FROM users WHERE username = '"..username.."' AND password = '"..password.."'"); local result, num_affected_rows, last_insert_id = dbPoll(query, -1); if num_affected_rows >= 1 then for i,v in pairs(result) do -- MySQL stored account data end else outputChatBox("Wrong username or password"); end end
  8. novo

    Question

    Use getAccountData and setAccountData with player's account or getElementData and setElementData if player isn't logged in
  9. novo

    Question

    Try with these functions: aclGetGroup(); -- [url=https://wiki.multitheftauto.com/wiki/AclGetGroup]https://wiki.multitheftauto.com/wiki/AclGetGroup[/url] aclCreateGroup(); -- [url=https://wiki.multitheftauto.com/wiki/AclCreateGroup]https://wiki.multitheftauto.com/wiki/AclCreateGroup[/url] isObjectInACLGroup(); -- [url=https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup]https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup[/url] -- Example code local gangs = {"Lider", "Sub-lider"} for i = 1, #gangs do if not aclGetGroup(gangs[i]) then aclCreateGroup(gangs[i]) end end function example (player, cmd, gcmd) local account = getPlayerAccount(player) if not isGuestAccount(account) then local accountname = getAccountName(account) if isObjectInACLGroup("user." ..accountname, aclGetGroup("Lider")) then -- Check if player's in Lider's acl group (gang) if gcmd == "kick" then -- Player used /gang kick end end end end addCommandHandler("gang", example)
  10. novo

    Pickups

    I know what you do mean, you must look at race's client code and check how the pickups work. You can start by looking at the code following to the line nº1352 ("Make vehicle upright") at the race_client.lua file; which must be like the following: ------------------------ -- Make vehicle upright function directionToRotation2D( x, y ) return rem( math.atan2( y, x ) * (360/6.28) - 90, 360 ) end function alignVehicleWithUp() local vehicle = g_Vehicle if not vehicle then return end local matrix = getElementMatrix( vehicle ) local Right = Vector3D:new( matrix[1][1], matrix[1][2], matrix[1][3] ) local Fwd = Vector3D:new( matrix[2][1], matrix[2][2], matrix[2][3] ) local Up = Vector3D:new( matrix[3][1], matrix[3][2], matrix[3][3] ) local Velocity = Vector3D:new( getElementVelocity( vehicle ) ) local rz if Velocity:Length() > 0.05 and Up.z < 0.001 then -- If velocity is valid, and we are upside down, use it to determine rotation rz = directionToRotation2D( Velocity.x, Velocity.y ) else -- Otherwise use facing direction to determine rotation rz = directionToRotation2D( Fwd.x, Fwd.y ) end setElementRotation( vehicle, 0, 0, rz ) end
  11. I don't see any problem in your code, I don't think that the problem will be fixed with this code but you can always try: function existsBetaKey (key) local query = dbQuery ( handler, "SELECT * FROM betakeys WHERE Key = ?", tostring(key)) result , numrows, errmsg = dbPoll (query, -1) local row = result[1] if row then return true else return false end end
  12. Drivers mis à jour pour votre carte vidéo. (Update your graphic card drivers) Je ne suis pas français, pardon pour mon mal français.
  13. I know but Micro was a good friend, I knew him. We will need to be more carefully the next time..
  14. Hello, First of all I want you to see the following proofs: - http://imageshack.us/a/img824/1945/6p2t.png (Here he joined our server and changed his nick and then he left it, acting like if I didn't see the nick change message) - http://imageshack.us/a/img689/7491/p7e.png (There you can see our login, I checked if the other scripts were running because we used commands to use them and they were running) - http://imageshack.us/a/img706/6600/30sf.png (Here he banned me after I took the 2nd proof) - http://imageshack.us/a/img856/2460/6s8y.png (Here he seems to be testing our scripts..) The situation was that my clan (SA - Skillful Area) wasn't having a vps for the public server and Crackz, one of the clan's leader and friend of the FPSServer owner, told us that Micro (FPSServer owner) was going to buy a dedicated and we would have a free vps. We were having this vps for 1 - 2 weeks but today Micro stole all our scripts and lied to prevent that we catch him, you can see that in the proofs. What do I want to say with all this? I want to prevent that Micro takes the scripts from the actual users of FPSServer and I want either to prevent that it gets new users, I want also to punish somehow Micro. I would also like to add this small quote of my conversation with Micro: (UPDATE) That was all... Remember: don't trust FPSServer / Micro anymore.
  15. attachElements(); -- [url=https://wiki.multitheftauto.com/wiki/AttachElements]https://wiki.multitheftauto.com/wiki/AttachElements[/url]
  16. I thought Skype was for private messaging. By the way, what do you see in there that makes Sniper's post valid? Anyway, I won't care about what you all say from now. I already had some clients which recieved the scripts exactly how they requested them to be. Also, GTX was kicked out from the SUT.
  17. It wasn't me who took ffs' radar. Who are you?
  18. The Scripting Union Team is composed of three scripters who have enough knowledge in lua to exert our technical around here. Our main target aims to help the new servers in order to grow up in their way. As we make service to people, we would deserve a weak amount of money as well. Our talented team can communicate in the following languages: English, French, Spanish and German. Don't hesitate to contact us if you would like some help about growing up a server. We're now capable to do a lot of scripting stuff in MTA and your projects won't be declined, we don't even ask ourselves if we have to accept yours projects or not, we accept anything concerning MTA, that's right. Contact (Skype): (You can also contact me via PM if you want!) - Crackz crackz0 - n30x radio.habbek Waiting for your great feedback with enjoyment!
  19. You can make the player download a file where you can set when the player logs in for first time: (https://wiki.multitheftauto.com/wiki/xmlCreateFile) <configuration> <loggedbefore = "false"> </configuration>
  20. novo

    dbConnect error!

    Try local hostname = "127.0.0.1" local database = "mg" local username = "db_user" local password = "db_user123@" local mysql = dbConnect("mysql", "dbname="..database..";host="..hostname, username, password) if mysql then outputChatBox("MySQL has been successfuly connected!", root, 255, 255, 255, true) end
  21. function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "object" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then if getElementModel(v) == 17950 then prevDistance = distance nearestVehicle = v end end end return nearestVehicle or false end function doSomethingWithTheNearestVeh( player ) local vehicle = getNearestVehicle( player ) if vehicle then if not getPedOccupiedVehicle( player ) then else outputChatBox ( "blabla!", player, 125, 0, 0 ) end end end addCommandHandler( "blabla", doSomethingWithTheNearestVeh )
  22. Take a look to this resource: https://community.multitheftauto.com/index.php?p= ... ls&id=3379 It's easy to use; downloadFile(serverFile, clientFile, interval) -- interval isn't needed, if you want it to go as faster possible set it to 50.
  23. Create the pickups client-side and then trigger an event at server-side for creating a col sphere. Then you just need to create a pickup handling function and to use https://wiki.multitheftauto.com/wiki/OnColShapeHit Add me to skype if you need more help: radio.habbek I will help you without problem.
×
×
  • Create New...