04.04.2013, 16:25
Hay que ver cуmo os liais. Sуlo ha dicho checkpoint, no бrea.
Yo lo harнa asн:
Yo lo harнa asн:
pawn Код:
new timerequipo[MAX_PLAYERS];
// Incluye la funciуn https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint en el momento del script que quieras crear el checkpoint. Al spawnear, al introducir cierto comando, etc.
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(timerequipo[playerid]);
DisablePlayerCheckpoint(playerid);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,radio del checkpoint,coordenada x del checkpoint, coordenada y del checkpoint, cordenada z del checkpoint))
{
timerequipo[playerid] = SetTimerEx("CambiarEquipo",20000,false,"i",playerid);
}
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,radio del checkpoint,coordenada x del checkpoint, coordenada y del checkpoint, cordenada z del checkpoint))
{
KillTimer(timerequipo[playerid]);
DisablePlayerCheckpoint(playerid);
}
return 1;
}
forward CambiarEquipo(playerid);
public CambiarEquipo(playerid)
{
SetPlayerTeam(playerid, id del equipo);
DisablePlayerCheckpoint(playerid);
// Si quieres usa tu propio script para cambiar el equipo aquн ;)
return 1;
}