22.04.2014, 16:28
Creo que lo que quieres hacer seria algo asн,
Seria algo asн si no equivoco no lo testie, por falta de tiempo lo hice todo a la apurada, fijate.
pawn Код:
#define TimeCheck 5000 // Cantidad de mili-segundos que durara congelado cambiar si se desea.
new ContinuarCongelado[MAX_PLAYERS];
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 431)
{
new check = GetClosestPlayer(playerid);
if(IsPlayerConnected(check))
{
if(ContinuarCongelado[playerid] == 1)
{
new Money = 50000;
if(transportJob[playerid] == 1)
{
transportJob[playerid] = 2;
GameTextForPlayer(playerid, "~g~Download...", 2000, 5);
SetPlayerCheckpoint(playerid,924.1577,-1352.3125,13.0807,5);
TogglePlayerControllable(playerid, 0);
TogglePlayerControllable(check, 0);
ContinuarCongelado[playerid] = 1;
SendClientMessage(playerid,COLOR_DARKGOLD,"* Go to these points and distribute!");
SetTimerEx("Download", 5000, 0, "i", playerid);Este no hace ninguna funcion
SetTimerEx("TiempoCongelado", TimeCheck, 0, "d", check);
SetTimerEx("CortarTiempoCongelado", TimeCheck, 0, "d", playerid);
}
forward TiempoCongelado(playerid);
public TiempoCongelado(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
forward CortarTiempoCongelado(playeri);
public CortarTiempoCongelado(playerid)
{
TogglePlayerControllable(playerid, 1);
ContinuarCongelado[playerid] = 0;
return 1;
}
forward GetClosestPlayer(p1);
publi GetClosestPlayer(p1)
{
new x,Float:dis,Float:dis2,player2;
player2 = -1;
dis = 99999.99;
for (x=0;x<MAX_PLAYERS;x++)
{
if(IsPlayerConnected(x))
{
if(x != p1)
{
dis2 = GetDistanceBetweenPlayers(x,p1);
if(dis2 < dis && dis2 != -1.00)
{
dis = dis2;
player2 = x;
}
}
}
}
return player2;
}
forward Float:GetDistanceBetweenPlayers(p1,p2);
public Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}