SA-MP Forums Archive
Whats wrong with this racecp? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats wrong with this racecp? (/showthread.php?tid=408120)



Whats wrong with this racecp? - 101 - 16.01.2013

Same thing happens with regular cp

pawn Код:
public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
    if(checkpointid == buscp1[playerid])
    {
        DestroyDynamicRaceCP(buscp1[playerid]);
        buscp2[playerid] = CreateDynamicRaceCP(0, 393.8065,-1770.1382,5.3697, 850.7170,-1329.2406,13.4902, 2, -1, -1, playerid, 1000000);
    }
   
    else if(checkpointid == buscp2[playerid])
    {
        DestroyDynamicRaceCP(buscp2[playerid]);
        buscp3[playerid] = CreateDynamicRaceCP(0, 850.7170,-1329.2406,13.4902, 1206.4131,-1328.0035,13.3984, 2, -1, -1, playerid, 1000000);
    }
    return 1;
}
The second racecp does not get destroyed, it just "respawns" where it was


Re: Whats wrong with this racecp? - .FuneraL. - 16.01.2013

pawn Код:
public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
    if(checkpointid == buscp1[playerid])
    {
        DestroyDynamicRaceCP(buscp1[playerid]);
        buscp2[playerid] = CreateDynamicRaceCP(0, 393.8065,-1770.1382,5.3697, 850.7170,-1329.2406,13.4902, 2, -1, -1, playerid, 1000000);
    }
   
    if(checkpointid == buscp2[playerid])
    {
        DestroyDynamicRaceCP(buscp2[playerid]);
        buscp3[playerid] = CreateDynamicRaceCP(0, 850.7170,-1329.2406,13.4902, 1206.4131,-1328.0035,13.3984, 2, -1, -1, playerid, 1000000);
    }
    return 1;
}
Try with this, i remove the else of the second function