This would be very simple if you gave it thought.
1. You set the checkpoint of the player.
2. When the player gets to the checkpoint it sets another one back at their base and sets a variable.
3. The player gets back to the base and wins
pawn Код:
new GotTarger[MAX_PLAYERS];
public OnPlayerEnterCheckpoint(playerid)
{
if(GotTarget[playerid] == 1)
{
new pName[24], string[126];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s has delivered the target to the home base!", pName);
SendClientMessageToAll(COLOUR, string);
//SendRconCommand("gmx"); Include this if you want to reset the gm.
}
else
{
SetPlayerCheckpoint(/*...*/); // The base checkpoint
GotTarget[playerid] = 1;
}
return 1;
}
pawn Код:
new Pickup1;
public OnPlayerDeath(playerid, killerid, reason)
{
if(GotTarget[playerid] == 1)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
Pickup1 = CreatePickup(/*Find a model ID*/, 3, X, Y, Z, -1)
GotTarget[playerid] = 0;
}
return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == Pickup1)
{
GotTarger[playerid] = 1;
new pName[24], string[126];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s has picked up the target!", pName);
SendClientMessageToAll(COLOUR, string);
SetPlayerCheckpoint(/*base checkpoint*/);
}
return 1;
}