PDA

View Full Version : Checkpoint reward


kkurex1
02/07/2018, 01:01 PM
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! :D

Jing_Chan
02/07/2018, 01:19 PM
You'll need to look at checkpoints and OnPlayerEnterCheckpoint, the others listed are also relevant.

http://wiki.sa-mp.com/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:


public OnPlayerEnterCheckpoint(playerid)
{
if(StartedRace[playerid] && RaceStep[playerid] == 6) // say 6 is the final step, idk
{
// Code here (SetPlayerScore etc..)
}
}

CaptainBoi
02/07/2018, 05:22 PM
use OnPlayerEnterCheckpoint and put this
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