Jump to content

فريٍٍز


Tulip

Recommended Posts

السلام عليكم

ابي مبرمج ذوَ خبره ، يضبط كود يخلي الفريز يصك تيم فقط , بدلاً من ان يصك كل السيرفر فريز

 

addCommandHandler("freezeall",
function(playerSource)
    if hasObjectPermissionTo(playerSource,"function.kickPlayer",true) then
        for i, v in ipairs(getElementsByType("player")) do
            if not isPedInVehicle(v) then
                if getElementData(v,"frozenped") == "false" or not getElementData(v,"frozenped") then
                    setElementFrozen(v,true)
                    setElementData(v,"frozenped","true")
                    outputChatBox("FREEZE: #FFFFFFAll Players have been frozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                else
                    setElementFrozen(v,false)
                    setElementData(v,"frozenped","false")
                    outputChatBox("FREEZE: #FFFFFFAll Players have been unfrozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                end
            else
                if getElementData(v,"frozenveh") == "false" or not getElementData(v,"frozenveh") then
                    setElementFrozen(getPedOccupiedVehicle(v),true)
                    setElementData(v,"frozenveh","true")
                    outputChatBox("FREEZE: #FFFFFFAll Players have been frozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                elseif getElementData(v,"frozenveh") == "true" then
                    setElementFrozen(getPedOccupiedVehicle(v),false)
                    setElementData(v,"frozenveh","false")
                    outputChatBox("FREEZE: #FFFFFFAll Players have been unfrozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                end
            end
        end
    elseif hasObjectPermissionTo(playerSource,"function.kickPlayer",false) then
        outputChatBox("FREEZE: #FFFFFFSorry, you do not have the ACL rights to freeze players!",playerSource,255,0,0,true)
    end
end 
)

Link to comment
    addCommandHandler("freezeall",
    function(playerSource,command,teams)
        if hasObjectPermissionTo(playerSource,"function.kickPlayer",true) then
		   if not teams ~= "" then 
		team = getTeamFromName(teams)
              if team then 
            for i, v in ipairs(getPlayersInTeam(team)) do
                if not isPedInVehicle(v) then
                    if getElementData(v,"frozenped") == "false" or not getElementData(v,"frozenped") then
                        setElementFrozen(v,true)
                        setElementData(v,"frozenped","true")
                        outputChatBox("FREEZE: #FFFFFFAll Players have been frozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                    else
                        setElementFrozen(v,false)
                        setElementData(v,"frozenped","false")
                        outputChatBox("FREEZE: #FFFFFFAll Players have been unfrozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                    end
                else
                    if getElementData(v,"frozenveh") == "false" or not getElementData(v,"frozenveh") then
                        setElementFrozen(getPedOccupiedVehicle(v),true)
                        setElementData(v,"frozenveh","true")
                        outputChatBox("FREEZE: #FFFFFFAll Players have been frozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                    elseif getElementData(v,"frozenveh") == "true" then
                        setElementFrozen(getPedOccupiedVehicle(v),false)
                        setElementData(v,"frozenveh","false")
                        outputChatBox("FREEZE: #FFFFFFAll Players have been unfrozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
                    end
                end
            end
			else
		   outputChatBox("FREEZE: Team not found",playerSource,255,0,0,true)
          end
		  else 
	    outputChatBox("FREEZE: /freezeall [TEAM NAME]",playerSource,255,0,0,true)
	  end 
	  else
	  outputChatBox("FREEZE: #FFFFFFSorry, you do not have the ACL rights to freeze players!",playerSource,255,0,0,true)
  end
end
)

 

  • Like 1
Link to comment
function getPL(team)
    local t = { }
    local player = getPlayersInTeam(team)
    for i,v in pairs(player) do
      if not isPedDead(v) then
       table.insert(t,v)
      end
    end
    return t
end

function aSetPlayerFrozen( player, bool)
	if isElement( player ) then
		toggleAllControls ( player, not bool, true, false )
		local vehicle = getPedOccupiedVehicle( player )
		if vehicle then
			setElementFrozen ( vehicle, bool )
		end
	end	
end

local teamname = 'اسم التيم' 

addCommandHandler("freezeall",
function(playerSource)
    if hasObjectPermissionTo(playerSource,"function.kickPlayer",true) then
        for i, v in ipairs(getPL(getTeamFromName(teamname))) do
            if getElementData(v,"frozenped") == "false" or not getElementData(v,"frozenped") then
				aSetPlayerFrozen ( v, true)
                setElementData(v,"frozenped","true")
                outputChatBox("FREEZE: #FFFFFFAll Players have been frozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
            else
				aSetPlayerFrozen ( v, false)
                setElementData(v,"frozenped","false")
                outputChatBox("FREEZE: #FFFFFFAll Players have been unfrozen by "..getPlayerName(playerSource).."!",v,255,0,0,true)
			end	
		end
    else
        outputChatBox("FREEZE: #FFFFFFSorry, you do not have the ACL rights to freeze players!",playerSource,255,0,0,true)
    end
end 
)

 

Edited by MR.S3D
  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...