19.07.2016, 12:13
(
Последний раз редактировалось Quinncell; 19.07.2016 в 13:57.
)
I've been making the DynamicCPs one by one and they worked.Players could enter them and get teleported to the interiors but when I finished all of them, everything compiled good but only "some" players can enter them, I myself can't.I have been trying to fix this bug for days and nothing, I have no clue whats the problem.
Here is the OnPlayerEnterDynamicCP, I am not sure the bug is here or not but I will post anything you guys think the problem is in.
and here is the dynamicCP
here is the enum is needed
Here is the OnPlayerEnterDynamicCP, I am not sure the bug is here or not but I will post anything you guys think the problem is in.
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
new tickCountResult = GetTickCount(), reducedValue;
for(new i; i < MAX_CHECKPOINT; i++)
{
if(checkpointid == CPIndex[i][0])
{
reducedValue = tickCountResult - pInfo[playerid][CPTime];
if (reducedValue > 10000)
{
pInfo[playerid][CPTime] = GetTickCount();
SetPlayerPos(playerid, CPData[i][ExitLoc][0], CPData[i][ExitLoc][1], CPData[i][ExitLoc][2]);
SetPlayerInterior(playerid, CPData[i][Interior]);
SetPlayerVirtualWorld(playerid, CPData[i][World]);
Loading(playerid);
pInfo[playerid][LastEntered] = i;
}
return 1;
}
if(checkpointid == CPIndex[i][1])
{
reducedValue = tickCountResult - pInfo[playerid][CPTime];
if (reducedValue > 10000)
{
new sID = pInfo[playerid][LastEntered];
pInfo[playerid][CPTime] = GetTickCount();
SetPlayerPos(playerid, CPData[sID][EnterLoc][0], CPData[sID][EnterLoc][1], CPData[sID][EnterLoc][2]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
Loading(playerid);
}
return 1;
}
}
if(checkpointid == JobCP[0])
{
reducedValue = tickCountResult - pInfo[playerid][CPTime];
if (reducedValue > 10000)
{
pInfo[playerid][CPTime] = GetTickCount();
SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 27);
}
return 1;
}
if(checkpointid == JobCP[1])
{
reducedValue = tickCountResult - pInfo[playerid][CPTime];
if (reducedValue > 10000)
{
pInfo[playerid][CPTime] = GetTickCount();
SetPlayerPos(playerid, -1880.8790, 822.7505, 35.1774);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
return 1;
}
return 1;
}
PHP код:
public DynamicCPs()
{
new i = 0;
while(i < MAX_CHECKPOINT)
{
CPIndex[i][0] = CreateDynamicCP(CPData[i][EnterLoc][0], CPData[i][EnterLoc][1], CPData[i][EnterLoc][2], 1.5, -1, -1, -1, 100.0);
CPIndex[i][1] = CreateDynamicCP(CPData[i][ExitLoc][0], CPData[i][ExitLoc][1], CPData[i][ExitLoc][2], 1.5, CPData[i][World], CPData[i][Interior], -1, 100.0);
CPLabel[i][0][0] = Create3DTextLabel("WELCOME TO", 0x00FF00FF, CPData[i][EnterLoc][0], CPData[i][EnterLoc][1], CPData[i][EnterLoc][2] + 0.2, 25.0, 0, 1);
CPLabel[i][0][1] = Create3DTextLabel(CPData[i][SName], 0x0000FFFF, CPData[i][EnterLoc][0], CPData[i][EnterLoc][1], CPData[i][EnterLoc][2] + 0.05, 25.0, 0, 1);
CPLabel[i][1][0] = Create3DTextLabel("YOU WERE AT", 0x00FF00FF, CPData[i][ExitLoc][0], CPData[i][ExitLoc][1], CPData[i][ExitLoc][2] + 0.2, 7.5, CPData[i][World], 1);
CPLabel[i][1][1] = Create3DTextLabel(CPData[i][SName], 0x0000FFFF, CPData[i][ExitLoc][0], CPData[i][ExitLoc][1], CPData[i][ExitLoc][2] + 0.05, 7.5, CPData[i][World], 1);
i++;
}
}
PHP код:
enum CPsEnum
{
SID,
Float:EnterLoc[3],
Float:ExitLoc[3],
World,
Interior,
SName[25]
}