Problem with checkpoints! - 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: Problem with checkpoints! (
/showthread.php?tid=354322)
Problem with checkpoints! -
KosmasRego - 26.06.2012
I have scripted a sweeper job, the first checkpoins shows up but the second and third not.
The CMD:
pawn Код:
if(strcmp(cmd, "/startsweeping", true) == 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pJob] == 2)
{
if(Sweeping[playerid] == 0)
{
if(IsASweepingCar(tmpcar))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You can now start sweeping.");
CP[playerid] = 1;
Sweeping[playerid] = 1;
SetPlayerCheckpoint(playerid, 2140.5813,-2115.7019,13.2051, 5);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_CREAM, "You are not in a street sweeping car.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_CREAM, "You are already sweeping.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_CREAM, "You are not a street sweeper.");
return 1;
}
}
public OnPlayerEnterCheckpoint:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new pveh = GetPlayerVehicleID(playerid);
if(CP[playerid]==1)
{
if(IsASweepingCar(pveh) && Sweeping[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1987.5314,-2108.5859,13.1661, 5);
CP[playerid] = 2;
GameTextForPlayer(playerid, "~g~+$50", 2000, 3);
SafeGivePlayerMoney(playerid, 50);
Sweeping[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in a sweeper.");
}
}
else if(CP[playerid]==2 && Sweeping[playerid] == 1)
{
if(IsASweepingCar(pveh))
{
SetPlayerCheckpoint(playerid, 2045.5214,-1935.0801,13.1432, 5);
CP[playerid] = 3;
GameTextForPlayer(playerid, "~g~+$50", 2000, 3);
SafeGivePlayerMoney(playerid, 50);
Sweeping[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in a sweeper.");
}
}
else if(CP[playerid]==3 && Sweeping[playerid] == 1)
{
if(IsASweepingCar(pveh))
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2083.7595,-1831.7170,13.2008, 5);
CP[playerid] = 4;
GameTextForPlayer(playerid, "~g~+$50", 2000, 3);
SafeGivePlayerMoney(playerid, 50);
Sweeping[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in a sweeper.");
}
}
return 1;
}
Re: Problem with checkpoints! -
MadeMan - 26.06.2012
Show the whole OnPlayerEnterCheckpoint callback.
Re: Problem with checkpoints! -
KosmasRego - 26.06.2012
I've put the whole OnPlayerEnterCheckpoint.
Can anyone help please?