Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. After 1 minute it'll auto decline, it's easy to add a command to, you should do it as I gave you the main script.
  2. You're welcome and yes, server side.
  3. local invitations = {} addCommandHandler("warpto", function (thePlayer, cmd, who) if (not who or who == "") then outputChatBox("/"..cmd..": No player inserted.",thePlayer,255,0,0) return end local player = getPlayerFromName(who) if (not player) then outputChatBox("/"..cmd..": This player does not exists.",thePlayer,255,0,0) return end if (invitations[thePlayer]) then outputChatBox("/"..cmd..": You already sent a warp invitation.",thePlayer,255,0,0) return end outputChatBox(getPlayerName(player) .." want's to warp to you, write /accept ".. getPlayerName(thePlayer) ..".",player,0,255,0) outputChatBox("You have sent a warp invitation to ".. getPlayerName(player) ..".",player,0,255,0) invitations[thePlayer] = player setTimer(function () invitations[thePlayer] = nil end, 60000, 1) end) addCommandHandler("accept", function (thePlayer, cmd, who) if (not who or who == "") then outputChatBox("/"..cmd..": No player inserted.",thePlayer,255,0,0) return end local player = getPlayerFromName(who) if (not player) then outputChatBox("/"..cmd..": This player does not exists.",thePlayer,255,0,0) return end if invitations[player] then setElementPosition(player, getElementPosition(thePlayer)) outputChatBox("You have accepted ".. getPlayerName(player) .."'s warp invitation.",thePlayer,0,255,0) outputChatBox(getPlayerName(thePlayer) .. " accepted your warp invitation.",player,0,255,0) invitations[player] = nil end end)
  4. Castillo

    info element

    That's a object in GTA, it's in an interior of a racing track, not a script.
  5. Inicia el resource scores, cambia el "dxscoreboard" a "scoreboard" y listo.
  6. Yep, I forgot to add the updateSoundPositions timer, but you shouldn't add it every time a sound creates.
  7. I don't get what do you want, you want to play a sound around the player who typed /c1 command? if so try this: -- client side: local sounds = {} addEvent("createNewSound",true) addEventHandler("createNewSound",root, function (player) local x, y, z = getElementPosition(player) sounds[player] = playSound3D("sounds/copythat.wav", x, y, z, false) end) function updateSoundPositions() for player, sound in pairs(sounds) do if isElement(player) and isElement(sound) then setElementPosition(sound, getElementPosition(player)) end end end setTimer(updateSoundPositions,2000,0) -- server side: addCommandHandler("c1", function (player) triggerClientEvent("createNewSound",getRootElement(),player) end)
  8. 20 minutos? es un chiste? solo tenias que cambiar dos cosas... teamAdmin = createTeam ( "Ejemplo", 255, 0, 0 ) function addtoteam(player) local name = getPlayerName(player) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player,teamAdmin ) setPlayerName(player, "[Admin]".. name) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam ( player,teamAdmin ) setPlayerName(player, "[s.Moderator]".. name) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Moderator" ) ) then setPlayerTeam ( player,teamAdmin ) setPlayerName(player, "[Moderator]".. name) end end function addtoteamtimer() setTimer(addtoteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer) Fijate si funca.
  9. Es porque no te cambia el nombre, te cambia el nametag.
  10. teamAdmin = createTeam ( "Ejemplo", 255, 0, 0 ) function addtoteam(player) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player,teamAdmin ) setPlayerNametagText(player, "[Admin]".. getPlayerName(player)) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam ( player,teamAdmin ) setPlayerNametagText(player, "[s.Moderator]".. getPlayerName(player)) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Moderator" ) ) then setPlayerTeam ( player,teamAdmin ) setPlayerNametagText(player, "[Moderator]".. getPlayerName(player)) end end function addtoteamtimer() setTimer(addtoteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer)
  11. Si tenes un timer en server side y lo matas con killTimer, entonces se quita para todos. Podes crear una tabla tipo: timers = {} addCommandHandler("test", function (pl) if isTimer(timers[pl]) then killTimer(timers[pl]) end timers[pl] = setTimer(outputChatBox,20000,0,"Test") end)
  12. Castillo

    setTimer

    function harndrang(Player) local harndrangZahl = getElementData(Player, "harndrang") setTimer(auffuellen, 1000, 10, Player, harndrangZahl) end function auffuellen(Player, harndrangZahler) setElementData(Player,"harndrang", tonumber(harndrangZahler)+1) end
  13. No hay de que. P.D: Cierro el tema para que no hagan spam.
  14. -- server side: function ZonadescansoEntrada ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end outputChatBox ( "entraste a la zona de descanso", thePlayer, 177, 252, 3 ) toggleControl ( thePlayer, "fire", false ) toggleControl ( thePlayer, "next_weapon", false ) toggleControl ( thePlayer, "previous_weapon", false ) setPedWeaponSlot ( thePlayer, 0 ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "vehicle_fire", false ) toggleControl ( thePlayer, "vehicle_secondary_fire", false ) setElementData( thePlayer, "descansando", true) end addEventHandler ( "onColShapeHit", zonadescanso, ZonadescansoEntrada ) function zonadescansoSalida ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end outputChatBox ( "Te has ido de la zona de descanso", thePlayer, 255, 0, 0 ) toggleControl ( thePlayer, "fire", true ) toggleControl ( thePlayer, "next_weapon", true ) toggleControl ( thePlayer, "previous_weapon", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "vehicle_fire", true ) toggleControl ( thePlayer, "vehicle_secondary_fire", true ) setElementData( thePlayer, "descansando", false) end addEventHandler ( "onColShapeLeave", zonadescanso, zonadescansoSalida ) -- client side: addEventHandler("onClientPlayerDamage",root, function () if getElementData(source, "descansando") then cancelEvent() end end)
  15. Isn't also possible to do something like this: myEdit1 = guiCreateEdit(args...) myEdit2 = guiCreateEdit(args...) edits = {myEdit1, myEdit2} function checkEdits() for index, element in ipairs(edits) do if not isElement(element) then return end if guiGetText(element) == "" then return false else return true end end end
  16. This is a mess of client side functions and server side, I don't even get some things.. -- client side: function loginWindow() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Scrollbar = {} guiSetInputEnabled(true) showCursor(true) GUIEditor_Window[1] = guiCreateWindow(284,338,483,172,"LOGUE-SE OU REGISTRE-SE!",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) LoginEdit = guiCreateLabel(13,28,118,19,"Nome de usuário:",false,GUIEditor_Window[1]) GUIEditor_Edit[1] = guiCreateEdit(9,47,143,19,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(11,68,118,19,"Senha:",false,GUIEditor_Window[1]) GUIEditor_Edit[2] = guiCreateEdit(9,47,143,19,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],15) PassEdit = guiCreateEdit(9,84,143,19,"",false,GUIEditor_Window[1]) guiEditSetMasked(PassEdit,true) LoginB = guiCreateButton(9,113,70,29,"Login",false,GUIEditor_Window[1]) RegB = guiCreateButton(84,114,70,29,"Registro",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick",RegB,onPlayerRegister,false) GUIEditor_Label[3] = guiCreateLabel(100,149,313,18,"Connect Roleplay 2011 - [url=http://www.connect-rp.com]http://www.connect-rp.com[/url]",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(164,22,308,18,"Atualizações:",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Memo[1] = guiCreateMemo(164,42,298,98,"v0.1 BETA:\n- GUI @ Login feita.\n-------------------------------------------------------------------\nPróximas atualizações:\nv0.2 BETA:\n- Sistema de salvamento de contas.",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1], true) local sound = playSound("sounds/mario.mp3") --Play wasted.mp3 from the sounds folder setSoundVolume(sound, 1.0) -- set the sound volume to 50% end addEventHandler("onClientResourceStart", resourceRoot, loginWindow) function onPlayerRegister() local username = guiGetText(LoginEdit) local password = guiGetText(PassEdit) if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then triggerServerEvent("addTheAccount", localPlayer, localPlayer) end end -- server side: function registerThePlayer(player, username, password) local account = getAccount (username, password) if (account) then outputChatBox("Este nome de usuário já está registrado, escolha outro!", player) return end local accountAdded = addAccount(username, password) if(accountAdded) then outputChatBox("Obrigado por se registrar, agora logue-se.", player) else outputChatBox("Ocorreu um erro enquanto estávamos criando sua conta, tente novamente.", player) end end addEvent("addTheAccount", true) addEventHandler("addTheAccount", getRootElement(), registerThePlayer)
  17. You're welcome, and no, I won't unblock you.
  18. resourceRoot is the same as getResourceRootElement(getThisResource()), just a "shortcut"
  19. I think this is what you looking for: https://community.multitheftauto.com/index.php?p= ... ils&id=477
  20. Mira, tu script es un lio, no entiendo que intentas hacer.. arregle el script un poco. function create () hijackerv = createVehicle ( 500, 2071, -1332, 25, 0, 0, 0 ) blip = createBlipAttachedTo ( hijackerv, 53, 1 ) outputChatBox( 'Un auto ha aparecido, entra en él y repártelo!', 125, 51, 125 ) end create () function getdriver ( driver ) if ( driver ) then outputChatBox( 'Estas dentro del auto, apresúrate!', driver ) end end addEventHandler ( "onVehicleEnter", getRootElement(), getdriver ) function hijacker( thePlayer ) marker = createMarker ( 2015, -2410, 13.5, "cylinder", 7, 255, 0, 0, 90 ) blipe = createBlipAttachedTo ( marker, 51, 1 ) end addEventHandler ( "onVehicleEnter", getRootElement(), hijacker )
×
×
  • Create New...