Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. The only thing you can do is change the health of it, but you can't make physical damage.
  2. I guess you are talking about physical damage, if so, then as far as I know, there isn't.
  3. La verdad no entiendo para que queres ejecutar un evento que ni tenes idea de que hace.
  4. Dice que el evento 'getWeapons' no esta definido en el server side. Para lo de la vida: setElementHealth takePlayerMoney
  5. Castillo

    In search of

    There was one inside a RPG game mode, I think it's this one: https://community.multitheftauto.com/ind ... ils&id=494
  6. Yes, it is, but I was unable to find the problem, doesn't seem to be a script bug.
  7. Ahora tenes que ejecutar los eventos esos "mp4", "uzi", etc desde el client side, asi: triggerServerEvent ( "uzi", localPlayer )
  8. Castillo

    In search of

    What do you mean?
  9. Castillo

    [HELP] Chat

    No, there's no such event "onPlayerTeamChat", is all part of "onPlayerChat".
  10. You can't cancel it, but you can set it damage proof with: setVehicleDamageProof
  11. Castillo

    [HELP] Chat

    That won't really work though, since it doesn't trigger it for all these who are near. The chatbbubles was not made for this, you'll have to edit that script as well.
  12. Castillo

    [HELP] Chat

    If you would at least try to do it, but you don't. chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","Local") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","Local") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("[Local] "..nick..": "..msg,v,r,g,b,true) end end triggerEvent ( "onPlayerLocalChat", player, msg ) end addCommandHandler("Local",onChat)
  13. Castillo

    [HELP] Chat

    And you must add the custom event on local chat.
  14. Add the resource to the ACL group 'Admin' in the acl.xml.
  15. Castillo

    [HELP] Chat

    Trigger a event from the local chat script when a player chats, then on chatbubbles: function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 2 then triggerClientEvent("onChatbubblesMessageIncome",source,message,messagetype) end end end addEventHandler("onPlayerChat",getRootElement(),sendMessageToClient) Instead of: addEventHandler("onPlayerChat",getRootElement(),sendMessageToClient) You put your custom event, like this: addEvent ( "onPlayerLocalChat", true ) addEventHandler("onPlayerLocalChat",getRootElement(),sendMessageToClient) And remove 'messageType' from 'sendMessageToClient' function.
  16. viewtopic.php?f=91&t=51513
  17. Do you have the socket module installed? does the server console output any error?
  18. Castillo

    [HELP] Chat

    At your local chat script you can trigger a custom event, then you can use it instead of 'onPlayerChat' at the chatbubbles.
  19. Oh, I guess you are talking about the "targetElement" argument, I don't really use shaders, so I didn't know about that one.
  20. gui.lua: function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Welcome to the server", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 15) guiEditSetMaxLength(edtPass, 15) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) guiSetVisible(wdwLogin, false) end addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) createLoginWindow ( ) outputChatBox("Welcome to My MTA:SA Server, please log in.") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end showCursor(true) guiSetInputEnabled(true) end ) function clientSubmitLogin(button,state) if button == "left" and state == "up" then local username = guiGetText(edtUser) local password = guiGetText(edtPass) if username and password then triggerServerEvent("submitLogin", localPlayer, username, password) guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) else outputChatBox("Please enter a username and password") end end end Errors I have found: 1: You we're using 'getRootElement' and that's wrong, because you should have used 'getRootElement ( )'. 2: You put "submitlogin" instead of "submitLogin" with upper case "L".
  21. No, as far as I know such thing is not possible.
×
×
  • Create New...