Jump to content

IIYAMA

Moderators
  • Posts

    5,973
  • Joined

  • Last visited

  • Days Won

    191

Everything posted by IIYAMA

  1. IIYAMA

    Jail Timer

    local runningTimers = {} function jailPlayer( player, cmd, target, ttime ) if isPlayerAdmin ( player ) then jailedPlayer = getPlayerFromName ( target ) if jailedPlayer then if getElementData ( jailedPlayer, "jailed" ) == false then if isPedInVehicle ( jailedPlayer ) then removePedFromVehicle ( jailedPlayer ) end local jx, jy, jz = unpack(jailcells[math.random(#jailcells)]) setElementDimension ( jailedPlayer, 60601 ) setElementInterior ( jailedPlayer, 12 ) setElementPosition ( jailedPlayer, jx, jy, jz ) setElementData ( jailedPlayer, "jailed", true ) if not runningTimers[jailedPlayer] then runningTimers[jailedPlayer] = {} end local newTabPos = #runningTimers[jailedPlayer] +1 runningTimers[player][newTabPos] = setTimer ( function (newTabPos,jailedPlayer) runningTimers[player][newTabPos] = nil setElementData ( jailedPlayer, "jailed", false ) setElementDimension ( jailedPlayer, 0 ) setElementInterior ( jailedPlayer, 0 ) setElementPosition ( jailedPlayer, 2492.408, 2773.22, 10.80 ) end,1000,1,newTabPos,jailedPlayer) else outputChatBox ( "This Player is already jailed!", player, 255, 0, 0 ) end else outputChatBox ( "Player does not exist!", player, 255, 0, 0 ) end end end addCommandHandler ( "jail", jailPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() if runningTimers[source] then if next(runningTimers[source]) then for i,timer in pairs(runningTimers[source]) do if isTimer(timer) then killTimer(timer) end end end runningTimers[source] = nil end end) and no I haven't test anything, there may some mistakes/bugs, but I don't have much time. Killing timers before executing will safe you some power. This system is only efficient when you use more then 1 timer.
  2. IIYAMA

    Jail Timer

    Don't forget to check after the timer ends, if the player is an element else you will have warnings when he leaves before the timer ends. isElement() --- or as you said, put the timer in a table with the player user data as key. +argument timer location. When he leaves you can stop the timer easily. [player] ={timer,timer,timer} There are many possibility's.
  3. Also about reconnect: If you reconnect, then you will download the server information from the location from the element. If the element do have sync_interval (ped/player vehicle) you will download the last element position. https://wiki.multitheftauto.com/wiki/Se ... Streamable SetElementStreamable, will only be managed at client side. Note sync_interval, you can disable it by using: (this is server side) https://wiki.multitheftauto.com/wiki/SetElementSyncer
  4. If you set Element position of yourself, it will be synced for other players, but not directly. player_sync_interval 100ms Default update time. The time before this will be updated after the "setElementPosition" is between 1 t/m 100 milliseconds. https://wiki.multitheftauto.com/wiki/Sy ... l_settings When you set the position of another player, he will be updated back to his old position, unless he isn't streamed. With this you can control that: https://wiki.multitheftauto.com/wiki/Se ... Streamable
  5. Note: When you hit every marker, this will be executed. The best way to solve this is by using special element id's. setElementID (element,"TOWmarker")-- when you create the marker. if getElementID(element)=="TOWmarker" then -- on marker hit
  6. Vehicle user data should be there. (just the vehicle) Returns the vehicle(the wagon) behind it or false. https://wiki.multitheftauto.com/wiki/GetElementModel local model1 = getElementModel ( vehicle1 ) if towVehicles[model1] then --or if towVehicles[getElementModel ( vehicle1 )] then It works for sure.
  7. Het is belangrijk dat de gamemode de bots kan exporteren. Sommige gamemodes hebben deze functies en anderen niet. Dat staat er als goed is bij. Ik denk dat je dat maar moet onderzoeken welke het wel en niet kan. https://community.multitheftauto.com/in ... =resources
  8. Zou kunnen, Alleen dan moet je een edf maken, want voor freeroam is er nog geen edf.
  9. ok Is there any way to fix or prevent it from bugging?
  10. http://bugs.mtasa.com/view.php?id=6639 exactly..... -_-"
  11. I am building something that gives ammo when you are inside a colshape, but the Flamethrower ammo is getting bugged all the time. It jumps from 200 to 23 and back to 153 etc... of course I put a limit on it, but this jumping behaviour is getting very annoying because the clip ammo is also changing a lot. function setPlayerBoxAmmo (player,weaponSlot) local ammoIn = getPedTotalAmmo (player,weaponSlot) local weapon if groupweapon then local weaponset = getElementData(player, "weaponSet") if weaponset then weapon = groupweapon[weaponset][weaponSlot] outputChatBox(weapon .. "weaponslot" .. weaponSlot .. ammoIn) else return end else weapon = getPedWeapon ( player, weaponSlot ) end local ammoLimit = MXammo[weapon] if ammoIn == ammoLimit then return end outputDebugString("ammotrigger") local ammoCont = ammoIn+ammoGiving[weapon] local clip = tonumber(slotForce[weapon]) or 0 if ammoCont > ammoLimit then if ammoIn <= 0 then giveWeapon ( player, weapon, ammoLimit, false ) else --outputChatBox("ammoIn ".. ammoIn) setWeaponAmmo ( player, weapon, ammoLimit, clip) end else if ammoIn <= 0 then giveWeapon ( player, weapon, ammoCont, false ) else if ammoCont > ammoLimit then --giveWeapon ( player, weapon, ammoLimit - ammoIn, false ) setWeaponAmmo ( player, weapon, ammoLimit, clip) else --giveWeapon ( player, weapon, ammoIn+10, false ) setWeaponAmmo ( player, weapon, ammoCont, clip) end end end end Somebody a suggestion, idea's or explanation?
  12. IIYAMA

    call function

    Thank you very much ! I probably forgot to put the export in the mta
  13. IIYAMA

    call function

    Somebody have any idea what can go wrong?
  14. IIYAMA

    call function

    local groupSlots = call(getResourceFromName("SPY-vs-SPY"),"onWeaponInfoRequest") function onWeaponInfoRequest() return weaponsFromSet end I am doing something wrong?
  15. or you just download a clean one: http://pastebin.com/HWJ308YZ
  16. IIYAMA

    physics

    I use hedit to import/(export) my handlings, but it won't support the whole file in ones. https://community.multitheftauto.com/in ... ls&id=3716
  17. Mind also the ranks under the admin, some of the rights also count for admins. <acl name="Admin"> <right name="general.ModifyOtherObjects" access="true"></right> <right name="general.http" access="true"></right> <right name="command.shutdown" access="true"></right> <right name="command.install" access="true"></right> <right name="command.aexec" access="true"></right> <right name="command.debugscript" access="true"></right> <right name="command.upgrade" access="true"></right> <right name="command.crun" access="true"></right> <right name="command.srun" access="true"></right> <right name="command.run" access="true"></right> <right name="function.addBan" access="true"></right> <right name="function.removeBan" access="true"></right> <right name="function.reloadBans" access="true"></right> <right name="function.executeCommandHandler" access="true"></right> <right name="function.setServerPassword" access="true"></right> <right name="function.getServerPassword" access="true"></right> <right name="function.createResource" access="true"></right> <right name="function.copyResource" access="true"></right> <right name="function.addResourceMap" access="true"></right> <right name="function.addResourceConfig" access="true"></right> <right name="function.removeResourceFile" access="true"></right> <right name="function.setResourceDefaultSetting" access="true"></right> <right name="function.removeResourceDefaultSetting" access="true"></right> <right name="function.aclReload" access="true"></right> <right name="function.aclSave" access="true"></right> <right name="function.aclCreate" access="true"></right> <right name="function.aclDestroy" access="true"></right> <right name="function.aclSetRight" access="true"></right> <right name="function.aclRemoveRight" access="true"></right> <right name="function.aclCreateGroup" access="true"></right> <right name="function.aclDestroyGroup" access="true"></right> <right name="function.aclGroupAddACL" access="true"></right> <right name="function.aclGroupRemoveACL" access="true"></right> <right name="function.aclGroupAddObject" access="true"></right> <right name="function.aclGroupRemoveObject" access="true"></right> <right name="function.refreshResources" access="true"></right> <right name="function.setServerConfigSetting" access="true"></right> <right name="function.updateResourceACLRequest" access="true"></right> <right name="command.aclrequest" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="true"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_maps" access="true"></right> <right name="general.tab_bans" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="true"></right> <right name="command.freeze" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="true"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="true"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="true"></right> <right name="command.destroyteam" access="true"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.start" access="true"></right> <right name="command.stop" access="true"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="true"></right> <right name="command.restart" access="true"></right> <right name="command.execute" access="true"></right> <right name="command.setpassword" access="true"></right> <right name="command.setwelcome" access="true"></right> <right name="command.setgame" access="true"></right> <right name="command.setmap" access="true"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.setfpslimit" access="true"></right> <right name="function.shutdown" access="true"></right> <right name="command.ban" access="true"></right> <right name="command.unban" access="true"></right> <right name="command.banip" access="true"></right> <right name="command.unbanip" access="true"></right> <right name="command.banserial" access="true"></right> <right name="command.unbanserial" access="true"></right> <right name="command.listbans" access="true"></right> </acl>
  18. alles in: cp_core_server.lua (vergeet niet een backup te maken)
  19. ah thank you!!! local functionTable = {} addCommandHandler("hey", function (player,cm) lol = functionTable[1] lol() end) functionTable[1]=function() outputChatBox("hey") end functionTable[2]=function() outputChatBox("hoi") end functionTable[3]= function() outputChatBox("hi") end
  20. Is it possible to store triggers in tables? Because this isn't working. local functionTable = {hey,hoi,hi} addCommandHandler("hey", function (player,cm) lol = functionTable[1] lol() end) function hey() outputChatBox("hey") end function hoi() outputChatBox("hoi") end function hi() outputChatBox("hi") end
  21. Table is een rij met waardes. Het word gebruikt om informatie op te slaan, te laden of mee te controleren. myTable = {5,4,"hey!",2,1} -- de informatie die deze table bevat. --outputChatBox() <-- laat informatie achter in de chatbox -- waarde = myTable[ positie van het getal ] outputChatBox(myTable[1]) -- nu pakken we het eerste getal in de table en dat is 5, dat laten we nu in de chatbox zien. "5" outputChatBox(myTable[2])--"4" outputChatBox(myTable[3]) -- en nu komen we er achter dat dit op de 3de plaats bevind. "hey!" meta.xml Is je script launcher, dit stukje code zorgt voor het opstarten van je scripts die zich in folder bevinden. Maar ook voor het vinden van beeld materiaal/plaatjes, auto mods of geluid. Het is een soort inhoudsopgaven die de server nodig heeft om bestanden te vinden. Of het kan ook informatie zijn die voor settings word gebruikt.
  22. Kan ik begrijpen Het is ook lastig te begrijpen als je deze taal niet begrijpt.
  23. Probeer maar in cp_core_server.lua en zet dat in client side uit: (op deze manier) --[[ createTeam ... function () end ]]
×
×
  • Create New...