Jump to content

DLmass

Members
  • Posts

    74
  • Joined

  • Last visited

Everything posted by DLmass

  1. None of those are working, I've replaced everything you guys said. Still no success..
  2. Hey guys! local screenW, screenH = guiGetScreenSize() local marker = createMarker(1810.2548, -1293.1728, -3.0, "cylinder", 2.0, 250, 50,0, 150) window = guiCreateWindow((screenW - 243) / 2, (screenH - 467) / 2, 243, 467, "", false) guiWindowSetSizable(window, false) gridlist = guiCreateGridList(11, 21, 222, 436, false, window) guiGridListAddColumn(gridlist, "Elevator", 0.9) guiSetVisible (window, false) function open(hitPlayer) if hitPlayer == localPlayer and not isPedInVehicle(hitPlayer) then guiSetVisible (window, true) showCursor(true) local file = xmlLoadFile "Teleports.xml" end end addEventHandler("onClientMarkerHit", marker, open) function addTeleports() guiGridListClear( gridlist ) if guiGetVisible(window) == true then local file = xmlLoadFile "Teleports.xml" if file then for i,v in ipairs( xmlNodeGetChildren( file ) ) do local name = xmlNodeGetAttribute( v,"name") local row = guiGridListAddRow( gridlist ) guiGridListSetItemText ( gridlist, row, 1, tostring(name), false, true ) end end end end function teleport( ) local row,col = guiGridListGetSelectedItem( source ) if row and col and row ~= -1 and col ~= -1 then local name = guiGridListGetItemText( source, row, 1 ) local file = xmlLoadFile "Teleports.xml" if file then for i,v in ipairs( xmlNodeGetChildren( file ) ) do local teleportName = xmlNodeGetAttribute( v,"name" ) if teleportName == name then local poX = xmlNodeGetAttribute( v,"posX" ) local poY = xmlNodeGetAttribute( v,"posY" ) local poZ = xmlNodeGetAttribute( v,"posZ" ) setElementPosition( getPedOccupiedVehicle( localPlayer ) or localPlayer, tonumber( poX ), tonumber( poY ), tonumber( poZ + 2 ) ) end end end end end addEventHandler( "onClientGUIDoubleClick",gridlist, teleport, false) When the player enter the marker the GUI shows, but the xml with locations wont load. Can anyone help me?
  3. DLmass

    Mysql login

    Add me on skype: dlmass.feelnice I guess I'm to dumb to understand
  4. DLmass

    Mysql login

    Hey there, thanks for the answer! I really appreciate it I think there are two types of mysql https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL https://wiki.multitheftauto.com/wiki/Se ... _functions EDIT: I'm confused, would you like to add me on skype?
  5. Okay, thank you for your help and kindness lock the topic please.
  6. Aren't there an easier way to do it, I don't really have access to the server files..
  7. I'd like to remove myself from an column, with runcode..
  8. exports [ "scoreboard" ]:scoreboardRemoveColumn ( TEAM, getPlayerFromName("DLmass") ) Something like this?
  9. oh, I thought I could make something like this.. exports [ "scoreboard" ]:scoreboardClearColumns(getPlayerFromName("[R*]DLmass"))
  10. Hey, how can I hide my name. Like making myself invisible?
  11. I've tried several things, but nothing helps. Will someone solve this for me?
  12. addEvent("onRegister",true) addEvent("onLogin",true) function resourceStart () handler = dbConnect("mysql","dbname=mta;host=localhost","root","1234567890") if handler then outputServerLog("(Username-System) Connected to the database server successfully!") else outputServerLog("(Username-System) Connection to the database server could not be established!") end end addEventHandler("onResourceStart",getResourceRootElement(),resourceStart) function playerJoin() setPlayerMuted(source, true) end addEventHandler ( "onPlayerJoin", getRootElement(), playerJoin ) function onRegister ( Username , Password ) local sql = dbQuery(handler,"SELECT * FROM PlayerInfo WHERE Username = '"..Username.."'") local result,num_rows = dbPoll(sql, -1) if num_rows == 0 then local encryptedPassword = md5(Password) dbExec(handler,"INSERT INTO PlayerInfo (Username, Password) VALUES ( '"..Username.."','"..encryptedPassword.."')") outputChatBox("You have registered successfully!",source,125,0,0) else outputChatBox("You are already registrered!",source,125,0,0) end end addEventHandler("onRegister",getRootElement(),onRegister) function onLogin ( Username , Password ) local encryptedPassword = md5(Password) local sql = dbQuery(handler,"SELECT * FROM PlayerInfo WHERE Username = '"..Username.."' AND Password = '"..encryptedPassword.."'") local result,num_rows = dbPoll(sql, -1) if num_rows == 1 then outputChatBox("You have successfully logged in!",source,125,0,0) triggerClientEvent(source,"closeLogin",source) spawnPlayer ( source, 0.0, 0.0, 5.0, 90.0, 0 ) setPlayerMuted(source, false) fadeCamera (source, true) setCameraTarget (source, source) else outputChatBox("Your Password or Username is wrong!",source,125,0,0) end end addEventHandler("onLogin",getRootElement(),onLogin) function saveUsernames ( Username ) -- Save in the handler local x,y,z = getElementPosition( source ) local i = getElementInterior( source ) local d = getElementDimension( source ) local skin = getPedSkin ( source ) local money = getPlayerMoney ( source ) local health = getElementHealth ( source ) local armor = getPedArmor ( source ) local wanted = getPlayerWantedLevel ( source ) local q = dbQuery(handler,"SELECT * FROM `PlayerInfo` WHERE `Username` = '"..Username.."'") if(mysql_num_rows(q) == 0) then dbQuery( handler, "INSERT INTO PlayerInto ( `Username` , x, y, z, interior, dimension, skin, money, health, armor ) VALUES ( '"..Username.."', " .. x .. ", " .. y .. ", " .. z .. "," .. i .. ", " .. d .. "," .. skin .. "," .. money .. ", ".. health ..", ".. armor .." )" ) else res = dbQuery ( handler, "UPDATE `Username` SET x = ".. x ..", y = ".. y ..", z = ".. z ..", interior = ".. i ..", dimension = ".. d ..", skin = ".. skin ..", money = ".. money ..", health = ".. health ..", armor = ".. armor .." WHERE `Username` = '"..Username.."'") end end function loadUsernames ( Username ) -- Loading from the handler local result = dbPoll(dbQuery(handler, "SELECT * FROM PlayerInfo WHERE Username = '"..Username.."';"),-1) if result then while true do local row = mysql_fetch_assoc(result) if not row then break end setElementPosition ( source, row.x, row.y, row.z) setElementInterior ( source, row.interior ) setElementDimension ( source, row.dimension ) setPedSkin ( source, row.skin ) setPlayerMoney ( source, row.money ) setElementHealth ( source, row.health) setPedArmor ( source, row.armor ) break end end end addEventHandler ( "onLogin", getRootElement(), loadUsernames ) addEventHandler ( "onPlayerQuit", getRootElement(), saveUsernames ) I get this error [01:56:11] ERROR: Account-System\server.lua:70: bad argument #1 to 'mysql_fetch_assoc' (mysqlResult expected, got table)
  13. Hey, I'm currently making myself an nice login system that uses mysql. But I currently ran into some problems that I can't solve.. addEvent("onRegister",true) addEvent("onLogin",true) function resourceStart () handler = dbConnect("mysql","dbname=mta;host=localhost","root","1234567890") if handler then outputServerLog("(Account-System) Connected to the handler server successfully!") else outputServerLog("(Account-System) Connection to the handler server could not be established!") end end addEventHandler("onResourceStart",getResourceRootElement(),resourceStart) function playerJoin() setPlayerMuted(source, true) end addEventHandler ( "onPlayerJoin", getRootElement(), playerJoin ) function onRegister ( Username , Password ) local sql = dbQuery(handler,"SELECT * FROM PlayerInfo WHERE Username = '"..Username.."'") local result,num_rows = dbPoll(sql, -1) if num_rows == 0 then local encryptedPassword = md5(Password) dbExec(handler,"INSERT INTO PlayerInfo (Username, Password) VALUES ( '"..Username.."','"..encryptedPassword.."')") outputChatBox("You have registered successfully!",source,125,0,0) else outputChatBox("You are already registrered!",source,125,0,0) end end addEventHandler("onRegister",getRootElement(),onRegister) function onLogin ( Username , Password ) local encryptedPassword = md5(Password) local sql = dbQuery(handler,"SELECT * FROM PlayerInfo WHERE Username = '"..Username.."' AND Password = '"..encryptedPassword.."'") local result,num_rows = dbPoll(sql, -1) if num_rows == 1 then outputChatBox("You have successfully logged in!",source,125,0,0) triggerClientEvent(source,"closeLogin",source) spawnPlayer ( source, 0.0, 0.0, 5.0, 90.0, 0 ) setPlayerMuted(source, false) fadeCamera (source, true) setCameraTarget (source, source) else outputChatBox("Your Password or Username is wrong!",source,125,0,0) end end addEventHandler("onLogin",getRootElement(),onLogin) function saveAccount () -- Save in the handler local x,y,z = getElementPosition( source ) local i = getElementInterior( source ) local d = getElementDimension( source ) local skin = getPedSkin ( source ) local money = getPlayerMoney ( source ) local health = getElementHealth ( source ) local armor = getPedArmor ( source ) local sql = dbQuery(handler,"SELECT * FROM `PlayerInfo` WHERE `Username` = '"..Username.."'") if(mysql_num_rows(sql) == 0) then dbQuery( handler, "INSERT INTO PlayerInfo ( `Username` , x, y, z, interior, dimension, skin, money, health, armor, wanted ) VALUES ( '"..Username.."', " .. x .. ", " .. y .. ", " .. z .. "," .. i .. ", " .. d .. "," .. skin .. "," .. money .. ", ".. health ..", ".. armor .." )" ) else res = dbQuery ( handler, "UPDATE `Username` SET x = ".. x ..", y = ".. y ..", z = ".. z ..", interior = ".. i ..", dimension = ".. d ..", skin = ".. skin ..", money = ".. money ..", health = ".. health ..", armor = ".. armor ..", wanted WHERE `serial` = '"..Username.."'") end end addEventHandler ( "onPlayerQuit", getRootElement(), saveAccount ) function loadAccount () -- Load from the handler local result = dbQuery(handler,"SELECT * FROM `PlayerInfo` WHERE `Username` = '"..Username.."'") if result then while true do local row = mysql_fetch_assoc(result) if not row then break end setElementPosition ( source, row.x, row.y, row.z) setElementInterior ( source, row.interior ) setElementDimension ( source, row.dimension ) setPedSkin ( source, row.skin ) setPlayerMoney ( source, row.money ) setElementHealth ( source, row.health) setPedArmor ( source, row.armor ) break end end end addEventHandler ( "onLogin", getRootElement(), loadAccount ) [00:29:38] ERROR: Account-System\server.lua:67: attempt to concatenate global 'U sername' (a nil value) Well, I've tried everything.. I'd like to get some help on my way..
  14. DLmass

    dxDraw

    Very nice example, working out from that.
  15. DLmass

    dxDraw

    Yeah I know. I can use the Wiki ^^ I'm not asking for scripts or anything, What I'm asking for is a good explanation on how to do it. I went here because I've already been on the Wiki.
  16. DLmass

    dxDraw

    Hey. How do I make the this Rectangle fit every screen resolution? local state = false function BLABLABLA ( ) dxDrawRectangle(1356.0,424.0,282.0,541.0,tocolor(0,0,0,100),false) end bindKey ( "m", "down", function ( ) state = ( not state ) removeEventHandler ( "onClientRender", root, BLABLABLA ) if ( state ) then addEventHandler ( "onClientRender", root, BLABLABLA ) end end ) Thanks.
  17. hey, If I compile my script and upload to the community. Can they still use it? And it possible to compile .map files? - DLmass
  18. DLmass

    .map to .ipl

    Big bump.... Did you guys find anything. i'm searching for it to =D
  19. DLmass

    Router

    answering to late.... School router is blocking it...
×
×
  • Create New...