25.02.2010, 10:46
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);S
SendMessageToAll(); // Add a Message here ...
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
}
}