First commit
This commit is contained in:
		
							
								
								
									
										21
									
								
								app/SabrehavenServer/data/talkactions/scripts/add_tutor.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								app/SabrehavenServer/data/talkactions/scripts/add_tutor.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
function onSay(player, words, param)
 | 
			
		||||
	if player:getAccountType() <= ACCOUNT_TYPE_TUTOR then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local target = Player(param)
 | 
			
		||||
	if target == nil then
 | 
			
		||||
		player:sendCancelMessage("A player with that name is not online.")
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	if target:getAccountType() ~= ACCOUNT_TYPE_NORMAL then
 | 
			
		||||
		player:sendCancelMessage("You can only promote a normal player to a tutor.")
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	target:setAccountType(ACCOUNT_TYPE_TUTOR)
 | 
			
		||||
	target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been promoted to a tutor by " .. player:getName() .. ".")
 | 
			
		||||
	player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have promoted " .. target:getName() .. " to a tutor.")
 | 
			
		||||
	return false
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user