Skip to content

Commit 76c763a

Browse files
committed
replace OnNPCEnterVehicle with OnPlayerStateChange
1 parent b0469f7 commit 76c763a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NPC_ResetSurfingData.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ public OnPlayerCommandText(playerid, cmdtext[])
3535
}
3636

3737
// 当 NPC 进入车辆时重置冲浪状态
38-
public OnNPCEnterVehicle(npcid, vehicleid, seatid)
38+
public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate)
3939
{
4040
// 当 NPC 进入车辆时停止冲浪
41-
NPC_ResetSurfingData(npcid);
41+
if(IsPlayerNPC(playerid) && (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)) {
42+
NPC_ResetSurfingData(playerid);
43+
}
4244
return 1;
4345
}
4446
```

0 commit comments

Comments
 (0)