Jump to content

csiguusz

Members
  • Posts

    500
  • Joined

  • Last visited

Everything posted by csiguusz

  1. csiguusz

    Script

    Try this: function createExplosionForPlayer(thePlayer,command) local x,y,z = getElementPosition(thePlayer) timer = setTimer (createJihadForPlayer, 2500, 1, thePlayer, x, y, z) triggerClientEvent("playTheSound", getRootElement()) end addCommandHandler("Jihad", createExplosionForPlayer) addCommandHandler("jihad", createExplosionForPlayer) function createJihadForPlayer(thePlayer, x, y, z) local createdExplosion = createExplosion(x,y,z,2) local createdExplosion = createExplosion(x,y,z,9) local createdExplosion = createExplosion(x,y,z,10) if (createdExplosion == true) then outputChatBox(getPlayerName(thePlayer).." comitted a Jihad!") end end
  2. No, it's only necessary if you want your server to show up in the server browser. But the HTTP port is needed for downloading if you use the built-in http server and the webadmin would also be accesible on this port.
  3. csiguusz

    Question

    Yes. Although I haven't made such a thing yet it should be possible. Get the data from a page with server-sided fetchRemote, then somehow find the wanted values in the returned page.
  4. "Shodow mód" néven nem találtam semmit. A valhallát meg nem szeretem, nem is nagyon ismerem, így sajnos nem igazán tudok segíteni, nem tudom melyik mappaban lehet az, amivel gond van.
  5. Nem tudom milyen rendszert használsz, így segíteni sem tudok, de a probléma biztos valamelyik szkripttel van.
  6. Jáj. Névkitalálás sose volt az erősségem, de azért majd gondolkozok rajta. De tőlem lehet majd az "Epineprhine" is.
  7. Yes, there are two other ports. Read the server manual. https://wiki.multitheftauto.com/index.php?title=Deathmatch_Server_Manual
  8. First check, if it is really an error. Maybe a boolean is a correct return value, but check what does it mean. (You can even do outputChatBox ( tostring ( bans ) ) to see if it's true or false.) Look at the returns in your script, look at what might they return and then find it out why exactly this boolean was returned. Edit: and yes, as Solidsnake says, putting a lot of ouputChatBoxes in a script can always be helpful while debugging
  9. You can't use "test" as a command name.
  10. There is an example of how you can save it. It only demonstares the saving ( and error checking ) nothing else. local banlist = xmlLoadFile ( "banlist.xml" ) or xmlCreateFile ( "banlist.xml", "bans" ) --customBanPlayer ( player playerToban, [ bool IP, bool serial, player/string resbonsiblePlayer, string reason, int(seconds) unbanTime ] ) function customBanPlayer ( playerToBan, IP, serial, resbonsiblePlayer, reason, unbanTime ) assert ( isElement ( playerToBan ) and getElementType ( playerToBan ) == "player", "Bad player element" ) IP = IP if not IP and not serial then IP = true end serial = serial or false reason = reason or "" time = time or 0 if isElement ( resbonsiblePlayer ) and getElementType ( resbonsiblePlayer ) == "player" then resbonsiblePlayer = getPlayerName ( resbonsiblePlayer ) end local newBan = xmlCreateChild ( banlist, "ban" ) xmlNodeSetAttribute ( newBan, "Name", getPlayerName ( playerToBan ) ) xmlNodeSetAttribute ( newBan, "IP", IP and getPlayerIP ( playerToBan ) or "" ) xmlNodeSetAttribute ( newBan, "Serial", serial and getPlayerSerial ( playerToBan ) or "" ) xmlNodeSetAttribute ( newBan, "Banner", resbonsiblePlayer or "" ) xmlNodeSetAttribute ( newBan, "Reason", reason ) local currentTime = getRealTime().timestamp xmlNodeSetAttribute ( newBan, "Bantime", currentTime ) if unbanTime > 0 then xmlNodeSetAttribute ( newBan, "Unbantime", currentTime + unbanTime ) end --xmlSaveFile ( banlist ) --kickPlayer ( playerToBan, "Banned" .. (reason ~= "" and ": " .. reason or "" ) ) end
  11. Save time (a timestamp) and reason nex to the serial. Like this: <bans> <ban name="Joe" serial="123" time="57348957" reason="no reason" /> </bans>
  12. You have to manage the bans by yourself. Create a a custom ban function, similar to the original banPlayer, wich saves the ban's details somehow (eg. in an xml file). And check the players when they join or just connect (onPlayerJoin or onPlayerConnect), wether they IP/serial is in your custom banlist. If it is, then don't let them spawn, just write something on the screen.
  13. Jó, akkor nem félek. A whitespace-hez, ahogy én szoktam. Remélem nem maradt ki semmi. -- változók local x, y, z = 1, 2, 3 local someTable = {} local someTable2 = { "asd", 1, 5, a="b" } local someTable3 = { exampleValue1 = 6, exampleValue2 = "nothing", exampleValue3 = false, -- különböző hosszúságú neveknél érdemes talán így: shortName = "short", longName___________ = "long", xp = 262347 } -- függvény function someFunction () return false end function someOtherFunction ( x, y ) if x >= 0 and y >= 0 then return x + y else error ( "Only positive numbers and zero allowed" ) -- esetleg így, de ez talán annyira nem lényeges: error "Only positive numbers and zero allowed" return false end end someOtherFunction ( 1, 3 ) -- táblázatok (tömbök) someTable3.xp = 10 someTable2 [ x ] = "bsd" -- ^ -> ide én se mindig teszek szóközt, ahogy éppen kedvem tartja -- egyéb addEventHandler ( "someEvent", root, function () doSomething () cancelEvent () end )
  14. Azt azért nem mondanám kenem-vágom kivülről-belülről a "Higanyt", sok tapasztalatom nem volt vele korábban, de eddig nem volt gond. Én szerintem megoldom tutorial nélkül is.
  15. Or check onClientPreRender's timeSlice argument. Maybe it is what you need.
  16. csiguusz

    Event

    You are welcome. And to read what logical operators (for example 'or') do: http://www.lua.org/manual/5.0/manual.html#2.5.3
  17. csiguusz

    Event

    This will work but it means something else. "onElementDestroy" or "onClientElementDestroy" Will be "onElementDestroy" always, so you are adding only one event handler to "onElementDestroy".
  18. Yes it is, values on that page are always right. But don't use quotation marks. For example: <recommendedclientversion>1.3.4-9.05803.0</recommendedclientversion>
  19. csiguusz

    Event

    Yes, you can. But not this way. addEventHandler ( "onElementDestroy", root, something ) addEventHandler ( "onClientElementDestroy", root, somethingElse )
  20. Áh, pedig az oop nagyon jó dolog, luában különösen, ugyanis itt rajtad múlik hogyan csinálod. Érdemes megtanulni, legalább hogy luában hogy működik, mert főleg ilyen nagy projekteknél nehéz meglenni nélküle. Majd akkor írok róla én valamit. A logótervet meg kíváncsian várom, szeretem az elborult ötletek.
  21. If you don't want him to bump, then why don't you try to help him? Try this anyway: vehicles = {} addCommandHandler("vehicle", function(player,vehicle,car) local x, y, z = getElementPosition(player) player = getPlayerSerial(player) vehiclex = createVehicle(getVehicleModelFromName(car), x, y+2, z) vehicles[vehiclex] = player end) addEventHandler("onVehicleEnter", root, function(playerx, seat) if vehicles [ source ] == getPlayerSerial ( playerx ) and seat == 0 then setVehicleEngineState(source, true) elseif seat == 0 then outputChatBox("You can't drive this vehicle.", playerx) setVehicleEngineState(source, false) end end)
  22. There are the highest available versions. A version number wich you put in your config must look like the ones on this page: https://nightly.multitheftauto.com/ver/
  23. Jó, már szebb is. A kóddal viszont addig nem tudok mit kezdeni, amíg nem tudom mit kell csinálni, mert ami most van, abból nem jöttem rá, sok dolognak nem is igazán látom az értelmét.
×
×
  • Create New...