获取本地玩家不要使用GetPlayerPed(-1),而是PlayerPedId()。
如果服务器正在使用ox_lib等库,可以直接使用缓存;减小性能开销,而不是每次都获取。
Documentation for Overextended's resources for FiveM/RedM
overextended.dev
最后一个end缺少一个“)”,注意代码缩进,提高代码可读性。
另外,你需要明白PlayerPed、PlayerIndex、PlayerServerId的区别。
docs.fivem.net
[Control values and meaning](https://docs.fivem.net/docs/game-references/controls/#controls) Example: `CONTROLS::DISABLE_CONTROL_ACTION(2, 19, true)` disables the switching UI from appearing both whe
docs.fivem.net