Jump to content

anumaz

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by anumaz

  1. anumaz

    Weird error

    That's not really the issue as I commented out that line to see if it was the problem, and it was not.
  2. anumaz

    Weird error

    Yes, I did: crun for k, v in ipairs ( getPlayersInTeam ( getTeamFromName( "Los Santos Fire Department" ) ) ) do outputChatBox ( "Hello", v ) end and it returned me 'Hello'!
  3. anumaz

    Weird error

    I showed the whole server-side script. Still giving me the same error as explained in post 1.
  4. anumaz

    Weird error

    I'm getting the same error.
  5. anumaz

    Weird error

    function serverfire (thePlayer) for k, v in ipairs ( getPlayersInTeam ( getTeamFromName( "Los Santos Fire Department" ) ) ) do outputChatBox("[RADIO] This is dispatch, We've got a report from a fire at " .. randomfire[4] .. " via the emergency line, over.", v, 245, 40, 135) outputChatBox("[RADIO] Please report there NOW.", v, 245, 40, 135) end if exports.global:isPlayerAdmin(thePlayer) then triggerClientEvent( "burnbabyburn", getRootElement(), jevifire ) triggerClientEvent( "ringTheBell", root, fdbell ) outputChatBox("Fiiiire!", thePlayer) end end addCommandHandler ( "jevifire" , serverfire ) I'm getting this error: Line #11: bad argument #1 to 'ipairs' (table expected, got nil) I really don't know how to fix it.
  6. Client side: function fdbell() local Sound = playSound3D( "alarm/firealarm.mp3", 1725, -1130, 24, false ) setElementInterior(Sound, getElementInterior(localPlayer)) setElementDimension(Sound, getElementDimension(localPlayer)) setSoundMinDistance(Sound, 25) setSoundMaxDistance(Sound, 70) -- setSoundVolume( Sound, 1 ) end addEvent("ringTheBell", true) addEventHandler("ringTheBell", root, fdbell) function loadthescript() outputChatBox("Script loaded -- debug") end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), loadthescript) addCommandHandler("bell", fdbell) function fdfire(commandName, fireid) if fireid then if tonumber(fireid) == 1 then createFire(1700, -1168, 23, 60) createFire(1698, -1168, 23, 60) local blipicon = createBlip( 1700, -1168, 23, 43, 0, 0, 0, 255 ) outputChatBox("Fire created at 1700, -1168, 23") local onlinePlayers = getElementsByType("player") for index, player in pairs(onlinePlayers) do local x, y, z = getElementPosition(player) local distance = getDistanceBetweenPoints3D(1725, -1130, 24, x, y, z) if (distance <50) then setTimer(function () destroyElement(blipicon) end, 900000, 1) setTimer(function () triggerEvent("ringTheBell", player) end, 5000, 1) end end elseif tonumber(fireid) == 2 then createFire(1729, -1174, 23, 60) createFire(1727, -1174, 23, 60) local blipicon = createBlip( 1729, -1174, 23, 43, 0, 0, 0, 255 ) outputChatBox("Fire created at 1729, -1174, 23") local onlinePlayers = getElementsByType("player") for index, player in pairs(onlinePlayers) do local x, y, z = getElementPosition(player) local distance = getDistanceBetweenPoints3D(1725, -1130, 24, x, y, z) if (distance <50) then setTimer(function () destroyElement(blipicon) end, 900000, 1) setTimer(function () triggerEvent("ringTheBell", player) end, 5000, 1) end end else outputChatBox("Missing ID") end else outputChatBox("Syntax: /fdfire [id]", thePlayer) outputChatBox("IDs available: 1, 2", thePlayer) end end -- addCommandHandler("fdfire", fdfire) addEvent ( "createfdfire", true ) addEventHandler ( "createfdfire", getRootElement(), fdfire ) Server side: function makeitburn (player, commandName, fdfire) triggerClientEvent( "createfdfire", getRootElement(), fdfire ) end addCommandHandler ( "fdfire", makeitburn ) Issue is it doesn't get the numer I type (1 or 2) after /fdfire. It always outputs the syntax as if there was no number.
  7. function makeitburn (player, commandName, fdfire) triggerClientEvent( "createfdfire", getRootElement(), fdfire ) end addCommandHandler ( "fdfire", makeitburn ) Anything wrong with that? It always shows the syntax as if I didn't put a number next to it?
  8. I don't really know how to do that. Maybe you can indicate me a tutorial or something?
  9. Hey, I created a little script that works just fine client-side: It creates a fire, a blip and PlaySound3D. However, that is all client-side and no one in the server can see/hear them. These functions (or most of them) are just available client-side. My question is: how to make them hearable/visible to others? Thanks, Anumaz
×
×
  • Create New...