15.06.2011, 17:12
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:
And to check which checkpoint the player entered:
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); } }
Код:
public OnPlayerEnterCheckpoint(playerid) { switch(GetPVarInt(playerid, "lastcheckpoint")) { case 1: dosomestuff(); // First checkpoint from navi case 2: dosomeotherstuff(); // Second checkpoint from navi //... } DisablePlayerCheckpoint(playerid); }