Checkpoint reward
#1

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!
Reply
#2

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..)
        }
}
Reply
#3

use OnPlayerEnterCheckpoint and put this
PHP код:
if(racecp[playerid] == 2)
{
 
SetPlayerScore(playeridGetPlayerScore(playerid)+100);
 
GivePlayerMoney(playerid1000);

if that player has completed last lap of race he will achieved 100 scores and 1000$ money
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)