Open IstuntmanI opened 6 years ago
By the way, with this SDK you can easily redirect AMX functions: https://github.com/maddinat0r/samp-plugin-sdk/
(not sure if hooking DisablePlayerCheckpoint
and returning sampgdk::DisablePlayerCheckpoint
in the hooked function would create an infinite loop, didn't test that yet, maybe @maddinat0r can respond to this ?)
Yes, he shouldn't be using DisablePlayerCheckpoint
. The right native to use in that case would be Streamer_ToggleItem
(or TogglePlayerDynamicCP
).
If you were to hook DisablePlayerCheckpoint
, I would think you'd also have to hook SetPlayerCheckpoint
and reset those variables (there's already some native hooking code here which could be refactored: https://github.com/samp-incognito/samp-streamer-plugin/blob/master/src/utility/amx.cpp#L47-L67). However, these natives will still ultimately be incompatible with the streamer plugin natives. The next time the streamer updates, the streamed checkpoint will just be set for the player again. There should be a note on the wiki about not using them together.
The reason I'm using DisablePlayerCheckpoint is because neither Streamer_ToggleItem, TogglePlayerDynamicCP, or TogglePlayerAllDynamicCPs are hiding the checkpoint when used. DisablePlayerCheckpoint is the only way I can remove the checkpoint from the map when using Streamer_ToggleItemUpdate and TogglePlayerAllDynamicCPs
The checkpoint should be hidden, but it won't take effect until the next update. You should call Streamer_ToggleItem
, Streamer_Update
, and then finally Streamer_ToggleItemUpdate
.
That doesn't hide the checkpoint either.
For the life of me I can't get the visible checkpoint to disappear before using Streamer_ToggleItemUpdate and TogglePlayerAllDynamicCPs WITHOUT using DisablePlayerCheckpoint. Help?
Not to bump this but.. maybe your doing something wrong.
I use Streamer_ToggleItem to stop showing checkpoints lets say when a player enters a custom transfender i made, then reenable it when they are done. It all works fine.
Originally posted by BeckzyBoi here: http://forum.sa-mp.com/showpost.php?p=3960733&postcount=5703
OnPlayerCommandText
:OnPlayerSpawn
:TogglePlayerDynamicCPs2:
When the player re-spawns in the range of a checkpoint, the checkpoint is not shown. They must re-enter the checkpoint streaming distance.
I think that this happens because the
DisablePlayerCheckpoint
function is used in this case to cancel a dynamic CP, but because the Streamer Plugin didn't hook theDisablePlayerCheckpoint
function, the Streamer Plugin still thinks that the player sees an checkpoint, so it doesn't get restreamed yet. Probably hooking this function and settingplayer.visibleCheckpoint
,player.activeCheckpoint
andplayer.delayedCheckpoint
to0
would fix that ? (also doing this for race checkpoints)