Random Checkpoints help
#3

A better code in my opinion would be:
pawn Код:
// top of the script
#define MAX_CHECKPOINTS (3)

static Float: checkpointLocations[MAX_CHECKPOINTS][3] =
{
    { 2332.1140, -1680.7076, 13.7506 },
    { 2508.3562, -1654.8031, 13.8660 },
    { 2141.2703, -1611.0664, 13.8660 },
    { 1092.9705, -1093.6687, 25.5253 }
};

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        new rand = random(MAX_CHECKPOINTS);
        SetPlayerCheckpoint(playerid, checkpointLocations[rand][0], checkpointLocations[rand][1], checkpointLocations[rand][2], 5.0);
        SendClientMessage(playerid, -1," Drive the pizza bike to the checkpoint then bring back the bike!");
    }
}
Reply


Messages In This Thread
Random Checkpoints help - by EthanMason - 10.11.2013, 17:44
Re: Random Checkpoints help - by EiresJason - 10.11.2013, 21:03
Re: Random Checkpoints help - by Loot - 10.11.2013, 23:33

Forum Jump:


Users browsing this thread: 1 Guest(s)