Get the streamer plugin (
https://sampforum.blast.hk/showthread.php?tid=102865 ) to create multiple checkpoints, then follow tutorials
Here's a small example xd
pawn Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[CAPZONE])
{
if(UnderAttack[CAPZONE] == 0)
{
if(tCP[CAPZONE] != gTeam[playerid])
{
CountVar[playerid][CAPZONE] = 25;
ActiveCAPZONE(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
if(checkpointid == CP[MTCHILLIAD])
{
if(UnderAttack[MTCHILLIAD] == 0)
{
if(tCP[MTCHILLIAD] != gTeam[playerid])
{
CountVar[playerid][MTCHILLIAD] = 25;
ActiveMTCHILLIAD(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
if(checkpointid == CP[LVAIRPORT])
{
if(UnderAttack[LVAIRPORT] == 0)
{
if(tCP[LVAIRPORT] != gTeam[playerid])
{
CountVar[playerid][LVAIRPORT] = 25;
ActiveLVAIRPORT(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
if(checkpointid == CP[DAAIRPORT])
{
if(UnderAttack[DAAIRPORT] == 0)
{
if(tCP[DAAIRPORT] != gTeam[playerid])
{
CountVar[playerid][DAAIRPORT] = 25;
ActiveDAAIRPORT(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
if(checkpointid == CP[ELQUEBRADOS])
{
if(UnderAttack[ELQUEBRADOS] == 0)
{
if(tCP[ELQUEBRADOS] != gTeam[playerid])
{
CountVar[playerid][ELQUEBRADOS] = 25;
ActiveELQUEBRADOS(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
if(checkpointid == CP[BLACKFIELDCHAPEL])
{
if(UnderAttack[BLACKFIELDCHAPEL] == 0)
{
if(tCP[BLACKFIELDCHAPEL] != gTeam[playerid])
{
CountVar[playerid][BLACKFIELDCHAPEL] = 25;
ActiveBLACKFIELDCHAPEL(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
if(checkpointid == CP[ISLAND])
{
if(UnderAttack[ISLAND] == 0)
{
if(tCP[ISLAND] != gTeam[playerid])
{
CountVar[playerid][ISLAND] = 25;
ActiveISLAND(playerid);
Capturing{ playerid } = true;
} else return SendClientMessage(playerid, COLOR_RED,"[NOTE] - This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
return 1;
}
forward OnPlayerLeaveDynamicCP(playerid, checkpointid);
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[CAPZONE] && Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1 && !IsPlayerInDynamicCP(playerid, CP[CAPZONE]))
{
LeavingCAPZONE(playerid);
KillTimer(timer[playerid][CAPZONE]);
Capturing{ playerid } = false;
}
if(checkpointid == CP[MTCHILLIAD] && Captured[playerid][MTCHILLIAD] == 0 && IsPlayerCapturing[playerid][MTCHILLIAD] == 1 && !IsPlayerInDynamicCP(playerid, CP[MTCHILLIAD]))
{
LeavingMTCHILLIAD(playerid);
KillTimer(timer[playerid][MTCHILLIAD]);
Capturing{ playerid } = false;
}
if(checkpointid == CP[LVAIRPORT] && Captured[playerid][LVAIRPORT] == 0 && IsPlayerCapturing[playerid][LVAIRPORT] == 1 && !IsPlayerInDynamicCP(playerid, CP[LVAIRPORT]))
{
LeavingLVAIRPORT(playerid);
KillTimer(timer[playerid][LVAIRPORT]);
Capturing{ playerid } = false;
}
if(checkpointid == CP[DAAIRPORT] && Captured[playerid][DAAIRPORT] == 0 && IsPlayerCapturing[playerid][DAAIRPORT] == 1 && !IsPlayerInDynamicCP(playerid, CP[DAAIRPORT]))
{
LeavingDAAIRPORT(playerid);
KillTimer(timer[playerid][DAAIRPORT]);
Capturing{ playerid } = false;
}
if(checkpointid == CP[ELQUEBRADOS] && Captured[playerid][ELQUEBRADOS] == 0 && IsPlayerCapturing[playerid][ELQUEBRADOS] == 1 && !IsPlayerInDynamicCP(playerid, CP[ELQUEBRADOS]))
{
LeavingELQUEBRADOS(playerid);
KillTimer(timer[playerid][ELQUEBRADOS]);
Capturing{ playerid } = false;
}
if(checkpointid == CP[BLACKFIELDCHAPEL] && Captured[playerid][BLACKFIELDCHAPEL] == 0 && IsPlayerCapturing[playerid][BLACKFIELDCHAPEL] == 1 && !IsPlayerInDynamicCP(playerid, CP[BLACKFIELDCHAPEL]))
{
LeavingBLACKFIELDCHAPEL(playerid);
KillTimer(timer[playerid][BLACKFIELDCHAPEL]);
Capturing{ playerid } = false;
}
if(checkpointid == CP[ISLAND] && Captured[playerid][ISLAND] == 0 && IsPlayerCapturing[playerid][ISLAND] == 1 && !IsPlayerInDynamicCP(playerid, CP[ISLAND]))
{
LeavingISLAND(playerid);
KillTimer(timer[playerid][ISLAND]);
Capturing{ playerid } = false;
}
}
etc..
If you still didn't understand it, check some tutorials ( Checkpoint tutorials itself, or a capture zone tutorial.. )