dp-s_doc/CallBack/History_Log/History_Log.md

43 lines
911 B
Markdown
Raw Normal View History

2025-11-20 16:31:34 +08:00
# History_Log 回调函数文档
**回调说明**
`History_Log`类用于处理游戏中的历史日志
---
**注册方法**
- 物品减少:`Cb_History_Log_Func["Item-"] <- function (SUser, Data) {}`
- 物品增加:`Cb_History_Log_Func["Item+"] <- function (SUser, Data) {}`
**例子**
```squirrel
Cb_History_Log_Func["Item-"] <- function (SUser, Data) {
local itemId = Data[15].tointeger();
local itemCount = Data[17].tointeger();
local reason = Data[18].tointeger();
}
```
or
```squirrel
Cb_History_Log_Func["Item+"] <- function (SUser, Data) {
local itemId = Data[15].tointeger();
local itemCount = Data[17].tointeger();
local reason = Data[18].tointeger();
}
```
or
```squirrel
function Test_Function(SUser)
{
print("上线");
}
Cb_reach_game_world_Func["Test"] <- Test_Function;
```
or
```squirrel
Cb_reach_game_world_Func.Test <- function (SUser)
{
print("上线");
};
```