Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. Tu quieres sin comando -.-'. Server side: function godmode() local playerAcc = getPlayerAccount(source) local accountName = getAccountName(playerAcc) for _, group in ipairs ({"Admin", "Supermoderator"}) do if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then triggerClientEvent("inmortal", source) end end end addEventHandler("onPlayerLogin", getRootElement(), godmode) Clien Side: addEvent("inmortal", true) addEventHandler("inmortal", getRootElement(), addEventHandler("onClientPlayerDamage", getRootElement(), function clientgodmode cancelEvent() end ) ) Intenta eso. Si no me rindo .
  2. Sasu

    Help event script

    Perfect. Thank you very much.
  3. nada :C nose como voy a hacer encontre uno que se incia automatico pero es para players sin admin para smod para admin para mod para todos es esto nose como se edita para que sea solo para admin smod y mod function stopDamage ( theplayer , attacker, weapon, bodypart ) cancelEvent() --cancel the event end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) Aaaahhhh. Yo solo reparaba tu script -.-'. Intenta asi: function toggleGodMode(thePlayer) local account = getPlayerAccount(thePlayer) if not account or isGuestAccount(account) then return end local accountName = getAccountName(account) for _, group in ipairs ({"Admin", "Supermoderator"}) do if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then if ( getElementData( thePlayer, "invicible", true ) == "No") or ( getElementData( thePlayer, "invicible", true ) == false ) then setElementData(thePlayer, "invicible", "Si") outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) addEventHandler("onPlayerDamage", getRootElement(), godmode) else setElementData(thePlayer, "invicible", "No") outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) removeEventHandler("onPlayerDamage", getRootElement(), godmode) end end end end addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode function godmode() cancelEvent() end
  4. function evento(source) if (isElement(theMarker)) then destroyElement(theMarker) local nombre2 = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Eventos removidos por #0000FF"..nombre2.."#00FF00.", getRootElement(), 255, 255, 255, true) removeCommandHandler("eventwarp") else local x,y,z = getElementPosition(source) local theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) local nombre = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Se ha creado un evento por #0000FF"..nombre..". #00FF00Usa #FF0000/eventwarp #00FF00para participar!", getRootElement(), 255, 255, 255, true) addCommandHandler("eventwarp", eventowarp) end end addCommandHandler("event", evento) function eventowarp(thePlayer) if isElement(theMarker) then setElementPosition( thePlayer, x, y, z) end end Its create the marker but when I executed the command "event" again its create another marker. Also "eventwarp" It doesnt work. Can you help me?
  5. Ese es problema de los players
  6. Sasu

    help

    Also you need this for the text: table.concat local message = table.concat ( { msg } ) Is it correctly?
  7. Sasu

    help

    function createped (player, cmd, modelid, x1, y1, z1, text) local modelid = tonumber(modelid) local text = {} local say = text local x1 = tonumber(x1) local y1 = tonumber(y1) local z1 = tonumber(z1) if modelid and x1 and y1 and z1 and text then ped1 = createPed ( modelid, x1, y1, z1) setPedFrozen ( ped1, true) cool = createColRectangle ( x1, y1, z1, 5, 5 ) else outputChatBox("[invalid Syntax]: /createped [modelid] [x] [y] [z] [text]", player, 255, 0, 0 ) end end addCommandHandler("createped", createped) addEventHandler ("onColShapeHit", root, function (hitPlayer) if isElement(cool) and (source == cool) then if(getElementType(hitPlayer) == "player") then if isElement(text) then outputChatBox ( "Bot say:"..text, player, 255, 0, 0 ) end end end end )
  8. Sasu

    help

    What do you want to do?
  9. Sasu

    global chat

    I really don't think this will do it .. I did the introduction.
  10. Usas el gang system de castillo. Si es asi prueba: ------------------------------------------------Script----------------------------------------------------- function createTheGate () myGate1 = createObject ( 10828, 836.5, -2069.6999511719, 23, 0, 359.99993896484, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate (source) if ( getElementData(source, "gang", true) == "LGM") then moveObject ( myGate1, 2500, 836.5, -2069.6999511719, 8 ) else outputChatBox("#FF0000[server]#00FF00No Perteneces A Este Clan.", source, 255, 255, 255, true) end end addCommandHandler("lgmentry",openMyGate) function movingMyGateBack () if ( getElementData(source, "gang", true) == "LGM") then moveObject ( myGate1, 2500, 836.5, -2069.6999511719, 23 ) else outputChatBox("#FF0000[server]#00FF00No Perteneces A Este Clan.", source, 255, 255, 255, true) end end addCommandHandler("lgmentry2",movingMyGateBack)
  11. Sasu

    global chat

    Thanks to me? :C function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); if message then for _,v in ipairs(getElementsByType("player")) do outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,v, 255, 255, 255, true) end end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"b", "down", "chatbox", "global"); end end ) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "b", "down", "chatbox", "global"); end )
  12. Sasu

    help

    function createped (player, cmd, modelid, x1, y1, z1) local modelid = tonumber(modelid) local x1 = tonumber(x1) local y1 = tonumber(y1) local z1 = tonumber(z1) if modelid and x1 and y1 and z1 then ped1 = createPed ( modelid, x1, y1, z1) setPedFrozen ( ped1, true) else outputChatBox("[invalid Syntax]: /createped [modelid] [x] [y] [z]", player, 255, 0, 0 ) end end addCommandHandler("createped", createped) Try this. And dont spam.
  13. Sasu

    help

    What is your problem?
  14. Sasu

    global chat

    Create a client side Because I dont know how to do all in server side
  15. Sasu

    Scoreboard

    Any error on debug 3?
  16. Sasu

    global chat

    Lol sorry. I didnt see that . Thanks for correcting me. EDIT: so... function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message, getRootElement(), 255, 255, 255, true) end addCommandHandler("global", globalMessage) bindKey(getRootElement(), "b", "down", "chatbox", "global") Is it correctly?
  17. Sasu

    Scoreboard

    Use export. exports.scoreboard:scoreboardAddColumn ( "VIP" )
  18. Sasu

    global chat

    Pain, I forgot that I can do on client side but in server side we cant don ._.. Say me a example.
  19. Sasu

    global chat

    Anderl its imposible bind a key to command in server side. Search that on wiki. https://wiki.multitheftauto.com/wiki/BindKey
  20. Sasu

    global chat

    Im boring Server: function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message, getRootElement(), 255, 255, 255, true) end addCommandHandler("global", globalMessage) Client: bindKey("b", "down", "chatbox", "global")
  21. OFF-TOPIC: Perdonen por el doble post. Estuve testeando y la unica manera es que hagas un trigger. Asi quedaria el client: function union() playSound("dont.mp3") end addEvent("onClientPlayerUnir", true) addEventHandler("onClientPlayerUnir", getLocalPlayer(), union) Y debes agregar otro que sea del type server: function sonido() triggerClientEvent("onClientPlayerUnir", source) end addEventHandler("onPlayerJoin", getRootElement(), sonido)
  22. Pues eso que estas haciendo se llama "Script". Los gamemode estan compuestos de muchos script. Si no quieres el spawn debes sacarlo en la configuracion. Supongo que es archivo spawn.lua. Solo lo tenes que sacar. <meta> <info author="TocToc" type="script" name="WND Beta Test" description="Beta Test Scripts" /> <script src="text.lua" type="client" /> <script src="sonido.lua" type="client" /> <file src="dont.mp3"/> </meta>
  23. Intenta asi: function toggleGodMode(thePlayer) local account = getPlayerAccount(thePlayer) if not account or isGuestAccount(account) then return end local accountName = getAccountName(account) for _, group in ipairs ({"Admin", "Supermoderator"}) do if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then if ( getElementData( thePlayer, "invicible", true ) == "No") or ( getElementData( thePlayer, "invicible", true ) == false ) then setElementData(thePlayer, "invicible", "Si") outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) else setElementData(thePlayer, "invicible", "No") outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) end end end end addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode Ya lo testee y funciona correctamente.
  24. En type debe decir script. Asi mia: <info author="TocToc" type="script" name="WND Beta Test" description="Beta Test Scripts" />
×
×
  • Create New...