public LoadCells()
{
printf("Checkpoints Loaded, Loading Cells...");
for(new c = 0; c < MAX_CELLS; c++)
{
new CellFile[20];
format(CellFile, 20, "Cells/Cell %d.ini", c);
if(!fexist(CellFile)) return 0;
if(INI_Open(CellFile))
{
new str[128];
CellStat[c][CellPrice] = INI_ReadInt("Price");
INI_ReadString(CellStat[c][CellOwner],"Owner", 60);
CellStat[c][Owned] = INI_ReadInt("Owned");
CellStat[c][VW] = INI_ReadInt("VW");
CellStat[c][Locked] = INI_ReadInt("Locked");
CellStat[c][ExteriorX] = INI_ReadFloat("ExteriorX");
CellStat[c][ExteriorY] = INI_ReadFloat("ExteriorY");
CellStat[c][ExteriorZ] = INI_ReadFloat("ExteriorZ");
CellStat[c][InteriorX] = INI_ReadFloat("InteriorX");
CellStat[c][InteriorY] = INI_ReadFloat("InteriorY");
CellStat[c][InteriorZ] = INI_ReadFloat("InteriorZ");
CellStat[c][CellLevel] = INI_ReadInt("Level");
CellStat[c][CellPot] = INI_ReadInt("Pot");
CellStat[c][CellCrack] = INI_ReadInt("Crack");
CellStat[c][CellWeap1] = INI_ReadInt("Weap1");
CellStat[c][CellWeap2] = INI_ReadInt("Weap2");
if(CellStat[c][Owned] == 1)
{
format(str, sizeof(str), "Cell ID %d\nOwner: %s", c, CellStat[c][CellOwner]);
CellStat[c][TextLabel] = Create3DTextLabel(str, RED, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ] + 0.75, 1.0, 0, 0);
CellStat[c][PickupID] = CreateDynamicPickup(1272, 23, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ], 0, -1, -1, 100.0);
}
else
{
format(str, sizeof(str), "Cell ID %d\nOwner: %s\nThis Cell is available for $%d.", c, CellStat[c][CellOwner], CellStat[c][CellPrice]);
CellStat[c][TextLabel] = Create3DTextLabel(str, RED, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ] + 0.75, 1.0, 0, 0);
CellStat[c][PickupID] = CreateDynamicPickup(1273, 23, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ], 0, -1, -1, 100.0);
}
INI_Save();
INI_Close();
Server[LoadedCells]++;
}
}
return 1;
}
Price=100 Owner=Nobody Owned=0 VW=0 Locked=1 ExteriorX=1817.5555 ExteriorY=-1562.5048 ExteriorZ=5700.4287 InteriorX=1815.8555 InteriorY=-1562.5048 InteriorZ=5700.4287 Level=0 Pot=0 Crack=0 Weap1=0 Weap2=0
AddPlayerClass(271,1817.4766,-1557.7900,5700.4287,269.9839,0,0,0,0,0,0); // Cell 1
|
Did you check if Interior XYZ's co-ordinations is actually not on top of the sky?
|
GetPlayerFacingAngle(playerid, pAng);
if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
if(CellStat[c][Locked] == 0)
{
SetPlayerPos(playerid, floatsin(-pAng, degrees) * 0.5, floatcos(pAng, degrees) * 0.5 , (CellStat[c][InteriorZ]*2)+0.025);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
else return GameTextForPlayer(playerid, "~r~ Locked", 3000, 4);
}
else if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
SetPlayerPos(playerid, floatsin(-pAng, degrees) * 0.5, floatcos(pAng, degrees) * 0.5 , (CellStat[c][ExteriorZ]*2)+0.025);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
}
for(new c = 0; c < MAX_CELLS; c++)
{
new
Float:pAng
;
GetPlayerFacingAngle(playerid, pAng);
if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
if(CellStat[c][Locked] == 0)
{
SetPlayerPos(playerid, CellStat[c][InteriorX], CellStat[c][InteriorY], (CellStat[c][InteriorZ]*2)+0.025);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
else return GameTextForPlayer(playerid, "~r~ Locked", 3000, 4);
}
else if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
SetPlayerPos(playerid, floatsin(-pAng, degrees) * 0.5, floatcos(pAng, degrees) * 0.5 , (CellStat[c][ExteriorZ]*2)+0.025);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
}
for(new c = 0; c < MAX_CELLS; c++)
{
new
Float:pAng
;
GetPlayerFacingAngle(playerid, pAng);
if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
if(CellStat[c][Locked] == 0)
{
SetPlayerPos(playerid, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]);
SetPlayerInterior(playerid, 0); //
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
else return GameTextForPlayer(playerid, "~r~ Locked", 3000, 4);
}
else if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
SetPlayerPos(playerid, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
}
|
Wrong :
Код:
for(new c = 0; c < MAX_CELLS; c++)
{
new
Float:pAng
;
GetPlayerFacingAngle(playerid, pAng);
if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
if(CellStat[c][Locked] == 0)
{
SetPlayerPos(playerid, CellStat[c][InteriorX], CellStat[c][InteriorY], (CellStat[c][InteriorZ]*2)+0.025);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
else return GameTextForPlayer(playerid, "~r~ Locked", 3000, 4);
}
else if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
SetPlayerPos(playerid, floatsin(-pAng, degrees) * 0.5, floatcos(pAng, degrees) * 0.5 , (CellStat[c][ExteriorZ]*2)+0.025);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
}
Код:
for(new c = 0; c < MAX_CELLS; c++)
{
new
Float:pAng
;
GetPlayerFacingAngle(playerid, pAng);
if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
if(CellStat[c][Locked] == 0)
{
SetPlayerPos(playerid, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]);
SetPlayerInterior(playerid, 0); //
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
else return GameTextForPlayer(playerid, "~r~ Locked", 3000, 4);
}
else if(IsPlayerInRangeOfPoint(playerid, 1.0, CellStat[c][InteriorX], CellStat[c][InteriorY], CellStat[c][InteriorZ]) && GetPlayerVirtualWorld(playerid) == 0)
{
SetPlayerPos(playerid, CellStat[c][ExteriorX], CellStat[c][ExteriorY], CellStat[c][ExteriorZ]);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("LoadingObjects", 1000, false, "d", playerid);
}
}
|