First commit
This commit is contained in:
		
							
								
								
									
										30
									
								
								app/SabrehavenServer/data/talkactions/scripts/owner.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								app/SabrehavenServer/data/talkactions/scripts/owner.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
function onSay(player, words, param)
 | 
			
		||||
	if not player:getGroup():getAccess() then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	if player:getAccountType() < ACCOUNT_TYPE_GOD then
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local tile = Tile(player:getPosition())
 | 
			
		||||
	local house = tile and tile:getHouse()
 | 
			
		||||
	if house == nil then
 | 
			
		||||
		player:sendCancelMessage("You are not inside a house.")
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	if param == "" or param == "none" then
 | 
			
		||||
		house:setOwnerGuid(0)
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local targetPlayer = Player(param)
 | 
			
		||||
	if targetPlayer == nil then
 | 
			
		||||
		player:sendCancelMessage("Player not found.")
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	house:setOwnerGuid(targetPlayer:getGuid())
 | 
			
		||||
	return false
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user