Checkpoint problem -
kaiks - 28.06.2012
Okay i have a problem with Checkpoints, the first CP is good, but the second isn't,
it doesn't stop loading the cargo off. Also i have 4 checkpoints more to go, but i haven't finished them,
because the second one doesn't work well.
Heres the /work code, it works fine, but i'm just adding it here for you to see my first CP.
pawn Code:
if(strcmp(cmdtext, "/tццle", true) == 0)
{
if(gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_GREY, "Sa ei ole kaubavedaja!");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 440) return SendClientMessage(playerid, COLOR_GREY, "Sa ei ole kaubavedaja autos!");
if(gTeam[playerid] == 2)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
SendClientMessage(playerid, COLOR_GREY, "Alustasid tццd, mine vхta kaup peale.");
SetPlayerCheckpoint(playerid,120.403518, -294.375122, 1.578125, 3.0);
}
return 1;
}
return 1;
}
Ok, here's the bad boy.
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
if(gTeam[playerid] == 2) // The carbo is being loaded on the bus or smth like that
GameTextForPlayer(playerid, "Kaupa laetakse peale...", 6950, 3);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnfreezePlayer", 7000, false, "d", playerid);
SetPlayerCheckpoint(playerid,203.737503, -181.615310, 1.578125,3);
return 1;
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
if(gTeam[playerid] == 2) // The cargo is being loaded off the bus or smth like that
GameTextForPlayer(playerid, "Kaupa laetakse maha...", 6950, 3);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnfreezePlayer", 7000, false, "d", playerid);
SetPlayerCheckpoint(playerid,681.379150, -443.011749, 16.335937, 3);
return 1;
}
return 1;
}
Oh and i want it to say "The cargo is being loaded on the bus" for the first CP and
"The cargo is being loaded off the bus" for 4 others.
Here are the coordinates for the other 4 Checkpoints:
pawn Code:
SetPlayerCheckpoint(playerid,156.981262, -167.841812, 1.578125, 3);
SetPlayerCheckpoint(playerid,663.840759, -548.668701, 16.335937, 3);
SetPlayerCheckpoint(playerid,714.766601, -569.432983, 16.335937, 3);
SetPlayerCheckpoint(playerid,124.784370, -268.202026, 1.578125, 3); // End
I don't want you to make it for me, just give me tips how should i make the checkpoint system.
Re: Checkpoint problem -
mati233 - 28.06.2012
You should create some pVar where you store the checkpoint order.
My suggestion is to you add on /work, the first checkpoint position, something like this:
WorkCheckpoint[playerid]=1;
and then, onplayerentercheckpoint you check if the workcheckpoint is 1, create the 2nd one and change the WorkCheckpoint[playerid] to 2, and so on until the last one.
I hope this helps you, but let me know if you need more help
Re: Checkpoint problem -
-CaRRoT - 28.06.2012
You can use
OR
Just make CP Id's for each one
like.. Once the player enter the First
It sets CP[playerid] = 500
the second - CP[playerid] = 501
etc. - And so on.
Re: Checkpoint problem -
kaiks - 28.06.2012
Thanks, but how should i define WorkCheckpoint?
Re: Checkpoint problem -
mati233 - 28.06.2012
new WorkCheckpoint[MAX_PLAYERS];
Re: Checkpoint problem -
kaiks - 28.06.2012
Ok, please tell me where to put it, idk if my placement is right, because it doesn't change anything.
pawn Code:
if(strcmp(cmdtext, "/tццle", true) == 0)
{
if(gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_GREY, "Sa ei ole kaubavedaja!");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 440) return SendClientMessage(playerid, COLOR_GREY, "Sa ei ole kaubavedaja autos!");
if(gTeam[playerid] == 2)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
SendClientMessage(playerid, COLOR_GREY, "Alustasid tццd, mine vхta kaup peale.");
WorkCheckpoint[playerid] = 1;
SetPlayerCheckpoint(playerid,120.403518, -294.375122, 1.578125, 3.0);
}
return 1;
}
return 1;
}
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
if (WorkCheckpoint[playerid] == 1)
WorkCheckpoint[playerid] = 2;
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
if(gTeam[playerid] == 2) // The carbo is being loaded on the bus or smth like that
GameTextForPlayer(playerid, "Kaupa laetakse peale...", 6950, 3);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnfreezePlayer", 7000, false, "d", playerid);
SetPlayerCheckpoint(playerid,203.737503, -181.615310, 1.578125,3);
return 1;
}
if (WorkCheckpoint[playerid] == 2)
WorkCheckpoint[playerid] = 3;
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
if(gTeam[playerid] == 2) // The cargo is being loaded off the bus or smth like that
GameTextForPlayer(playerid, "Kaupa laetakse maha...", 6950, 3);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnfreezePlayer", 7000, false, "d", playerid);
SetPlayerCheckpoint(playerid,681.379150, -443.011749, 16.335937, 3);
return 1;
}
return 1;
}
Re: Checkpoint problem -
kaiks - 28.06.2012
I'm terribly sorry for doubleposting, but i need to get this fixed asap!
Re: Checkpoint problem -
[A]ndrei - 28.06.2012
put this under #inclue <a_samp>
Code:
new WorkCheckpoint[MAX_PLAYERS];
... and tell me if it working...also +rep.":P
Re: Checkpoint problem -
kaiks - 28.06.2012
Well, i have this already there
// edit: it won't delete the second CP and it won't create the third.
Re: Checkpoint problem -
[A]ndrei - 28.06.2012
you trying to make a race