Jump to content

2013martin1212

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by 2013martin1212

  1. Thanks its works fine , and KariiiM i have an other can u help me abot the saving system ? i want to move the internal.db to mysql its is possible to do it ?
  2. with the resource was start and i want to restart the resource each 30 sec
  3. i want to the tent to spawn 0,0,0 cordinates automaticaly and not with the command
  4. 2013martin1212

    Help

    I want to this script to spawn the object automaticali on the server with x y position on the map i have this script function tentadayz(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then do local x, y, z = getElementPosition(thePlayer) tent = createObject(964, x + 5, y, z - 1) tentCol = createColSphere(x + 5, y, z, 4) attachElements(tentCol, tent, 0, 0, 0) setElementData(tentCol, "parent", tent) setElementData(tent, "parent", tentCol) setElementData(tentCol, "tent", true) setElementData(tentCol, "vehicle", true) setElementData(tentCol, "MAX_Slots", 500) setElementData(tentCol, "M4", 100) setElementData(tentCol, "Dmr", 100) setElementData(tentCol, "Dmr Mag", 300) setElementData(tentCol, "M4 Mag", 100) setElementData(tentCol, "AK-47", 400) setElementData(tentCol, "AK Mag", 100) setElementData(tentCol, "Coyote Backpack", 50) setElementData(tentCol, "Toolbox", 100) setElementData(tentCol, "Desert Eagle Mag", 100) setElementData(tentCol, "Desert Eagle", 100) setElementData(tentCol, "Ghillie Suit", 50) setElementData(tentCol, "DMR Mag", 100) setElementData(tentCol, "DMR", 100) end else end outputChatBox("egy lada fegyver lekerve!", thePlayer, 100, 255, 100) end addCommandHandler("lada-fegyver", tentadayz)
  5. Hello all i want to make a carshop, like in the picture, but in the DayZ version. i start the script and its looks like this : A képet a Képfeltöltés.hu tárolja. http://www.kepfeltoltes.hu function SpawnDayZPatriot(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then do local x, y, z = getElementPosition(thePlayer) veh = createVehicle(470, x +5, y, z) vehCol = createColSphere(x +5, y, z, 2.5) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", 10) local tires, engine, parts = getVehicleAddonInfos(getElementModel(veh)) setElementData(vehCol, "Tire_inVehicle", 0) setElementData(vehCol, "Engine_inVehicle", 1) setElementData(vehCol, "Parts_inVehicle", 1) setElementData(vehCol, "spawn", { 470, x, y, z }) setElementData(vehCol, "fuel", 100) setTimer(outputChatBox, 50, 1, "#6002B1[VSC]#FFFFFF-Patriot has been spawned!", thePlayer, 171, 205, 239, true) end else outputChatBox("#6002B1[VSC]#FF0000-You are not a admin!", thePlayer, 171, 205, 239, true) end end addEventHandler("spawnpatriot", SpawnDayZPatriot) vehicleAddonsInfo = { { 470, 4, 1, 1 } } function getVehicleAddonInfos(id) for i, veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2], veh[3], veh[4] end end end vehicleFuelInfo = { {470, 0.1} } function getVehicleAddonInfos(id) for i, veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2], veh[3], veh[4] end end end vehicleFuelTable = { {470, 100} } function getVehicleMaxFuel(loot) local modelID = getElementModel(getElementData(loot, "parent")) for i, vehicle in ipairs(vehicleFuelTable) do if modelID == vehicle[1] then return vehicle[2] end end return false end function onPlayerEnterDayzVehicle(veh, seat) local col = getElementData(dayZVeh, "parent") local id = getElementModel(dayZVeh) if not seat == 1 then return end local tires, engine, parts = getVehicleAddonInfos(id) setVehicleEngineState(dayZVeh, false) setElementData(dayZVeh, "maxfuel", getVehicleMaxFuel(col)) setElementData(dayZVeh, "needtires", tires) setElementData(dayZVeh, "needengines", engine) setElementData(dayZVeh, "needparts", parts) if getElementData(col, "Tire_inVehicle") or 0 < tonumber(tires) then setVehicleEngineState(dayZVeh, false) return end if getElementData(col, "Engine_inVehicle") or 0 < tonumber(engine) then setVehicleEngineState(dayZVeh, false) return end if not getElementData(col, "Parts_inVehicle") then setElementData(col, "Parts_inVehicle", math.random(0, parts)) end if getElementData(col, "fuel") or 1 >= 0 and not getElementModel(dayZVehBob) == 509 then triggerClientEvent(source, "displayClientInfo", source, "Vehicle", "No tank left in this vehicle!", 22, 255, 0) setVehicleEngineState(dayZVehBob, false) return end end And i want to change this to a x, y,z kordinates to spawn and not to commandspawn and when the car was spawn its need to be froozen and when some player was sit on it then one panel was pop up and tell the car price if he can pay for the price then the car was out of froze then the player can use it ÉD
  6. 2013martin1212

    Help

    I started to learn the lua and i stock one thing I want to the script if the player was stand in to the marker then he just set it to the different dimenson local marker = createMarker(13,1,3,"checkpoint",4.0,0,0,255,255) function onPlayerEnterVehicle ( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) setElementDimension ( source, 1 ) end addEventHandler ( "onMarkerHit", marker, onPlayerEnterVehicle ) This is my server side some one please help me to fix it and explain what i need to change and why , because i want to learn it and not just ask for help always
  7. 2013martin1212

    Help

    I want to make a script which like an event like in gta v or in ffs but a bit different way if i am stand in to the marker then the marker was warp me to the event , i no how to do some parts but this is my time to try to make this event so please help. local myMarker = createMarker (-696.45972 960.47467 12.28255, "cylinder", 4, 0, 0, 255,255 ) --- Marker created function MarkerHit( hitElement, setElementPosition ) setElementPosition ( source, 0, 0, 0 ) end addEventHandler( "onMarkerHit", setElementPosition, MarkerHit ) ---* But i want to start a race map there and play a race resource but the play still works as well --* maybe i need to put to the other dimension i dont no ,if some one no the way to do it please help thanks. * But i want to start a race map there and play a race resource but the play still works as well * Maybe i need to put to the other dimension i dont no ,if some one no the way to do it please help thanks.
  8. i think you no the roleplay servers i want that type a admin system
  9. no because if i have a permision to the admin acl then i can use the pane, but if have a permision to the offduty then i dont have a permision to use the panel But is u have a better idea to make a script for the admins like they can play out the duty and they can use the commannds only if they are on duty then dont have unfair in game maybe now u get me because my english is not the best
  10. something like this addCommandHandler ( "duty", function (thePlayer) if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "OffDutyAdmin" )) then --- he was set in to the admin acl group but i dont no the lua word else if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "Admin" )) then ---* he was get back the OffDutyAdmin group and removed from the admin group end end)
  11. yes something like that If a player with admin acl type in offduty then he remove the admin acl team and he get a offduty acl group, and if the player was type in duty then he get admin acl and he was removed from the offduty acl
  12. I want like if a player in OffDuty acl type in duty then he get a Admin acl and removed from the OffDuty acl group and if a player in Admin acl type in offduty then he get in to the offduty acl group and removed from the admin acl group
  13. Hello all i want to create a new admin system with acl, but i stock I want to make like if the OffDutyAdmin type in duty then he get admin and he type in duty again the he turn to the offdutyAdmin acl which is same level like a normal player, but he can use the command to turn back to the admin duty and the normal players cant I read some wiki and i make like this but something is wrong function assignNewTeam ( source, commandName, teamName ) local theTeam = createTeam ( Admin ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("OffDutyAdmin")) then setPlayerTeam (source, theTeam) end addCommandHandler ( "duty", assignNewTeam )
  14. now i figure out the script works fine if i have a charakter on the database, but if i dont have the doesnt load up the other reource which is a character creator , i give this lua to that but it doesnt work triggerClientEvent(thePlayer, "createChar", getRootElement()) triggerClientEvent(thePlayer, "hideLGP", getRootElement())
  15. How i can make a lobby system like in tg or ffs when the player was join to the server the spawn one position on the map and then there has 3 or 4 marker which is bring him to the race or dm or dd map to play
  16. Hello all i make a login panel which is works fine but after when i login then everything is black and i can use the admin panel and all panels simply just doesnt show the charakter. there is my login panel when i join to the server :http://kepfeltoltes.hu/150701/mta-screen_2015-07-01_13-16-08_www.kepfeltoltes.hu_.png and there is my login panel when i log in to the server and restart the resource : http://kepfeltoltes.hu/150701/mta-screen_2015-07-01_13-15-54_www.kepfeltoltes.hu_.png
  17. i now there is lots of login panel but i want to create one on my own not to edit, and if i download one then i doesnt learn it because most script are complied
  18. i get this script from here ..https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI#A_tutorial_to_make_a_login_window
  19. I change it to this ,sourceS function loginPlayer (thePlayer, username, password) local account = getAccount (username, password) if (account ~= false) then logIn ( thePlayer, account, password ) else outputChatBox("Wrong username or password!", thePlayer, 255, 255, 0) end end addEvent("submitLogin", true) addEventHandler("submitLogin", root, loginPlayer) but still not working. sourceC: function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) -- define new X and Y positions for the first label X = 0.0825 Y = 0.2 -- define new Width and Height values for the first label Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window) guiCreateLabel(X, Y, Width, Height, "Username:", true, wdwLogin) -- alter the Y value, so the second label is slightly below the first Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password:", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50 guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) -- make the window invisible guiSetVisible(wdwLogin, false) end addEventHandler("onClientResourceStart", getResourceRootElement(), function () -- create the log in window and its components createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to My MTA:SA Server, please log in.") -- if the GUI was successfully created, then show the GUI to the player if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) end ) function clientSubmitLogin(button,state) if button == "left" and state == "up" then local username = guiGetText(edtUser) local password = guiGetText(edtPass) if username and password then triggerServerEvent("submitLogin",getRootElement(),username,password) guiSetInputEnabled(false) guiSetVisible(wdwLogin,false) showCursor(false) else outputChatBox("Please enter a username and password.") end end end
  20. I change it the "LogIn" to submitLogin , but still not working
  21. Drakath i am new in lua so please can you explain to me what you mean thanks
  22. i cant log in to the server i try to make a basic login panel but i cant log in , but the mysql connection with the exports is works and doesnt show me any problem in the debugscript
  23. i make a login panel what the wiki shows but i cant find any tutorial about the mysql login panel and i try to make one with scracth there what i get now its a basic but i want to learn it firts the lua can someone help with it ? There is my sourceC file function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) -- define new X and Y positions for the first label X = 0.0825 Y = 0.2 -- define new Width and Height values for the first label Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window) guiCreateLabel(X, Y, Width, Height, "Username:", true, wdwLogin) -- alter the Y value, so the second label is slightly below the first Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password:", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "username", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "password", true, wdwLogin) -- set the maximum character length for the username and password fields to 50 guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) -- make the window invisible guiSetVisible(wdwLogin, false) end addEventHandler("onClientResourceStart", getResourceRootElement(), function () -- create the log in window and its components createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to My MTA:SA Server, please log in.") -- if the GUI was successfully created, then show the GUI to the player if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) end ) function clientSubmitLogin(button,state) if button == "left" and state == "up" then local username = guiGetText(edtUser) local password = guiGetText(edtPass) if username and password then triggerServerEvent("submitLogin",getRootElement(),username,password) guiSetInputEnabled(false) guiSetVisible(wdwLogin,false) showCursor(false) else outputChatBox("Please enter a username and password.") end end end And there is my sourcS file function loginPlayer (thePlayer, username, password) local account = getAccount (username, password) if (account ~= false) then logIn ( thePlayer, account, password ) else outputChatBox("Wrong username or password!", thePlayer, 255, 255, 0) end end addEvent("LogIn") addEventHandler("LogIn", loginPlayer)
×
×
  • Create New...