SA-MP Forums Archive
Nothing happened when I enter in a Dynamic Checkpoint - 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: Nothing happened when I enter in a Dynamic Checkpoint (/showthread.php?tid=655022)



Nothing happened when I enter in a Dynamic Checkpoint - GoDylan - 11.06.2018

Hi everybody !

I have a problem, I would make a stunt system with checkpoints but when I enter in the first checkpoint nothing happened here is my code :

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CPStunt[0] && gTeam[playerid] == TEAM_STUNTER)
{
CPStunt[1] = CreateDynamicCP(1958.5, 1964, 23.200000762939, 2, -1, -1, -1, 100.0);
TogglePlayerDynamicCP(playerid, CPStunt[0], 1);
}
if(checkpointid == CPStunt[1] && gTeam[playerid] == TEAM_STUNTER)
{
GivePlayerMoney(playerid, 5000);
TogglePlayerDynamicCP(playerid, CPStunt[0], 1);
DestroyDynamicCP(CPStunt[1]);
}
return 1;
}

Thanks in advance to help me !


Re: Nothing happened when I enter in a Dynamic Checkpoint - Sew_Sumi - 11.06.2018

Need more code than this... Show where you set gTeam, and where you create the checkpoint.

You also need to give more information as to what is happening, and what you have tried.


Also use tags, and fix your indentation.

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == CPStunt[0] && gTeam[playerid] == TEAM_STUNTER)
    {
        
CPStunt[1] = CreateDynamicCP(1958.5196423.2000007629392, -1, -1, -1100.0);
        
TogglePlayerDynamicCP(playeridCPStunt[0], 1);
    }
    if(
checkpointid == CPStunt[1] && gTeam[playerid] == TEAM_STUNTER)
    {
        
GivePlayerMoney(playerid5000);
        
TogglePlayerDynamicCP(playeridCPStunt[0], 1);
        
DestroyDynamicCP(CPStunt[1]);
    }
    return 
1;

Now that looks a lot better.