Jump to content

Freeze & Unfreeze System


Behnam

Recommended Posts

Hi all.

Please give me a freeze and unfreeze system for acl group admin !

command: /freeze <PlayerName>

outputChatBox: You Freezed <nameplayer>

/unfreeze <PlayerName>

outputChatBox: You Unfreezed <nameplayer>

 

And For outputChatBox Player:

You Freezed By Admin <nameadmin>

outputChatBox For Unfreeze:

You Unfreezed By <nameadmin>

Thanks.

Link to comment
function adminFreeze (source,command,name)
	local acc = getAccountName(getPlayerAccount(source))
	if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then
		local selectedPlayer = getPlayerFromName(name)
		if ( selectedPlayer ) then
			if ( isElementFrozen(selectedPlayer) ) then
				setElementFrozen(selectedPlayer,false)
				outputChatBox("You have unfrozen the player "..name.."!",source,0,255,0)
				outputChatBox("You have been unfrozen by the Admin "..getPlayerName(source).."!",selectedPlayer,0,255,0)
				return
			end
			setElementFrozen(selectedPlayer,true)
			outputChatBox("You have frozen the player "..name.."!",source,0,255,0)
			outputChatBox("You have been frozen by the Admin "..getPlayerName(source).."!",selectedPlayer,255,0,0)
		else
			outputChatBox("Invalid player!",source,255,0,0)
		end
	end
end
addCommandHandler("freeze",adminFreeze)

You don't need the "/unfrozen" command, you can use "/freeze" to make the both actions.

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...