Jump to content

dewu

Members
  • Posts

    171
  • Joined

  • Last visited

Everything posted by dewu

  1. Hello guys. I find this script: player = getLocalPlayer ( ) sw, sh = guiGetScreenSize ( ) mouse1_pressed = false FPS_CAMERA = false --FUNCTION MADE BY 'Doomed_Space_Marine', FIXED BY 'robhol' function findRotation ( x1, y1, x2, y2 ) local t = -math.deg ( math.atan2 ( x2 - x1, y2 - y1 ) ) if t < 0 then t = t + 360 end return t end --ALWAYS SET CAMERA POSITION IN THE PLAYER'S HEAD addEventHandler ( "onClientPreRender", getRootElement ( ), function ( ) if FPS_CAMERA then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setCameraMatrix ( x1, y1, z1 ) if not getControlState ( "aim_weapon" ) then setControlState ( "aim_weapon", false ) end end end ) --MAKE SURE THE PLAYER AIMS WITH THE MOUSE addEventHandler ( "onClientCursorMove", getRootElement ( ), function ( guiy1, guiy1, guix2, guiy2, x2, y2, z2 ) if not isCursorShowing ( ) and not isChatBoxInputActive ( ) and not isMainMenuActive ( ) and FPS_CAMERA then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setPedRotation ( player, findRotation ( x1, y1, x2, y2 ) ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end ) --A SIMPLE WAY TO MAKE A KEY REPEATER bindKey ( "mouse1", "both", function ( k, state ) if state == "down" then mouse1_pressed = true else mouse1_pressed = false end end ) --CONTROLS PART function resetControls ( ) toggleControl ( "aim_weapon", not FPS_CAMERA ) toggleControl ( "backwards", not FPS_CAMERA ) toggleControl ( "sprint", not FPS_CAMERA ) toggleControl ( "right", not FPS_CAMERA ) toggleControl ( "left", not FPS_CAMERA ) toggleControl ( "fire", not FPS_CAMERA ) toggleControl ( "enter_vehicle", not FPS_CAMERA ) toggleControl ( "enter_passenger", not FPS_CAMERA ) if FPS_CAMERA then setElementAlpha ( player, 0 ) else setElementAlpha ( player, 255 ) end end --DRAW A BEAUTIFUL CROSSHAIR IN THE MIDDLE OF THE SCREEN addEventHandler ( "onClientRender", getRootElement ( ), function ( ) if FPS_CAMERA then dxDrawImage ( ( sw / 2 ) - 4, ( sh / 2 ) - 4, 8, 8, "crosshair.png" ) end end ) addCommandHandler ( "fp", function ( ) FPS_CAMERA = not FPS_CAMERA if not FPS_CAMERA then setCameraTarget ( player ) else resetCamera ( ) end resetControls ( ) end ) It works perfectly, but have one bug. I can't zoom when have Sniper Rifle or Country Rifle, any ideas?
  2. dewu

    ACL access

    Thank you! It's working perfect, but i want more Is this way to remove "user" word when listed? Ex. when /aclObjectList i got: ACL List: Group1 #0 Object: user.dewu so i want this: ACL List: Group1 #0 Object: dewu
  3. dewu

    ACL access

    Okay, my false, it's working But i have next question: How to list by use command all users from Group1?
  4. dewu

    ACL access

    Hi guys. Im looking for a way to set some player access, to adding other players into his ACL Group. Example: Only Player1 can add other players to Group1, by use command /add OtherPlayer. I create own script, but don't know why it's not working ;/ function test1 (playerSource, commandName, accountName) if isObjectInACLGroup ("user.dewu", aclGetGroup ( "Group1" ) ) then if accountName then aclGroupAddObject (aclGetGroup("Group1"), "user."..accountName) outputChatBox ("Account '"..accountName.."' succesfully added to the group.", playerSource) else outputChatBox ("No account name specified.", playerSource) end end end addCommandHandler ("add", test1)
  5. dewu

    Zombie proof

    So if I do that.. RestricLocation["location1"] = {-212.60000610352,1451.5,95.800003051758} RestricLocation["location2"] = {-277.20001220703,1509.5,75} setElementData (RestricLocation, "zombieProof", true) it will work? @EDIT Okay, it works Thanks.
  6. dewu

    Zombie proof

    Hi guys. I have that script: RestricLocation["location1"] = {-212.60000610352,1451.5,95.800003051758} RestricLocation["location2"] = {-277.20001220703,1509.5,75} function ResourceStart( ) setElementData (RestricLocation, "zombieProof", true) end I don't know why, it's not working and zombies can enter proof area ;/
  7. Hi guys. Is this way to disable Hunter (helicopter) fire?
  8. Update 0.1.69 Serwer: • Zmiana hostingu z Pukawka.pl na ServerProject.pl Gamemod: • Dodane nowe rodzaje jedzenia: Sardines Can • Dodane nowe rodzaje napojów: Pepsi, Coca-Cola • Dodane nowe pojazdy: Hunter, Cop, Regina, Tractor, Dodo, Clover, Quad, Mesa, Camper • Dodany panel prywatnych wiadomości pod "F4" • Dodany realistyczny system zombie (odgłosy, animacje, gryzienie, zachowania) • Dodany nowy wygląd ikon broni • Dodany nowy wygląd radaru • Dodany nowy Anty-Relog • Dodany nowy inwentarz wzorowany na DayZ Mod Inne: • Dodany 18 slotowy serwer TeamSpeak3 • Dodane konto VIP Co planujemy w przyszłym? Gamemod: • Nowe części niezbędne do uruchomienia pojazdu • Green Zone (bezpieczna strefa) • Zrzut lotniczny skrzynek z zapasami • Kamizelka kuloodporna • Pierwsze kroki w kierunku stworzenia systemu Craftingu • Możliwość podnoszenia plecaków • Nowe części niezbędne do uruchomienia pojazdu • Respawn pojazdów co 24h • Panel właściciela bazy Forum: • System reputacji
  9. dewu

    "Or" function

    Still it's not working ;c
  10. dewu

    "Or" function

    It's works if I have Wood Pile and Wooden Sticks in my inventory, then i can use Box of matches ;/ I want use Box of matches when I have Wood Pile or Wooden Sticks.
  11. dewu

    "Or" function

    It's not working. Also i tried: if itemName == "Box of Matches" and (getElementData(getLocalPlayer(), "Wood Pile") == 0 or getElementData(getLocalPlayer(), "Wooden Sticks") == 0) then if itemName == "Box of Matches" and getElementData(getLocalPlayer(), "Wood Pile") == 0 or getElementData(getLocalPlayer(), "Wooden Sticks") == 0 then if itemName == "Box of Matches" and getElementData(getLocalPlayer(), "Wood Pile") or getElementData(getLocalPlayer(), "Wooden Sticks") == 0 then if itemName == "Box of Matches" and (getElementData(getLocalPlayer(), "Wood Pile") or getElementData(getLocalPlayer(), "Wooden Sticks") == 0) then if itemName == "Box of Matches" and (getElementData(getLocalPlayer(), "Wood Pile") or getElementData(getLocalPlayer(), "Wooden Sticks")) == 0 then
  12. dewu

    "Or" function

    Hi guys. I have a problem with the use of "or" function, that's my code: if itemName == "Box of Matches" and (getElementData(getLocalPlayer(), "Wood Pile") or getElementData(getLocalPlayer(), "Wooden Sticks") == 0) then i tried every combinations, nothing works, help ;/ That's orginial function: if itemName == "Box of Matches" and getElementData(getLocalPlayer(), "Wood Pile") == 0 then How to add or?
  13. dewu

    DayZ vehicles

    Hi guys. I use 0.7.2 version of MTA DayZ mod. In this version should works these vehicles: works only underlined.Vehicles who don't works are added the same as working vehicles, but they don't want even spawn. Question is: WHY? Maybe someone were the same problem and know how to fix it? ;/
  14. Odświeżam. Nowa maszyna, nowy adres IP: 178.19.106.170:22108
  15. Emm.. i think i explain it clearly. I want to set transprency for weapon when I will hold it in hands.
  16. Hi guys. I'm looking for way to hide weapon texture when I hold it in hands (I want to make it invisible) without texture interference, I want to make that inscript. Is this possible?
  17. dewu

    Server optimising

    Any other suggestions?
  18. Update 0.1.57 Poprawki: • Poprawione wczytywanie tekstur zakładanych plecaków • Poprawione znikające skiny po upuszczeniu na ziemię • Poprawiony skrypt zmieniającej się pogody • Poprawiony kod respawnu dla: Civilian[F] Clothing, Survivor[F] Clothing, Ghillie[F] Suit Gamemod: • Dodany glue vehicle (przyczepianie się do pojazdów) • Dodana ikona broni dla: Hatchet • Dodana nowa tekstura dla: Aspirin • Dodany przedmiot: Can Opener (otwieracz do puszek) • Jedzenie w puszkach dodaje więcej krwi (Pasta Can, Beans Can) • Dodany oddzielny respawn broni i amunicji (już nie respią się razem) • Dodany spawn Military Backpacka w obiektach militarnych • Dodany system zabezpieczeń dla baz Forum: • Dodana modyfikacja pozwalająca na dodawanie przyjaciół w swoim profilu • Dodana kategoria "Sklep" Admin: • Dodana komenda respawnu pojazdów Co planujemy w przyszłym? Gamemod: • Zrzut lotniczny skrzynek z zapasami • Nowe pojazdy • Nowe modele pojazdów • Green Zone (bezpieczna strefa) • Kamizelka kuloodporna • Odgłosy zombie • Nowe rodzaje jedzenia i picia • Pierwsze kroki w kierunku stworzenia systemu Craftingu • Możliwość podnoszenia plecaków • Panel prywatnych wiadomości • Nowe części niezbędne do uruchomienia pojazdu Forum: • System reputacji Admin: • Czat głosowy dla adminów Inne: • Konto VIP
  19. dewu

    Server optimising

    MrBrutus, I used one of the best external Polish hostings. When items are respawn CPU usage in web server monitor is like 170% ;o manve1, Okay, but how I can do that in script? I found this script there, it will works? How to implement it? function infiniteLoopFunction() local lastresume = getTickCount() while true do --do something if getTickCount() > lastresume+200 then coroutine.yield() lastresume = getTickCount() end end end function resumeLoopThread() coroutine.resume(loopThread) end loopThread = coroutine.create(infiniteLoopFunction) resumeLoopThread() setTimer(resumeLoopThread, 400, 0)
  20. Hi guys. I have a server with DayZ Mod and sometimes when items are respawning server is shutdown, because of high processor usage. Is any way to optimise script with respawning function?
  21. Hi guys. I found that script: RestricLocation = {} TeleportLocation = {} EnabledAlarm = true TimesToKick = {} TimeSireneEnabled = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {869.90002441406,-1996.9000244141,37.299999237061} --Local PARTE DE CIMA RestricLocation["location2"] = {811.29998779297,-2076.8999023438,-9.6999998092651} --LOCAL PARTE DE BAIXO TeleportLocation = {836.59997558594,-1977.8000488281,12.39999961853} --LOCAL TO TELEPORT PLAYER GroupName = "Staff" -- name of the acl/gang group !!! GroupNameBy = 1 -- 1 for gang name, 2 for ACL group ! cmdTurnON = "turnONcmd" -- Command to enable alarm / cmdTurnOFF = "TurnOFFcmd" -- Command to disable alarm / MsgtoKICK = "Area protected! Leave or kick!" MsgCantCreateCollision = "Can't be created the Collision, check your location1 and location2" EnableVehicleGodMode = true -- true enabled, false disabled. KickORBAN = 1 -- 1 for kick player, 2 for BAN BanTime = 900000 -- time in seconds of ban, 900000 sec = 15 min MsgBAN = "Invasor" -- Reason of BAN ! --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 255, 255, true ) end function EnterPlace ( theElement ) if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) and (EnabledAlarm == true ) then if(TimesToKick[theElement] > 0) then sendMsg(theElement,MsgtoKICK ..TimesToKick[theElement]) TimesToKick[theElement] = TimesToKick[theElement] -1 setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) if TimeSireneEnabled == true then triggerClientEvent ( "ActiveAlarm", getRootElement() ) end sendMsgOwners(theElement) else if (KickORBAN == 1) then kickPlayer(theElement) else banPlayer ( theElement , false, false, true, "Alarme system Base", MsgBAN, BanTime ) end end elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function ASBenable1 ( source ) if(PlayerHaveLevel (source) == true) then EnabledAlarm = true end end function ASBdisable1 ( source ) if(PlayerHaveLevel (source) == true) then EnabledAlarm = false end end function ResetStats ( ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if TimesToKick[aPlayer] == nil then TimesToKick[aPlayer] = 5 end if(TimesToKick[aPlayer] < 5) then TimesToKick[aPlayer] = TimesToKick[aPlayer] + 1 end end end function playerConnect ( playerNick ) local iPlayer = getPlayerFromName ( playerNick ) TimesToKick[iPlayer] = 5 end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) ) then return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do TimesToKick[aPlayer] = 5 end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString(MsgCantCreateCollision) end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function SireneEnabled() TimeSireneEnabled = true end function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," Player " ..getPlayerName ( PlayerID ) .." is trying to join in our base!") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end setTimer ( SireneEnabled , 20000, 0, "" ) setTimer ( ResetStats , 15000, 0, "" ) addCommandHandler("alarmon",ASBenable1) addCommandHandler("alarmoff",ASBdisable1) addEventHandler ("onPlayerConnect", getRootElement(), playerConnect) Question is: How to set new locations? RestricLocation["location1"] = {869.90002441406,-1996.9000244141,37.299999237061} --Local PARTE DE CIMA RestricLocation["location2"] = {811.29998779297,-2076.8999023438,-9.6999998092651} --LOCAL PARTE DE BAIXO What's location1 and location2, - corners of restricted area or what?
  22. Humph, I write something like this: function addvip ( account ) for i, v in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( v ) if ( not isGuestAccount ( a ) and getAccountName ( a ) == account ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..v) return true end end return false end PHP side: $account = $_POST["account"]; include("sdk/mta_sdk.php"); $mtaServer = new mta("31.186.83.100", 22013, "mylogin", "mypassword" ); $mtaServer->getResource("vipadd")->call("addvip", $account); and HTML: Login: type="text" name="account">
  23. That's right! Maybe some example for function with adding player to acl group?
×
×
  • Create New...