[Help Count]AddStaticVehicle
#2

Firstly, arrays always start at 0, not 1.

You are ending the loop with a return so it won't be able to continue, I don't see why you're using 'count' anyway...


pawn Код:
new TaxiVehicleLS[13];

public OnGameModeInit()
{
    TaxiVehicleLS[0] = AddStaticVehicleEx(437,1779.7747,-1909.4396,13.5150,270.6893,-1, -1, -1); // taxibus 1
    TaxiVehicleLS[1] = AddStaticVehicleEx(437,1779.9159,-1905.5310,13.5226,270.6135,-1, -1, -1); // taxibus 2
    TaxiVehicleLS[2] = AddStaticVehicleEx(431,1780.0096,-1913.6144,13.4936,271.8171,-1, -1, -1); // taxibus 3
    TaxiVehicleLS[3] = AddStaticVehicleEx(431,1780.6726,-1918.0997,13.4908,271.9992,-1, -1, -1); // taxibus 4
    TaxiVehicleLS[4] = AddStaticVehicleEx(420,1805.4719,-1900.7300,13.1805,0.3763,-1, -1, -1); // taxicar 1
    TaxiVehicleLS[5] = AddStaticVehicleEx(420,1805.4923,-1907.5823,13.1766,0.0030,-1, -1, -1); // taxicar 2
    TaxiVehicleLS[6] = AddStaticVehicleEx(420,1805.5555,-1914.0067,13.1747,0.5064,-1, -1, -1); // taxicar 3
    TaxiVehicleLS[7] = AddStaticVehicleEx(420,1805.6178,-1920.7666,13.1712,359.7094,-1, -1, -1); // taxicar 4
    TaxiVehicleLS[8] = AddStaticVehicleEx(420,1805.5529,-1927.7074,13.1670,359.8926,-1, -1, -1); // taxicar 5
    TaxiVehicleLS[9] = AddStaticVehicleEx(420,1802.5177,-1933.4368,13.1809,301.5674,-1, -1, -1); // taxicar 6
    TaxiVehicleLS[10] = AddStaticVehicleEx(420,1795.1158,-1934.3496,13.2183,271.0070,-1, -1, -1); // taxicar 7
    TaxiVehicleLS[11] = AddStaticVehicleEx(438,1783.0457,-1934.3837,13.4554,270.3791,-1, -1, -1); // taxicar 8
    TaxiVehicleLS[12] = AddStaticVehicleEx(438,1776.6875,-1934.2457,13.4331,270.3553,-1, -1, -1); // taxicar 9

    for(new PV = 0; PV < sizeof(TaxiVehicleLS); PV++)
    {
        if(TaxiVehicleLS[PV] != INVALID_VEHICLE_ID)
        {
            SetVehicleNumberPlate(TaxiVehicleLS[PV], "LSTV");
            SetVehicleToRespawn(TaxiVehicleLS[PV]);
        }
    }
    return 1;
}

public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        for(new PV = 0; PV < sizeof(TaxiVehicleLS); PV++)
        {
            if(Vehicle == TaxiVehicleLS[PV])
            {
                if(UserInfo[playerid][uTaxiTeam] != 1)
                {
                    SendClientMessage(playerid, 0x33AA33AA, "You Are Not A Taxi Driver");
                    RemovePlayerFromVehicle(playerid);
                }
                else
                {
                    new string2[150];
                    format(string2, sizeof(string2), "You Entered A %s, Owned By LSTV", VehicleNames[GetVehicleModel(Vehicle) - 400]);
                    SendClientMessage(playerid, GREEN, string2);
                    SendClientMessage(playerid, ORANGE,"You Enter A Taxi Default price $50 To Change type /fare <price>");
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
[Help Count]AddStaticVehicle - by Buzzbomb - 11.01.2013, 14:56
Re: [Help Count]AddStaticVehicle - by Threshold - 11.01.2013, 15:54
Re: [Help Count]AddStaticVehicle - by Buzzbomb - 11.01.2013, 16:11
Re: [Help Count]AddStaticVehicle - by Vince - 11.01.2013, 16:24
Re: [Help Count]AddStaticVehicle - by Buzzbomb - 11.01.2013, 16:54
Re: [Help Count]AddStaticVehicle - by Vince - 11.01.2013, 17:06
Re: [Help Count]AddStaticVehicle - by Buzzbomb - 11.01.2013, 17:08

Forum Jump:


Users browsing this thread: 1 Guest(s)