Checkpoint reward - 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 reward (
/showthread.php?tid=655895)
Checkpoint reward -
kkurex1 - 02.07.2018
Heyo,im new here,I started doing STUNT/DM/FREEROAM server,but I dont know how to make system,at the end of parkour,when player finish it,he get's,etc 15 score and 15k money....this are cordinates...1535.8688,-1353.1501,329.4570...I was looking for someone who knows PAWNO better then me,but no one knows how to do that.Thanks for reply!
Re: Checkpoint reward -
Jing_Chan - 02.07.2018
You'll need to look at checkpoints and OnPlayerEnterCheckpoint, the others listed are also relevant.
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
OnPlayerLeaveCheckpoint: Called when a player leaves a checkpoint.
OnPlayerEnterRaceCheckpoint: Called when a player enters a race checkpoint.
OnPlayerLeaveRaceCheckpoint: Called when a player leaves a race checkpoint.
Obviously I don't know how your script looks but it'd be something like this:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(StartedRace[playerid] && RaceStep[playerid] == 6) // say 6 is the final step, idk
{
// Code here (SetPlayerScore etc..)
}
}
Re: Checkpoint reward -
CaptainBoi - 02.07.2018
use OnPlayerEnterCheckpoint and put this
PHP код:
if(racecp[playerid] == 2)
{
SetPlayerScore(playerid, GetPlayerScore(playerid)+100);
GivePlayerMoney(playerid, 1000);
}
if that player has completed last lap of race he will achieved 100 scores and 1000$ money