//objects
new lspdgate1;
new lspdgate2;
//checkpoints
new lspdcheckpoint;
new lspdgateopen=0;
//timers
new lspdgatetimer;
//Objects
//[LSPD]
lspdgate1=CreateObject(975, 1544.64209, -1622.27417, 13.99633, 0.00000, 0.00000, 90.77937);
lspdgate2=CreateObject(975, 1544.68726, -1626.48511, 14.01554, 0.00000, 0.00000, 90.39678);
CreateObject(970, 1547.58594, -1635.00659, 13.07822, 0.00000, 0.00000, 91.75994);
CreateObject(970, 1545.51624, -1632.69934, 12.95227, 0.00000, 0.00000, 0.00000);
CreateObject(975, 1544.58704, -1619.37219, 14.01108, 0.00000, 0.00000, 270.64969);
//Checkpoints
//[LSPD]
CreateCheckpoint(GLOBAL_OWNER_ID, lspdcheckpoint, 1544.3419,-1627.1494,13.3828);
UsePlayerPedAnims();
StartCheckpointSeeking();
public OnCheckpointEnter(playerid, checkpointid)
{
if(checkpointid==lspdcheckpoint)
{
if(lspdgateopen==0)
{
MoveObject(lspdgate1, 1544.64209, -1622.27417, 10.72136, 1.0);
MoveObject(lspdgate2, 1544.68726, -1626.48511, 10.72136, 1.0);
lspdgatetimer=SetTimer("lspdgate", 5000, true);
lspdgateopen=1;
}
}
return 1;
}
forward lspdgate();
public lspdgate()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInCheckpoint(i)==lspdcheckpoint)
{
return 1;
}
}
}
KillTimer(lspdgatetimer);
if(lspdgateopen==1)
{
MoveObject(lspdgate1, 1544.64209, -1622.27417, 13.99633, 1.0);
MoveObject(lspdgate2, 1544.68726, -1626.48511, 14.01554, 1.0);
lspdgateopen=0;
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
VerifyCheckpoint(playerid);
return 1;
}
forward lspdgate();
public lspdgate()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInCheckpoint(i)==lspdcheckpoint)
{
return 1;
}
}
}
KillTimer(lspdgatetimer);
if(lspdgateopen==1)
{
MoveObject(lspdgate1, 1544.64209, -1622.27417, 13.99633, 1.0);
MoveObject(lspdgate2, 1544.68726, -1626.48511, 14.01554, 1.0);
lspdgateopen=0;
}
return 1;
}
forward lspdgate();
public lspdgate()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInDynamicCP(playerid, lspdcheckpoint))
{
return 1;
}
}
}
if(lspdgateopen == 1)
{
MoveObject(lspdgate1, 1544.64209, -1622.27417, 13.99633, 1.0);
MoveObject(lspdgate2, 1544.68726, -1626.48511, 14.01554, 1.0);
lspdgateopen=0;
}
KillTimer(lspdgatetimer);
return 1;
}
That function is not included in this streamer.
Can you tell me any other good checkpoint streamer? |
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamicCP(checkpointid);
native IsValidDynamicCP(checkpointid);
native TogglePlayerDynamicCP(playerid, checkpointid, toggle);
native TogglePlayerAllDynamicCPs(playerid, toggle);
native IsPlayerInDynamicCP(playerid, checkpointid);
native GetPlayerVisibleDynamicCP(playerid);