Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. exports.resource_name:setPlayerTeam( source, getTeamFromName ( "Civilian" ) )
  2. If it doesn't work try to export that function.
  3. How you are setting player team?
  4. But read my post again. If you want it works, you must use setPlayerTeam function, not from admin panel!!
  5. But It won't draw text above your head. You have to get player position every render, and use this function: getScreenFromWorldPosition.
  6. Ah yea. Thanks man, that means a lot to me.
  7. It will works, If you change team by using setPlayerTeam function.
  8. WhoAmI

    help

    function someName ( ) -- code unbindKey ( "U", "down", someName ) end bindKey ( "U", "down", someName ) It's clientside binding.
  9. Of couse It would lag couse you are binding key every render. I made team change event, so in my idea it will look like _setPlayerTeam = setPlayerTeam addEvent( "onPlayerChangeTeam", true ) function setPlayerTeam ( thePlayer, theTeam ) triggerEvent ( "onPlayerChangeTeam", root, thePlayer, theTeam ) return _setPlayerTeam ( thePlayer, theTeam ) end function fixing ( player ) if ( isPedInVehicle ( player ) ) then local theVehicle = getPedOccupiedVehicle ( player ) if ( theVehicle ) then fixVehicle ( theVehicle ) end else return end end addEventHandler ( "onPlayerChangeTeam", root, function (player, team) if ( getTeamName ( team ) == "Stuntage Arena" ) then bindKey ( player, "R", "down", fixing ) else unbindKey ( player, "R", "down", fixing ) end end ) Everything serverside. It will work, If you are setting team using function setPlayerTeam.
  10. It will looks like this addEventHandler ( "onPlayerChangeTeam", root, function ( player, team ) local teamName = getTeamName ( team ) if teamName ~= "Criminal" then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end end )
  11. Well, the event 'onPlayerChangeTeam' will be active when you would use setPlayerTeam.
  12. So use my event. addEventHandler ( "onPlayerChangeTeam", root, function ( player, team ) --here destroyElement end )
  13. I don't know if It works, but _setPlayerTeam = setPlayerTeam addEvent( "onPlayerChangeTeam", true ) function setPlayerTeam ( thePlayer, theTeam ) triggerEvent ( "onPlayerChangeTeam", root, thePlayer, theTeam ) return _setPlayerTeam ( thePlayer, theTeam ) end And then addEventHandler ( "onPlayerChangeTeam", root, function ( player, team ) outputChatBox ( getPlayerName ( player ) .. ": " .. getTeamName ( team ) ) end ) It should output message 'nick: team name'.
  14. WhoAmI

    Cars

    This guy is hilarious! Type /debugscript 3 in chat and show us error.
  15. WhoAmI

    playSound3D

    Thanks, I'd test it tomorrow, but I can already see It will work.
  16. WhoAmI

    playSound3D

    Ah yea. Client: addEvent("bassOn", true) addEventHandler("bassOn", root, function () local veh = getPedOccupiedVehicle(localPlayer) local x, y, z = getElementPosition(veh) local sound1 = playSound3D("sounds/sound.mp3", x, y, z, true) setSoundVolume(sound1, 0.7) setSoundMaxDistance( sound1, 40 ) attachElements(sound1, veh) end ) addEvent("bassOff", true) addEventHandler("bassOff", root, function (veh) local veh = getPedOccupiedVehicle(localPlayer) local elements = getAttachedElements(veh) if (#elements > 0) then for _,sound in ipairs(elements) do if (getElementType(sound) == "sound") then destroyElement(sound) end end end end ) Server: addCommandHandler("hardbasson", function (player) triggerClientEvent("bassOn", root) end ) addCommandHandler("hardbassoff", function (player) triggerClientEvent("bassOff", root) end ) And know other can't hear this. Only me.
  17. WhoAmI

    playSound3D

    Well, It works, but it doesn't attach sound to vehicle. addEvent("bassOn", true) addEventHandler("bassOn", root, function () local veh = getPedOccupiedVehicle(localPlayer) local x, y, z = getElementPosition(veh) local sound1 = playSound3D("sounds/sound.mp3", x, y, z, true) setSoundVolume(sound1, 0.7) setSoundMaxDistance( sound1, 40 ) attachElement(sound1, veh) end ) addEvent("bassOff", true) addEventHandler("bassOff", root, function (veh) local veh = getPedOccupiedVehicle(localPlayer) local elements = getAttachedElements(veh) if (#elements > 0) then for _,sound in ipairs(elements) do if (getElementType(sound) == "sound") then destroyElement(sound) end end end end ) Server addCommandHandler("hardbasson", function (player) triggerClientEvent("bassOn", root) end ) addCommandHandler("hardbassoff", function (player) triggerClientEvent("bassOff", root) end )
  18. WhoAmI

    playSound3D

    addCommandHandler("hardbasson", function (player) local veh = getPedOccupiedVehicle(player) triggerClientEvent("bassOn", root, veh) end ) addCommandHandler("hardbassoff", function (player) local veh = getPedOccupiedVehicle(player) triggerClientEvent("bassOff", root, veh) end ) Client local sound addEvent("bassOn", true) addEventHandler("bassOn", root, function (veh) if (isPedInVehicle(localPlayer)) then local x, y, z = getElementPosition(veh) local sound1 = playSound3D("sounds/sound.mp3", x, y, z, true) setSoundVolume(sound1, 0.7) setSoundMaxDistance( sound1, 30 ) attachElements(sound1, veh) end end ) addEvent("bassOff", true) addEventHandler("bassOff", root, function (veh) if (isPedInVehicle(localPlayer)) then local elements = getAttachedElements(veh) if (#elements > 0) then for _,sound in ipairs(elements) do if (getElementType(sound) == "sound") then destroyElement(sound) end end end end end ) It's only for 1 player.
  19. WhoAmI

    playSound3D

    That's all? addCommandHandler("hardbasson", function (player) triggerClientEvent(player, "bassOn", root) end ) addCommandHandler("hardbassoff", function (player) triggerClientEvent(player, "bassOff", root) end ) @EDIT: It doesn't work.
  20. WhoAmI

    playSound3D

    I got this addCommandHandler("zaczep", function ( ) if (isPedInVehicle(localPlayer)) then local veh = getPedOccupiedVehicle(localPlayer) local x, y, z = getElementPosition(veh) local sound1 = playSound3D("sounds/sound.mp3", x, y, z, true) setSoundVolume(sound1, 0.7) setSoundMaxDistance( sound1, 30 ) attachElements(sound1, veh) end end ) addCommandHandler("odczep", function ( ) if (isPedInVehicle(localPlayer)) then local veh = getPedOccupiedVehicle(localPlayer) local elements = getAttachedElements(veh) if (#elements > 0) then for _,sound in ipairs(elements) do if (getElementType(sound) == "sound") then destroyElement(sound) end end end end end ) How i can do that all people can hear the sound? Couse only client can hear it.
  21. WhoAmI

    Dynamic Table

    table.remove(table, [pos]) -- position of value in table, for example 1'st position is 1st text
  22. Try to change 10000 to 5000.
×
×
  • Create New...