Checkpoints?
#1

Does anyone know how I would create a check point. Like if someone typed /joinrace it would make a check point.
And does anyone know how I would make it so they would get 100 dollars for passing the checkpoint

Any help would be greatly appreciated
Reply
#2

In you mean normal checkpoints use SetPlayerCheckpointBut if you want a race use SetPlayerRaceCheckpoint
Now there are a lot of tutorials for organizing a race, here's a simple one:
The command
pawn Код:
if (strcmp("/joinrace", cmdtext, true, 10) == 0)
    {
    SetPlayerPos(playerid,x,y,z);//The coords of the player in the race start
    PutPlayerInVehicle(playerid,vehicle,1);//make sure you replace vehicleid with an already defined car
    SetPlayerRaceCheckpoint(playerid,type,(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size);//This will be the first checkpoint
   
        return 1;
    }
the callback when a player enters the Cp
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
       GivePlayerMoney(playerid,100);//Giving the player money
    return 1;
}
P.S: this is just an example in you want a whole race you have to use a variable and cases to not mix up the CheckPoints,Check the tutorials.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)