--The LuaPlugin was created by jnz
--Any problems hit me up on www.dcomproductions.com forums

function Load()
	print("ExamplePlugin.Lua - Load")
end

function Unload()
	print("ExamplePlugin.Lua - Unload")
end

function OnError(Error)
	print(Error)
end

function OnChat(PlayerId, Type, Message, Target)
	print(string.format("ExamplePlugin.Lua - OnChat(%d, %d, %s, %d)", PlayerId, Type, Message, Target))

	return 1
end

function OnPlayerJoin(PlayerID, Nick)
	print(string.format("ExamplePlugin.Lua - OnPlayerJoin(%d, %s)", PlayerId, Nick))
end

function OnPlayerLeave(PlayerID)
	print(string.format("ExamplePlugin.Lua - OnPlayerLeave(%d)", PlayerId))
end

function OnHostMessage(PlayerID, Type, Message)
	print(string.format("ExamplePlugin.Lua - OnHostMessage(%d, %d, %s)", PlayerId, Type, Message))
end

function OnLevelLoaded()
	print(string.format("ExamplePlugin.Lua - OnLevelLoaded()"))
end

function OnGameOver()
	print(string.format("ExamplePlugin.Lua - OnGameOver()"))
end

function OnConsoleOutput(Message)
	print(string.format("ExamplePlugin.Lua - OnConsoleOutput(%s)", Message))
end

function OnObjectCreate(Object)
	Attach_Script(Object, "myscript", "")
end

function OnPlayerVersion(PlayerID, Version)
	print(string.format("ExamplePlugin.Lua - OnPlayerVersion(%d, %f)", PlayerId, Version))
end

function OnCharacterPurchase(Purchaser, Cost, Preset, PurchaserRet) -- Preset is NOT a string. It's a preset ID. Use Get_Translated_String to get the preset name.
--PurchaserRet, 0 means they purchased it.
--Purchaser is a GameObject of the person who bought it.

	print(string.format("ExamplePlugin.Lua - OnCharacterPurchase(%d, %d, %d, %d)", Purchaser, Cost, Preset, PurchaserRet))
end

function OnVehiclePurchase(Purchaser, Cost, Preset, PurchaserRet) 
	print(string.format("ExamplePlugin.Lua - OnVehiclePurchase(%d, %d, %d, %d)", Purchaser, Cost, Preset, PurchaserRet))
end

function OnPowerupPurchase(Purchaser, Cost, Preset, PurchaserRet) 
	print(string.format("ExamplePlugin.Lua - OnPowerupPurchase(%d, %d, %d, %d)", Purchaser, Cost, Preset, PurchaserRet))
end

function OnDDE(Message)
	print(string.format("ExamplePlugin.Lua - OnDDE(%s)", Message))
end

function OnThink()
	
end

function Serial_Hook(PlayerId, Serial)
	print(string.format("ExamplePlugin.Lua - Serial_Hook(%d, %s)", PlayerId, Serial))
end

function Loading_Hook(PlayerId, Loading)
	print(string.format("ExamplePlugin.Lua - Loading_Hook(%d, %d)", PlayerId, Loading))
end

function Damage_Hook(PlayerId, Damager, Target, Damage, Warhead)
	print(string.format("ExamplePlugin.Lua - Damage_Hook(%d, %d, %d, %d, %d)", PlayerId, Damager, Target, Damage, Warhead))

	return 1
end

function Ping_Hook(PlayerId, Ping)
	print(string.format("ExamplePlugin.Lua - Ping_Hook(%d, %d)", PlayerId, Ping))
end

function Suicide_Hook(PlayerId)
	print(string.format("ExamplePlugin.Lua - Suicide_Hook(%d)", PlayerId))
	
	return 1
end

function Radio_Hook(Team, PlayerId, a, RadioId, b)
	print(string.format("ExamplePlugin.Lua - Radio_Hook(%d, %d, %d, %d)", Team, PlayerId, a, RadioId, b))

	return 1
end



myscript = {}
function myscript:Created(ID, obj)	
	print("Created", ID, obj)
end

function myscript:Destroyed(ID, obj)
	print("Destroyed", ID, obj)
end

function myscript:Killed(ID, obj, killer)
	print("Killed", ID, obj, killer)
end

function myscript:Damaged(ID, obj, shooter, damage)
	print("Damaged", ID, obj, shooter, damage)
end

function myscript:Custom(ID, obj, message, param, sender)
	print("Custom", ID, obj, message, param, sender)
end

function myscript:Enemy_Seen(ID, obj, seen)
	print("Enemy_Seen", ID, obj, seen)
end

function myscript:Action_Complete(ID, obj, action)
	print("Action_Complete", ID, obj, action)
end

function myscript:Animation_Complete(ID, obj, anim)
	print("Animation_Complete", ID, obj, anim)
end

function myscript:Poked(ID, obj, poker)
	print("Poked", ID, obj, poker)
end

function myscript:Entered(ID, obj, enter)
	print("Entered", ID, obj, enter)
end

function myscript:Exited(ID, obj, exiter)
	print("Exited", ID, obj, exiter)
end

function myscript:Timer_Expired(ID, obj, num)
	print("Timer_Expired", ID, obj, num)
end

Register_Script("myscript", "", myscript)

