SA-MP Forums Archive
[HELP] Checkpoints - 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: [HELP] Checkpoints (/showthread.php?tid=422694)



[HELP] Checkpoints - NuggaN - 14.03.2013

I've a problem! When I start the tutorial by going into a Icon, there shows up a Dialog and by hitting "ok" u start the tutorial.

Now my prob is: it shows up the first checkpoint i.e bsn, when I am at the checkpoint, it doesnt show the next one and I get the message of all checkpoints... how I fix that??

http://www.abload.de/img/1123w8k48.png

here the code

PHP код:
        if(response==1)
        {
            
TutCP[playerid]=1;
            
SetPlayerCheckpoint(playerid,1191.9098,-920.0125,42.8168,3.0);
            
SendClientMessage(playerid,green,"You've started the Tutorial. Please follow the Checkpoints!");
        } 
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
TutCP[playerid]==1)
    {
        
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid] = 2;
        
SetPlayerCheckpoint(playerid1543.8728,-1669.8749,13.23003.0);
        
SendClientMessage(playerid,green,"This is the BurgerShot North! Here you can fill up your HP by eating");
        
SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
    }
    if(
TutCP[playerid]==2)
    {
        
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid] = 3;
        
SetPlayerCheckpoint(playerid1483.7485,-1764.6368,18.79583.0);
        
SendClientMessage(playerid,green,"Here is the Los Santos Police Department! If you get problems, they'll help you. Please respect them.");
        
SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
    }
    if(
TutCP[playerid]==3)
    {
         
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid] = 4;
        
SetPlayerCheckpoint(playerid1348.5499,-1752.1724,13.36113.0);
        
SendClientMessage(playerid,green,"Here is the Los Santos Office. Here you find Jobs and create your identity card");
        
SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
    }
    if(
TutCP[playerid]==4)
    {
        
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid] = 5;
        
SetPlayerCheckpoint(playerid1363.9559,-1285.0071,13.54693.0);
        
SendClientMessage(playerid,green,"This is the 24/7 shop. Here you can buy a mobile phone, some snacks and more..!");
        
SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
    }
    if(
TutCP[playerid]==5)
    {
        
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid] = 6;
        
SetPlayerCheckpoint(playerid777.0124,-1388.1178,13.63353.0);
        
SendClientMessage(playerid,green,"Here is the LS Ammunation! You can buy guns here. But first, you'll need a gun license.");
        
SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
    }
    if(
TutCP[playerid]==6)
    {
        
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid] = 7;
        
SetPlayerCheckpoint(playerid488.8225,-1520.5413,19.88183.0);
        
SendClientMessage(playerid,green,"Here is the Car-Shop. You can buy cars here, but first you'll need a drivers license");
        
SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
    }
    if(
TutCP[playerid]==7)
    {
        
DisablePlayerCheckpoint(playerid);
        
TutCP[playerid]=0;
        
SendClientMessage(playerid,green,"This is the driving school in Los Santos. You've also done the Tutorial by now.");
    }
    return 
1;




Re: [HELP] Checkpoints - NuggaN - 14.03.2013

anybody can help?


Re: [HELP] Checkpoints - Tika Spic - 14.03.2013

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(TutCP[playerid]==1)
    {
        DisablePlayerCheckpoint(playerid);
        TutCP[playerid] = 2;
        SetPlayerCheckpoint(playerid, 1543.8728,-1669.8749,13.2300, 3.0);
        SendClientMessage(playerid,green,"This is the BurgerShot North! Here you can fill up your HP by eating");
        SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
        return 1;
    }
    if(TutCP[playerid]==2)
    {
        DisablePlayerCheckpoint(playerid);
        TutCP[playerid] = 3;
        SetPlayerCheckpoint(playerid, 1483.7485,-1764.6368,18.7958, 3.0);
        SendClientMessage(playerid,green,"Here is the Los Santos Police Department! If you get problems, they'll help you. Please respect them.");
        SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
        return 1;
    }
    if(TutCP[playerid]==3)
    {
         DisablePlayerCheckpoint(playerid);
        TutCP[playerid] = 4;
        SetPlayerCheckpoint(playerid, 1348.5499,-1752.1724,13.3611, 3.0);
        SendClientMessage(playerid,green,"Here is the Los Santos Office. Here you find Jobs and create your identity card");
        SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
        return 1;
    }
    if(TutCP[playerid]==4)
    {
        DisablePlayerCheckpoint(playerid);
        TutCP[playerid] = 5;
        SetPlayerCheckpoint(playerid, 1363.9559,-1285.0071,13.5469, 3.0);
        SendClientMessage(playerid,green,"This is the 24/7 shop. Here you can buy a mobile phone, some snacks and more..!");
        SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
        return 1;
    }
    if(TutCP[playerid]==5)
    {
        DisablePlayerCheckpoint(playerid);
        TutCP[playerid] = 6;
        SetPlayerCheckpoint(playerid, 777.0124,-1388.1178,13.6335, 3.0);
        SendClientMessage(playerid,green,"Here is the LS Ammunation! You can buy guns here. But first, you'll need a gun license.");
        SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
        return 1;
    }
    if(TutCP[playerid]==6)
    {
        DisablePlayerCheckpoint(playerid);
        TutCP[playerid] = 7;
        SetPlayerCheckpoint(playerid, 488.8225,-1520.5413,19.8818, 3.0);
        SendClientMessage(playerid,green,"Here is the Car-Shop. You can buy cars here, but first you'll need a drivers license");
        SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
        return 1;
    }
    if(TutCP[playerid]==7)
    {
        DisablePlayerCheckpoint(playerid);
        TutCP[playerid]=0;
        SendClientMessage(playerid,green,"This is the driving school in Los Santos. You've also done the Tutorial by now.");
        return 1;
    }
    return 1;
}
try like this... u didnt have return 1; after each cp which meant it was going from 1 to the next untill it finished everything.. this should work fine i think


Re: [HELP] Checkpoints - NuggaN - 14.03.2013

Gonna try this, thanks for answer. Tell you then if it works :P


Re: [HELP] Checkpoints - NuggaN - 14.03.2013

Working! Much thanks x3


Re: [HELP] Checkpoints - Jefff - 14.03.2013

Clearly version but Tika is good too

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(1 <= TutCP[playerid] <= 7)
    {
        TutCP[playerid]++;
        DisablePlayerCheckpoint(playerid);
        switch(TutCP[playerid]-1)
        {
            case 1:
            {
                SetPlayerCheckpoint(playerid, 1543.8728,-1669.8749,13.2300, 3.0);
                SendClientMessage(playerid,green,"This is the BurgerShot North! Here you can fill up your HP by eating");
                SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
            }
            case 2:
            {
                SetPlayerCheckpoint(playerid, 1483.7485,-1764.6368,18.7958, 3.0);
                SendClientMessage(playerid,green,"Here is the Los Santos Police Department! If you get problems, they'll help you. Please respect them.");
                SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
            }
            case 3:
            {
                SetPlayerCheckpoint(playerid, 1348.5499,-1752.1724,13.3611, 3.0);
                SendClientMessage(playerid,green,"Here is the Los Santos Office. Here you find Jobs and create your identity card");
                SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
            }
            case 4:
            {
                SetPlayerCheckpoint(playerid, 1363.9559,-1285.0071,13.5469, 3.0);
                SendClientMessage(playerid,green,"This is the 24/7 shop. Here you can buy a mobile phone, some snacks and more..!");
                SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
            }
            case 5:
            {
                SetPlayerCheckpoint(playerid, 777.0124,-1388.1178,13.6335, 3.0);
                SendClientMessage(playerid,green,"Here is the LS Ammunation! You can buy guns here. But first, you'll need a gun license.");
                SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
            }
            case 6:
            {
                SetPlayerCheckpoint(playerid, 488.8225,-1520.5413,19.8818, 3.0);
                SendClientMessage(playerid,green,"Here is the Car-Shop. You can buy cars here, but first you'll need a drivers license");
                SendClientMessage(playerid,orange,"Go on, that's not all. Find now the next Checkpoint!");
            }
            default:
            {
                TutCP[playerid] = 0;
                SendClientMessage(playerid,green,"This is the driving school in Los Santos. You've also done the Tutorial by now.");
            }
        }
        return 1;
    }
    return 0;
}



Re: [HELP] Checkpoints - NuggaN - 15.03.2013

Another question: you guys know if its possible to create own Interiors? And how?


Re: [HELP] Checkpoints - Tika Spic - 15.03.2013

Yup you just need a good mapper... go into "space" far away from land and map something, then get the coords for the inside and there you have it... You can even playce the objects in a different interior (not 0 but say 10..) in MTA ...