Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. I don't recommend using XML, because if you place to man houses it will make your server laggy. I would recommend sqlite/mysql. (This could be a good MySql housing sysetm: https://community.multitheftauto.com/index.php?p= ... ls&id=5228 )
  2. Problem solved, it was a shader panel that i had downloaded... So, if you have a shader panel and your getting this prob, just delete he shader resource (the community one: https://community.multitheftauto.com/index.php?p= ... ls&id=6184 )
  3. Functions: onPlayerLogin -- Event setElementPosition -- Function
  4. You can request Castillo @ http://mtamarket.com/
  5. I tried both of those, but they don't work
  6. Lets just say, in this interior (int 5) the camra looks like that, i have no idea wtf is wrong with it either... code: local intoMarker = createMarker(2105.0068359375, -1806.521484375, 14.5546875, 'arrow', 2, 255, 255, 0, 100) local outMarker = createMarker(372.0361328125, -133.5166015625, 1002.4921875, 'arrow', 2, 255, 255, 0, 100) setElementInterior(outMarker,5) function teleport(player) if ( source == intoMarker and getElementType(player) == "player") then setElementPosition(player,375.7626953125, -131.25, 1002) setElementInterior(player,5) elseif ( source == outMarker and getElementType(player) == "player") then setElementPosition(player,2099.5078125, -1806.6220703125, 14) setElementInterior(player,0) end end addEventHandler("onMarkerHit", root, teleport)
  7. Hey guys, im making a vehicle save system based on sqlite. I don't know how to make a vehicle only save once, because how i have it, the vehicles are saving a new row each time, so each car will create a new row every second, and i only want 1 vehicle in the sqlite once... I don't think that makes since, but lets just say every car is creating a new row every second, and i what the rows to update... and if there isnt a row for that vehicle, then create one.. connectToDb = dbConnect( "sqlite", "sql/saves.db" ) addEventHandler('onResourceStart',getResourceRootElement(), function () if (not connectToDb) then outputChatBox("ERROR: saves.db has failed to load!",255,0,0) else dbExec ( connectToDb, "CREATE TABLE IF NOT EXISTS 'vehciles' ( rowID INT PRIMARY KEY, id TEXT, x INT, y INT, z INT, int INT, dim INT )" ) dbQuery(dbLoadVehiclesOnResourceStart, connectToDb, "SELECT * FROM vehciles") end end ) function dbLoadVehiclesOnResourceStart(queryHandle) local sql = dbPoll(queryHandle, 0) if sql and #sql > 0 then for index, sqlRow in ipairs(sql) do local id = sqlRow['id'] local x = sqlRow["x"] local y = sqlRow['y'] local z = sqlRow['z'] local int = sqlRow['int'] local dim = sqlRow['dim'] vehicle = createVehicle(id,x,y,z) setElementInterior(vehicle,int) setElementDimension(vehicle,dim) end end end setTimer( function () for _,car in ipairs (getElementsByType('vehicle')) do if (getElementData(car,'vehOwner')=="spawners") then else local id = getVehicleModelFromName(getVehicleName(car)) local x,y,z = getElementPosition(car) local int = getElementInterior(car) local dim = getElementDimension(car) dbExec ( connectToDb, "INSERT INTO vehciles ( id, x, y, z, int, dim ) VALUES ( ?, ?, ?, ?, ?, ? )", id, x, y, z, int, dim) --dbExec ( connectToDb, "INSERT INTO houses ( city, zone, owner, x, y, z, int, dim ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )", city, zone, none, x, y, z, int, dim ) end end end, 1000, 0 ) So, basicly its this is what is doing: and, i only want 1 row per car... not 500000000 rows a car.
  8. Im trying to make my housing system on sqlite, so that my server dosn't lag, but for some reason i keep on getting this error: [2013-03-09 11:14:09] WARNING: test\server.lua:25: dbExec failed; SQL logic error or missing database Here is my script: connectToDb = dbConnect( "sqlite", "housing.db" ) addEventHandler('onResourceStart',getResourceRootElement(), function () if (not connectToDb) then outputChatBox("ERROR: Housing.db has failed to load!",255,0,0) else --dbExec ( connectToDb, "CREATE TABLE IF NOT EXISTS 'houses' ( city TEXT PRIMARY KEY, zone INT, x INT, y INT, z INT, int INT, dim INT )" ) dbExec ( connectToDb, "CREATE TABLE IF NOT EXISTS 'houses' ( rowid INT PRIMARY KEY, city TEXT, zone TEXT, x INT, y INT, z INT, int INT, dim INT )" ) end end ) addCommandHandler("house", function (player) local x,y,z = getElementPosition(player) local city = getZoneName(x,y,z,true) local zone = getZoneName(x,y,z) -- x,y,z,int,dim createHouse(city,zone,x,y,z,math.random(1,10),math.random(0,5000)) end ) function createHouse(city,zone,x,y,z,int,dim) local insertTheNewHouse = dbExec ( connectToDb, "INSERT INTO houses VALUES (?,?,?,?,?,?,?,?)","NULL",city,zone,x,y,z,int,dim) newHousePickup = createPickup(x,y,z,3,1272,500) end
  9. You could also, remove "cancelEvent()" and just make it set the name, to what it was like: addEventHandler ( "onPlayerChangeNick", root, function (old) setPlayerName(source,old) outputChatBox ("Du darfst deinen Namen nicht umändern! Frage einen Admin!", source, 255,0,0) end )
  10. Thank you for that, but now the player's wanted star will not go above 1, no matter how many arrest points they have.... \ function checkPlayerArrestPoints() for _, player in ipairs(getElementsByType("player")) do local getPoints = tonumber(getElementData(player,'arrestPoints')) if (getPoints<0) then setPlayerWantedLevel(player,0) elseif (getPoints>0) then setPlayerWantedLevel(player,1) elseif (getPoints>1000) then setPlayerWantedLevel(player,2) elseif (getPoints>4000) then setPlayerWantedLevel(player,3) elseif (getPoints>6000) then setPlayerWantedLevel(player,4) elseif (getPoints>8000) then setPlayerWantedLevel(player,5) elseif (getPoints>10000) then setPlayerWantedLevel(player,6) end end end setTimer(checkPlayerArrestPoints,500,0)
  11. Hey, im making an arrest point system, that sets your wanted level based on your wanted points, and this is what i got: setTimer( function (player) for _, player in ipairs(getElementsByType("player")) do local getPoints = getElementData(player,'arrestPoints') if (getPoints>0) then setPlayerWantedLevel(player,1) elseif (getPoints>300) then setPlayerWantedLevel(player,2) elseif (getPoints>900) then setPlayerWantedLevel(player,3) elseif (getPoints>1500) then setPlayerWantedLevel(player,4) elseif (getPoints>2300) then setPlayerWantedLevel(player,5) elseif (getPoints>2750) then setPlayerWantedLevel(player,6) end end end, 1000, 0 ) The Error: [2013-03-05 10:45:28] ERROR: [ROG]Arrestsystem\server.lua:121: attempt to compare number with string
  12. Hey guys, im making a DX panel work for all resolutions, but i cannot get the dx text to create in the correct position... xDrawBorderedDescText("Username:",(resX/2) - (609/2) + 130, (resX/2) - (400/2) - 40, 609, 422, tocolor(255, 255, 255, 255), 2, "default", "left", "top", false, false, true, false, false) -- Username Text dxDrawBorderedDescText("Password: ", (resX/2) - (609/2) + 130, (resX/2) - (400/2) + 20, 609, 475, tocolor(255, 255, 255, 255), 2, "default", "left", "top", false, false, true, false, false) -- Password Text dxDrawBorderedDescText("Login/Register Panel", X, 350, resX - 300, 380, tocolor(255, 255, 255, 255), 3, "default", "center", "center", false, false, true, false, false)-- Label
  13. Im making a robbing script, but im having issues with the timer. The "source" wont carry over into the timer, and i don't know how to make it.... so, it wont give the player the money. cash = math.random(3000,8000) addEventHandler("onPlayerTarget",root, function (target) if (getElementData(source,"Job")=="Robber") then if (getElementData(target,'thePoorFuckingSeller')=="fuckEmUp") then if (getElementData(source,'robbingBurgurShot')=="true") then triggerClientEvent(source,'message:addMessage',source,'Robbery: Your already robbing a fast food restaurant!') else outputChatBox("Robbery: You have started the robbbery. Don't get killed, or arrested.",source,255,255,0) setElementData(source,'robbingBurgurShot','true',true) payTimer = setTimer( function () givePlayerMoney(source,cash) outputChatBox("Robber: You have robbed Burgur Shot and have been paid $"..cash,source,0,255,0) setElementData(source,"robbingBurgurShot","false",true) end, 3000, 1 ) end end end end )
  14. It dosnt ban him. Its making XML of players, and if the player who joins Serial is in bans.xml, it should show the screen. So really the player never gets banned, he just cannot play.
  15. GUIEditor = { button = {} } addEventHandler("test", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, GUIEditor.window[1]) end ) function jetpackPanel(keyPresser) if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false, false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true, true) end end bindKey("f9", "down", GUIEditor.window[1])
  16. I have made this script, but when the player joins it will not check his serial to see if he is in bans.xml! I'm not sure how to fix this. (Server) addEventHandler('onPlayerJoin',root, function () local file = xmlLoadFile("bans.xml", "bans") for k,v in ipairs(xmlNodeGetChildren(file)) do local hisSerial = xmlNodeGetAttribute(v,"serial") local hisIp = xmlNodeGetAttribute(v,"IP") local banner = xmlNodeGetAttribute(v,"banner") if (getPlayerSerial(v)==hisSerial) then triggerClientEvent(v,'bans:heJoinedAndIsBanned',v,banner,hisIp,hisSerial) end end end ) (Client) local url = "http://www.rog-mta.tk" function dx() dxDrawRectangle(0, 0, 1800, 1000, tocolor(0, 0, 0, 255), false) dxDrawText("Your Serial Is Banned!", 0, 0, 1279, 51, tocolor(255, 0, 0, 255), 4, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("( "..getPlayerSerial(localPlayer).." )", 0, 51, 1279, 102, tocolor(255, 25, 0, 255), 3, "default", "center", "center", false, false, false, false, false) --dxDrawText("IP: "..getPlayerIp(localPlayer), 0, 847, 1279, 950, tocolor(0, 255, 0, 255), 3, "default-bold", "center", "center", false, false, false, false, false) dxDrawImage(250, 102, 800, 800, "image.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent("bans:heJoinedAndIsBanned",true) addEventHandler("bans:heJoinedAndIsBanned",root, function (banner,hisIp,hisSerial) addEventHandler('onClientRender',root,dx) showChat(false) showCursor(true) end )
  17. I made this script, to only let logged in players to talk with chat, but it didnt work... addEventHandler("onPlayerChat",root, function (player) if (isGuestAccount(getPlayerAccount(player))) then cancelEvent() outputChatBox("Error: You need to be logged in to use the chat box.",player,255,0,0) end end )
  18. YOu could just use setElementData and getElementData
×
×
  • Create New...