Streamer CP's aren't destroyed
#1

Morning all,
I'm having a very unusual issue and I can't figure out why! I'm creating a missions system using Incognito's Streamer (utilising the checkpoint streaming facilities), however when I destroy a checkpoint it's not 'destroyed'... However, it does not trigger any of my scripted events - like it doesn't exist.

Any clues? I'm baffled. Also, this issue doesn't occur ALL the time, only intermittently and doesn't seem to have any real trigger.

Regards,
Ash
Reply
#2

There must be something wrong on your OnPlayerEnterDynamicCP(Or what ever you're using).

Can you please show us your CP creation, and the code of when you enter it?
Or is it the same with ALL the checkpoints you made?
Reply
#3

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
There must be something wrong on your OnPlayerEnterDynamicCP(Or what ever you're using).

Can you please show us your CP creation, and the code of when you enter it?
Or is it the same with ALL the checkpoints you made?
Checkpoint Creation is just...
pawn Код:
t_PlayerJob[i][deliveryCheckpoint] = CreateDynamicCP(truck_Deliveries[playerJobID][deliveryX], truck_Deliveries[playerJobID][deliveryY], truck_Deliveries[playerJobID][deliveryZ], 7.5, .playerid = i, .streamdistance = 10000.0);
OnPlayerEnterDynamicCP(playerid, checkpointid) leads to (for this specific job)
pawn Код:
stock truck_OnPlayerEnterCP(playerid, _cpid)
{
    if(t_PlayerJob[playerid][deliveryCheckpoint] == _cpid)
    {
        TogglePlayerControllable(playerid, false);
        SetTimerEx("t_DoFinal", 10000, false, "i", playerid);
    }
}
And inside t_DoFinal(playerid), lies:
pawn Код:
DestroyDynamicCP(truck_PlayerJob[playerid][deliveryCheckpoint]);
The rest works fine, everything in t_DoFinal is called so there's no code-stopping fault... the checkpoint becomes totally invalid...

I also run this:
pawn Код:
/*force destruction of cp's for playerid, as no player-specifics should be shown now*/
    new amountCPs = CountDynamicCPs();
    for(new i; i < amountCPs; i++)
    {
        if(Streamer_GetIntData(STREAMER_TYPE_CP, i, E_STREAMER_PLAYER_ID) == playerid) DestroyDynamicCP(i);
    }
When I reset the jobs just to clear any player-specific checkpoints, but this does nothing to the checkpoints either. Almost as if the checkpoint itself doesn't exist but the streamer is still streaming it for the playerid it was created for.
Reply
#4

DisablePlayerCheckpoint(playerid);
Reply
#5

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
DisablePlayerCheckpoint(playerid);
Please don't post without prior knowledge to the subject or the plugin... the correct usage is
pawn Код:
DestroyDynamicCP(cpid)
for Incognito's Streamer Plugin.
Reply
#6

I know the plugin, you've destroyed the CP but the checkpoint is still enabled DisablePlayerCheckpoint(playerid); will hide any shown checkpoints.
Reply
#7

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
I know the plugin, you've destroyed the CP but the checkpoint is still enabled DisablePlayerCheckpoint(playerid); will hide any shown checkpoints.
The streamer will merely re-stream it... trust me I've tried. I was up all night with this issue, and decided to request assistance before I started deleting things!
Reply
#8

That is strange indeed, it almost sounds like another CP is being created overwriting your reference but this code here
will delete any CP's associated with the player.

pawn Код:
new amountCPs = CountDynamicCPs();
    for(new i; i < amountCPs; i++)
    {
        if(Streamer_GetIntData(STREAMER_TYPE_CP, i, E_STREAMER_PLAYER_ID) == playerid) DestroyDynamicCP(i);
    }
Are you absolutely sure your looping through all of them? If you are losing your reference (t_PlayerJob[playerid][deliveryCheckpoint] == _cpid) does the CP get triggered when you enter it at all and what is the initial CP ID when created and CP ID that is getting triggered?
Reply
#9

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
That is strange indeed, it almost sounds like another CP is being created overwriting your reference but this code here
will delete any CP's associated with the player.

pawn Код:
new amountCPs = CountDynamicCPs();
    for(new i; i < amountCPs; i++)
    {
        if(Streamer_GetIntData(STREAMER_TYPE_CP, i, E_STREAMER_PLAYER_ID) == playerid) DestroyDynamicCP(i);
    }
Are you absolutely sure your looping through all of them?
Assuming CountDynamicCPs returns the last created ID... yes, but thinking about it now that's counter-intuitive. I'll hook CreateDynamicCP and store the lastly created ID and use that as my loops upper bound.
Reply
#10

Ya that won't give you an upper bound on your checkpoint using CountDynamicCP, I don't know if this would be good for you but I created a sub-streamer include to keep track of dynamiccp's and areas https://sampforum.blast.hk/showthread.php?tid=423622 it might give you some ideas.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)