Tach,
ich benutze das LoH Script. Und zwar ists so dass für die Hauseingänge (Interior-Eingänge) Checkpoints verwendet werden (die Roten runden Kreise)..
enum CPInfo
{
Float:EnterX,
Float:EnterY,
Float:EnterZ,
Float:EnterA,
EnterInt,
ExitingText[32],
Float:ExitX,
Float:ExitY,
Float:ExitZ,
Float:ExitA,
ExitInt,
EnteringText[100],
EnteringPrice,
}
new Float:CPs[][CPInfo] = {
{2397.8496,-1898.0288,13.5469,0.0,0,"Los Santos",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
{2244.4800,-1664.0601,15.4766,0.0,0,"Los Santos",207.6447,-110.5639,1005.1328,0.0,15,"Binco",0},
// etc...
{2166.2642,-1671.6808,15.0740,0.0,0,"Los Santos",318.6689,1114.9237,1083.8828,0.0,5,"Crackhoehle",0}
};
public OnPlayerEnterCheckpoint(playerid)
{
if(CheckPointing[playerid] == 0)
{
return 1;
}
new cpid;
if(GetDistanceToClosestInside(playerid) < 1.0) // Man geht wo raus
{
if(MultipleEnter[playerid] != -1)
{
cpid = MultipleEnter[playerid];
}
else
{
cpid = GetClosestInsideID(playerid);
}
SetPlayerPos(playerid,CPs[cpid][EnterX],CPs[cpid][EnterY],CPs[cpid][EnterZ]);
if(CPs[cpid][EnterA] != 0.0) SetPlayerFacingAngle(playerid,CPs[cpid][EnterA]);
SetPlayerInterior(playerid,CPs[cpid][EnterInt]);
GameTextForPlayer(playerid,CPs[cpid][ExitingText],5000,3);
PlayerInfo[playerid][pInt] = CPs[cpid][EnterInt];
MultipleEnter[playerid] = -1;
CheckPointing[playerid] = 0;
SetTimerEx("EnableCheckpointingAgain",5000,0,"i",playerid);
}
else if(GetDistanceToClosestOutside(playerid) < 1.0) // Man geht wo rein
{
cpid = GetClosestOutsideID(playerid);
SetPlayerPos(playerid,CPs[cpid][ExitX],CPs[cpid][ExitY],CPs[cpid][ExitZ]);
if(CPs[cpid][ExitA] != 0.0) SetPlayerFacingAngle(playerid,CPs[cpid][ExitA]);
SetPlayerInterior(playerid,CPs[cpid][ExitInt]);
PlayerInfo[playerid][pInt] = CPs[cpid][ExitInt];
GameTextForPlayer(playerid,CPs[cpid][EnteringText],5000,3);
GivePlayerMoney(playerid,-CPs[cpid][EnteringPrice]);
if( !strcmp(CPs[cpid][EnteringText],CLUCKIN_BELL_TEXT) ||
!strcmp(CPs[cpid][EnteringText],PIZZA_TEXT) ||
!strcmp(CPs[cpid][EnteringText],BURGER_SHOT_TEXT) ||
!strcmp(CPs[cpid][EnteringText],"24/7"))
{
MultipleEnter[playerid] = cpid;
}
CheckPointing[playerid] = 0;
SetTimerEx("EnableCheckpointingAgain",5000,0,"i",playerid);
}
}
public EnableCheckpointingAgain(playerid)
{
CheckPointing[playerid] = 1;
}
public StreamCheckpoints()
{
for(new i; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(CheckPointShown[i] == 1)
{
DisablePlayerCheckpoint(i);
CheckPointShown[i] = 0;
}
if(DisplayForPlayer(i))
{
if(GetDistanceToClosestInside(i) < GetDistanceToClosestOutside(i) && GetDistanceToClosestInside(i) < 15.0)
{
new cpid = GetClosestInsideID(i);
SetPlayerCheckpoint(i,CPs[cpid][ExitX],CPs[cpid][ExitY],CPs[cpid][ExitZ],1.5);
CheckPointShown[i] = 1;
}
if(GetDistanceToClosestOutside(i) < GetDistanceToClosestInside(i) && GetDistanceToClosestOutside(i) < 15.0)
{
new cpid = GetClosestOutsideID(i);
SetPlayerCheckpoint(i,CPs[cpid][EnterX],CPs[cpid][EnterY],CPs[cpid][EnterZ],1.5);
CheckPointShown[i] = 1;
}
}
}
}
return 1;
}
public Float:GetDistanceToClosestInside(playerid)
{
new Float:SmallestDistance = 99999.9, Float:OldDistance;
for(new cpid; cpid<sizeof(CPs); cpid++)
{
OldDistance = GetDistanceToInsideCheckpoint(playerid,cpid);
if(OldDistance < SmallestDistance)
{
SmallestDistance = OldDistance;
}
}
return SmallestDistance;
}
public Float:GetDistanceToClosestOutside(playerid)
{
new Float:SmallestDistance = 99999.9, Float:OldDistance;
for(new cpid; cpid<sizeof(CPs); cpid++)
{
OldDistance = GetDistanceToOutsideCheckpoint(playerid,cpid);
if(OldDistance < SmallestDistance)
{
SmallestDistance = OldDistance;
}
}
return SmallestDistance;
}
stock GetClosestInsideID(playerid)
{
new Float:SmallestDistance = 99999.9, Float:OldDistance, returnid;
for(new cpid; cpid<sizeof(CPs); cpid++)
{
OldDistance = GetDistanceToInsideCheckpoint(playerid,cpid);
if(OldDistance < SmallestDistance)
{
SmallestDistance = OldDistance;
returnid = cpid;
}
}
return returnid;
}
stock GetClosestOutsideID(playerid)
{
new Float:SmallestDistance = 99999.9, Float:OldDistance, returnid;
for(new cpid; cpid<sizeof(CPs); cpid++)
{
OldDistance = GetDistanceToOutsideCheckpoint(playerid,cpid);
if(OldDistance < SmallestDistance)
{
SmallestDistance = OldDistance;
returnid = cpid;
}
}
return returnid;
}
public Float:GetDistanceToInsideCheckpoint(playerid,checkpointid)
{
new Float:cpx1,Float:cpy1,Float:cpz1,Float:cpx2,Float:cpy2,Float:cpz2;
GetPlayerPos(playerid,cpx1,cpy1,cpz1);
cpx2 = CPs[checkpointid][ExitX];
cpy2 = CPs[checkpointid][ExitY];
cpz2 = CPs[checkpointid][ExitZ];
return floatsqroot(floatpower(floatabs(floatsub(cpx2,cpx1)),2)+floatpower(floatabs(floatsub(cpy2,cpy1)),2)+floatpower(floatabs(floatsub(cpz2,cpz1)),2));
}
public Float:GetDistanceToOutsideCheckpoint(playerid,checkpointid)
{
new Float:cpx1,Float:cpy1,Float:cpz1,Float:cpx2,Float:cpy2,Float:cpz2;
GetPlayerPos(playerid,cpx1,cpy1,cpz1);
cpx2 = CPs[checkpointid][EnterX];
cpy2 = CPs[checkpointid][EnterY];
cpz2 = CPs[checkpointid][EnterZ];
return floatsqroot(floatpower(floatabs(floatsub(cpx2,cpx1)),2)+floatpower(floatabs(floatsub(cpy2,cpy1)),2)+floatpower(floatabs(floatsub(cpz2,cpz1)),2));
}
Das Problem ist dass man die Dinger nur sieht wenn man zu Fuss ist und in der Nähe ist, steigt man aber in ein Fahrzeug, verschwinden sie sofort.. Wie krieg ich die auch in nem Fahrzeug sichtbar?
Mfg und Danke schonmal^^