Putting a player in a random vehicle isn't working
#1

I created a derby map system to get a random vehicle and put the player inside, all works well with 1 person, but when a second person enters the area (triggering this stock), the first player is put in the vehicle.

pawn Код:
stock GetDerbyCar(playerid)
{
    new rand=random(13);
    switch(rand)
    {
        case 0:
        {
            RandDerbyCar[playerid] = CreateVehicle(504,-1299.3000000,949.7000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 1:
        {
            RandDerbyCar[playerid] = CreateVehicle(504,-1299.3000000,949.7000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 2:
        {
            RandDerbyCar[playerid] = CreateVehicle(504,-1299.3000000,949.7000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 3:
        {
            RandDerbyCar[playerid] = CreateVehicle(494,-1304.2000000,948.2000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 4:
        {
            RandDerbyCar[playerid] = CreateVehicle(494,-1304.2000000,948.2000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 5:
        {
            RandDerbyCar[playerid] = CreateVehicle(494,-1304.2000000,948.2000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 6:
        {
            RandDerbyCar[playerid] = CreateVehicle(502,-1308.4000000,947.2000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 7:
        {
            RandDerbyCar[playerid] = CreateVehicle(502,-1308.4000000,947.2000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 8:
        {
            RandDerbyCar[playerid] = CreateVehicle(502,-1308.4000000,947.2000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 9:
        {
            RandDerbyCar[playerid] = CreateVehicle(503,-1313.1000000,945.7000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 10:
        {
            RandDerbyCar[playerid] = CreateVehicle(503,-1313.1000000,945.7000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 11:
        {
            RandDerbyCar[playerid] = CreateVehicle(503,-1313.1000000,945.7000000,1222.2000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
        case 12:
        {
            RandDerbyCar[playerid] = CreateVehicle(598,-1317.6000000,944.5000000,1222.1000000,0.0000000,-1,-1,15);
            PutPlayerInVehicle(playerid,RandDerbyCar[playerid],0);
            return 1;
        }
    }
    return 1;
}
Reply


Messages In This Thread
Putting a player in a random vehicle isn't working - by Aerotactics - 22.03.2014, 11:25
Re: Putting a player in a random vehicle isn't working - by vassilis - 22.03.2014, 11:36
Re: Putting a player in a random vehicle isn't working - by Aerotactics - 22.03.2014, 18:42

Forum Jump:


Users browsing this thread: 1 Guest(s)