08.10.2011, 21:31
Hi, I got a little problem
For my server I made a driving mission, to do so I used CPS:
ok, so in my code i added something that creates the checkpoint:
ok so the onplayerenterdyncp callback:
ok so this should just create a new CP when enterring the first one
but when I enter the first one I get the message from the Second one,
and wehn I enter the second one I get the message from the Second one again...
any help?
For my server I made a driving mission, to do so I used CPS:
pawn Код:
new Mcheck[2];
pawn Код:
Mcheck[0] = CreateDynamicCP(mStart_x, mStart_y, mStart_z, 2.0, -1, -1, playerid, 400000.0);
pawn Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
new vehicle;
vehicle = GetVehicleModel(GetPlayerVehicleID(playerid));
if(checkpointid == Mcheck[0])
{
new NewVehicleID = GetPlayerVehicleID(playerid);
if(OldVehicleID[playerid] != NewVehicleID) return SendClientMessage(playerid,COLOR_RED,"This vehicle does not contain a passenger!");
// stop previous CP
DestroyDynamicCP(Mcheck[0]);
Mcheck[1] = CreateDynamicCP(mInfo[playerid][Del_x], mInfo[playerid][Del_y], mInfo[playerid][Del_z], 2.0, -1, -1, playerid, 400000.0);
}
if(checkpointid == Mcheck[1])
{
SendClientMessage(playerid,COLOR_RED,"completed the mission");
}
but when I enter the first one I get the message from the Second one,
and wehn I enter the second one I get the message from the Second one again...
any help?