Jump to content

MACIEKW89

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by MACIEKW89

  1. MACIEKW89

    hi

    No, you can't. Try on server side with onPlayerClick event https://wiki.multitheftauto.com/wiki/OnPlayerClick .
  2. Hi, Try with that : function fanFunction() bindKey ( "lshift","down", function () local vehicle = getPedOccupiedVehicle(localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end) end addEventHandler("bindme",fanFunction)
  3. Hi, Try with that : local sirenSound function startSiren() sirenSound = playSound3D("siren.mp3", 2097.00, -1629.59, 18.79, true) setSoundVolume(sirenSound,100) end addCommandHandler("start", startSiren) function stopSiren() stopSound(sirenSound) end addCommandHandler("stop", stopSiren) Or try with that : addCommandHandler("start", function() local sirenSound = playSound3D("siren.mp3", 2097.00, -1629.59, 18.79, true) setSoundVolume(sirenSound,100) addCommandHandler("stop", function() stopSound(sirenSound) end) end)
  4. @spoty, why? He can name custom functions as he want.
  5. It will be somethink like that : addEventHandler("onPlayerLogin", root, function() local accName = getAccountName(getPlayerAccount(source)) if not accName then return end if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then outputChatBox(getPlayerName(source).." has logged in as Admin!", root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) then outputChatBox(getPlayerName(source).." has logged in as Moderator!", root, 255, 255, 255, true) end end) And sorry for bad english ;b
  6. Try: function player_Wasted ( ammo, attacker, weapon, bodypart ) if attacker then if attacker==source then triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) else giveKill(attacker) setkdr(attacker) triggerClientEvent(source,"startRespawnShow",source,attacker,weapon) giveDeath(source) setkdr(source) setCameraTarget(source,attacker) end else triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  7. Give us some code. Then we can try to help you.
  8. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() ventana = guiCreateWindow((screenW - 456) / 2, (screenH - 307) / 2, 456, 307, ".-Tienda Zenbeit-.", false) guiWindowSetSizable(ventana, false) botonvida = guiCreateButton(9, 22, 97, 21, "Vida [100]", false, ventana) botonarmadura = guiCreateButton(9, 53, 97, 21, "Armadura [100]", false, ventana) botonminigun = guiCreateButton(349, 25, 97, 18, "Minigun [100]", false, ventana) botonbazooka = guiCreateButton(349, 56, 97, 18, "Bazooka [10]", false, ventana) guiLabelSetVerticalAlign(preciovida, "center") precioarmadura = guiCreateLabel(106, 53, 37, 21, "$400", false, ventana) guiLabelSetHorizontalAlign(precioarmadura, "center", false) guiLabelSetVerticalAlign(precioarmadura, "center") preciominigun = guiCreateLabel(297, 25, 47, 21, "$50.000", false, ventana) guiLabelSetVerticalAlign(preciominigun, "center") preciobazooka = guiCreateLabel(297, 56, 47, 18, "$50.000", false, ventana) guiLabelSetHorizontalAlign(preciobazooka, "center", false) guiLabelSetVerticalAlign(preciobazooka, "center") botonhunter = guiCreateButton(9, 237, 97, 21, "Hunter", false, ventana) botonhydra = guiCreateButton(9, 268, 97, 21, "Hydra", false, ventana) preciohunter = guiCreateLabel(106, 237, 56, 21, "$100.000", false, ventana) guiLabelSetVerticalAlign(preciohunter, "center") preciohydra = guiCreateLabel(106, 268, 56, 21, "$100.000", false, ventana) guiLabelSetVerticalAlign(preciohydra, "center") preciorhino = guiCreateLabel(292, 268, 57, 21, "$100.000", false, ventana) guiLabelSetVerticalAlign(preciorhino, "center") precioseas = guiCreateLabel(287, 240, 62, 18, "$100.000", false, ventana) guiLabelSetHorizontalAlign(precioseas, "center", false) guiLabelSetVerticalAlign(precioseas, "center") botonrhino = guiCreateButton(349, 271, 97, 18, "Rhino", false, ventana) botonseas = guiCreateButton(349, 240, 97, 18, "Seasparrow", false, ventana) imagen = guiCreateStaticImage(143, 98, 172, 99, ":Zombies/edf/zombiespawn.png", false, ventana) guiSetAlpha(imagen, 0.43) guiSetVisible(ventana, false) end) function OpenWin() if guiGetVisible(ventana) then guiSetVisible(ventana, false) showCursor(false) else guiSetVisible(ventana, true) showCursor(true) end end bindKey("F7", "down", OpenWin)
  9. Hi, Try with that: addEventHandler("onPlayerLogin", root, function() local accName = getAccountName(getPlayerAccount(source)) if not accName then return end if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then outputChatBox(getPlayerName(source).." has logged in as Admin!", root, 255, 255, 255, true) end end)
  10. Hi, Try that code: local sW, sH = guiGetScreenSize() local dir = "img.png" --Your image directory addEventHandler("onClientRender", root, function() local i_w = 72 --Your image size (width) local i_h = 60 --Your image size (height) local i_ratio = i_w / i_h local iscale_w = 1700 / sW i_w = i_w / iscale_w i_h = i_w / i_ratio for i, v in ipairs(getElementsByType("marker")) do local x, y, z = getElementPosition(v) local cx, cy, cz = getCameraMatrix() if isLineOfSightClear(cx, cy, cz, x, y, z, false, false, false, false, false, false, false, v) then local dist = getDistanceBetweenPoints3D(cx, cy, cz, x, y, z) if dist <= 20 then --If distance between player camera and marker is <= 20, then show image local px, py = getScreenFromWorldPosition(x, y, z + 1, 0.06) if px then dxDrawImage(px-i_w/2, py-sH/5, i_w, i_h, dir, 0, 0, 0, tocolor( 255, 255, 255, 255 )) end end end end end)
  11. Hi, Try that: local screenW, screenH = guiGetScreenSize() function tekst() dxDrawText("blablabla", (screenW * 0.0516) - 1, (screenH * 0.5130) - 1, (screenW * 0.3094) - 1, (screenH * 0.6130) - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("blablabla", (screenW * 0.0516) + 1, (screenH * 0.5130) - 1, (screenW * 0.3094) + 1, (screenH * 0.6130) - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("blablabla", (screenW * 0.0516) - 1, (screenH * 0.5130) + 1, (screenW * 0.3094) - 1, (screenH * 0.6130) + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("blablabla", (screenW * 0.0516) + 1, (screenH * 0.5130) + 1, (screenW * 0.3094) + 1, (screenH * 0.6130) + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("blablabla", screenW * 0.0516, screenH * 0.5130, screenW * 0.3094, screenH * 0.6130, tocolor(18, 84, 235, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) end addEventHandler("onClientMarkerHit", root, function() if source==kaboommarker then addEventHandler("onClientRender", root, tekst) end end)
  12. Number 2 : meta.xml : <meta> <info author="Maciej 'MACIEKW89' Wituszyński" type="script" version="1.0"/> <script src="c.lua" type="client"/> <script src="s.lua" type="server"/> </meta> c.lua : addEventHandler("onClientPlayerDamage",root, function() if getElementData(source,"godmode") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"godmode") then cancelEvent() end end) s.lua : addCommandHandler("godmode", function(thePlayer) local account = getPlayerAccount (thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if (isObjectInACLGroup("user."..accountName, aclGetGroup("Admin"))) then local state = (not getElementData(thePlayer, "godmode")) setElementData(thePlayer, "godmode", state) end end) Co do pierwszego to troszkę więcej pisania, a ja niestety leniwy jestem ;b. Nie testowane, robione na szybko. Mam nadzieję, że pomogłem.
  13. To zależy jak masz to zapisane w comboboxie. Można tak : local wybrane = guiComboBoxGetSelected(comboBox) local dane = guiComboBoxGetItemText(comboBox, wybrane) guiSetText(label, dane) Musisz pomyśleć. To jest bardzo proste do wykonania, wystarczy ci głowa, wyobraźnia i wiki. Powodzenia.
  14. Witam. Do pobrania zaznaczonej postaci i informacji w comboboxie użyj : guiComboBoxGetSelected razem z : guiComboBoxGetItemText Co do labeli to : guiSetText Mam nadzieję, że zrozumiesz. Przykłady masz na wiki. Nie ma za co. Nq
  15. Może pochwaliłbyś się swoim logiem z debugu ? Mówisz że wywala błąd z Eventem... a ich trochę może być. Podaj wpis z debugu . Co do kodu - spróbuj tego : V function kl() if (source == sf) then local niet = createMarker ( -1124.6586914063, -1009.0390625, 129.21875, 'cylinder', 3, 0, 0, 190 ) guiSetVisible (akna, false ) showCursor (false) end end addEventHandler("onClientGUIClick", sf, kl ) function mark(hitElement) if getElementType(hitElement) == "player" then outputChatBox ( "Graczu ! Zostałeś uleczony! ", hitElement, 0, 255, 0 ) setElementHealth (hitElement, 90) end addEventHandler("onClientMarkerHit", niet, mark )
  16. https://wiki.multitheftauto.com/wiki/SetElementHealth function kl() if (source == sf) then local niet = createMarker ( -1124.6586914063, -1009.0390625, 129.21875, 'cylinder', 3, 0, 0, 190 ) guiSetVisible (akna, false ) showCursor (false) end end addEventHandler("onClientGUIClick", sf, kl ) function mark() local gracz = getLocalPlayer() setElementHealth (gracz, 90) end addEventHandler("onClientMarkerHit", niet, mark ) Nie testowane ale spróbuj
  17. Witam! Zrobiłem kod na ustawianie barierki niedaleko gracza. Jak zrobić, aby ta barierka zawsze ustawiała się przed graczem? function CreateBarrier ( thePlayer ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local theObject = createObject ( 1228, x, y + 2, z - 0.7, 0, 0, 0) if ( theObject ) then outputConsole ( "Stworzono barierkę.", thePlayer ) else outputConsole ( "Nie można stworzyć barierki.", thePlayer ) end end end addCommandHandler ( "barierka", CreateBarrier )
  18. I have to do a register when I Click on the button then create window with 2 edit box. Login and Password. If I click on the button "Register" then script register new account. This script don't register me
  19. -.- --[[--------------------------------- | Panel Logowania by MACIEKW89 | | Strona Serwera | -----------------------------------]] addEvent("onClickLogin", true) addEvent("onClickRegister", true) addEvent("onLoginSpawn", true) addEvent("onRegisterSpawn", true) --Logowanie-- addEventHandler("onClickLogin", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(plr, account, password) == true) then outputChatBox("Zalogowano pomyślnie", plr, 0, 255, 0) triggerClientEvent("onSuccessLogin", getRootElement()) else outputChatBox("Błąd 1 - Logowanie lin.19 ZGŁOŚ ADMINOWI!", plr, 255, 0, 0) end else outputChatBox("Błędny login lub hasło!", plr, 255, 0, 0) end end) --Rejestracja-- addEventHandler("onClickRegister", getRootElement(), function(plr, username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox("Takie konto już istnieje!", plr, 255 , 0, 0) else local accountAdd = addAccount(username, password) if(logIn(plr, accountAdd, password) == true) then outputChatBox("Zarejestrowano pomyślnie!", plr, 0 , 255, 0) triggerClientEvent("onSuccessRegister", getRootElement()) else outputChatBox("Błąd 2 - Rejestracja lin.39 ZGŁOŚ ADMINOWI!", plr, 255 , 0, 0) end end end) --Spawn-- addEventHandler ("onLoginSpawn", getRootElement(), function(player) fadeCamera(player, true) setCameraTarget(player, player) setGameType ( "ZombieMode v1.0" ) setMapName ( "San Zombies" ) end) addEventHandler("onRegisterSpawn", getRootElement(), function(player) local x = 2491.57 local y = -1672.27 local z = 13.3359 spawnPlayer(player, x, y, z) fadeCamera(player, true) setCameraTarget(player, player) setGameType ( "ZombieMode v1.0" ) setMapName ( "San Zombies" ) giveWeapon(player, 29, 1000) end) --Respawn-- addEventHandler( "onPlayerWasted", getRootElement(), function() setTimer( spawnPlayer, 5000, 1, source, 2491.57, -1672.27, 13.3359 ) end) Here is my full code (server-side).
×
×
  • Create New...