25.02.2010, 10:29
Here its a code i did now.Its not tested:
pawn Code:
forward ChooseSpot();
new GoldPotSpot[MAX_PLAYERS];
GoldPotSpot[playerid]; // Add this to OnPlayerConnect
SetTimer("ChooseSpot", 60000, 1); // Its a repeated timer every min.Change it if u want.Add it to OnGameModeInit(); function
public ChooseSpot()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
switch (GoldPotSpot[i])
{
case 1: SetPlayerCheckpoint(i, x, y, z, 4.0);
case 2: SetPlayerCheckpoint(i, x, y, z, 4.0); // Somewhere else
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GoldPotSpot[playerid] == 1)
{
GoldPotSpot[playerid] = 0;
// Do something here
}
else if(GoldPotSpot[playerid] == 2)
{
GoldPotSpot[playerid] = 0;
// Do something here too
}
}