id chekpoint
#6

Yes, you can create multiple checkpoints, but only one at a time is displayed to the player.
So you somehow need to safe an id in a variable or pvar for the last created checkpoint.
For example:
Код:
switch(listitem) {
        case 0: {
                SetPlayerCheckpoint(playerid, 1218.15, -1811.71, 16.59, 5);
                SetPVarInt(playerid, "lastcheckpoint", 1);
        }
        case 1: {
                SetPlayerCheckpoint(playerid, 1684.48, -1342.41, 17.43, 5);
                SetPVarInt(playerid, "lastcheckpoint", 2);
        }
        case 2: {
                SetPlayerCheckpoint(playerid, 1464.80, -1011.25, 26.84, 5);
                SetPVarInt(playerid, "lastcheckpoint", 3);
        }
        case 3: {
                SetPlayerCheckpoint(playerid, 1149.39, -1749.36, 13.57, 5);
                SetPVarInt(playerid, "lastcheckpoint", 4);
        }
}
And to check which checkpoint the player entered:
Код:
public OnPlayerEnterCheckpoint(playerid) {
        switch(GetPVarInt(playerid, "lastcheckpoint")) {
                case 1: dosomestuff(); // First checkpoint from navi 
                case 2: dosomeotherstuff(); // Second checkpoint from navi 
                //...
        }
        DisablePlayerCheckpoint(playerid);
}
Reply


Messages In This Thread
id chekpoint - by karimos - 15.06.2011, 16:11
AW: id chekpoint - by Blowfish - 15.06.2011, 16:27
Re : id chekpoint - by karimos - 15.06.2011, 16:32
AW: id chekpoint - by Blowfish - 15.06.2011, 16:40
Re : id chekpoint - by karimos - 15.06.2011, 16:46
AW: id chekpoint - by Blowfish - 15.06.2011, 17:12
Re : id chekpoint - by karimos - 15.06.2011, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)