Dynamic CPs problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dynamic CPs problem (
/showthread.php?tid=612242)
Dynamic CPs problem -
EsperZ - 15.07.2016
I found a system that can create a CP in an entry, exit and robbery point of a store. But since I'm having problems with the robbery point, I decided to delete it. Anyways, the CPs works good, but they don't actually teleport you to any position. Here are some things that I have for the system:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
new tickCountResult = GetTickCount(), reducedValue;
if(!IsPlayerInAnyVehicle(playerid))
{
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;
}
}
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;
}
This is the OnPlayerEnterDynamicCP public.
I don't know if the problem is here. If not I'll post anything else.
Any help would be appreciated. Thanks in advance
Re: Dynamic CPs problem -
EsperZ - 17.07.2016
Bump