Checkpoint issues - 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: Checkpoint issues (
/showthread.php?tid=454896)
Checkpoint issues -
ChristofferHoffmann - 30.07.2013
Howdy people. I've been implementing this streetsweeper job into my script, and it seems to work fine except for the fact that once I enter the checkpoints it doesn't destroy itself and give the money. It simply stays.
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(PlayerIsSweeping[playerid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new car = GetPlayerVehicleID(playerid);
if(car == sweep1 || car == sweep2 || car == sweep3)
{
new cashes=(random(35-10)+10);
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][pPayCheck] += cashes;
new randomss;
randomss = random(sizeof(gSweeperPoints));
SetPlayerCheckpoint(playerid, gSweeperPoints[randomss][0], gSweeperPoints[randomss][1], gSweeperPoints[randomss][2], 5.0);
}
}
return 1;
}
Код:
CMD:startsweeping(playerid, params[])
{
if(IsPlayerInVehicle(playerid, sweep1) || IsPlayerInVehicle(playerid, sweep2))
{
PlayerIsSweeping[playerid] = 1;
TogglePlayerControllable(playerid, 1);
new randomize;
randomize = random(sizeof(gSweeperPoints));
SetPlayerCheckpoint(playerid, gSweeperPoints[randomize][0], gSweeperPoints[randomize][1], gSweeperPoints[randomize][2], 5.0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You've gone on duty as a Street Sweeper, please follow the red checkpoints.");
}
else return SendClientMessage(playerid, COLOR_GREY,"You must be in a Sweeper.");
return 1;
}
Re: Checkpoint issues -
ChristofferHoffmann - 31.07.2013
bump