[Tutorial] Team Cars and Team Players
#32

guys i got a problem i have some cars at each team but it seems to only attach one car to the TeamCars Varible

what im trying to say is that it only works on 1 car out of 50 cars from each team

heres the code
Quote:

#define GroveStreet 1
#define TheBallas 2
#define LosSantonVagos 3
#define LosSantonPoliceDepartment 4
#define TheAdmins 5

enum TeamCars
{
Grove,
Ballas,
Vagos,
Police,
Admin
}

new Cars[TeamCars];

public OnGameModeInit()
{
SetGameModeText("Gang Wars 1.4 Pre-Release");

InsidePoliceInterior = CreatePickup(1559,1,246.9049,63.2743,1003.6406);
OutsidePoliceInterior = CreatePickup(1559,1,1554.9202,-1675.6155,16.1953);

InitAdminIsland();
InitNormalCars();
DisableInteriorEnterExits();

AddPlayerClass(105,2486.7302,-1646.1447,14.0703,178.8743,0,0,0,0,0,0); // Grove
AddPlayerClass(106,2486.7302,-1646.1447,14.0703,178.8743,0,0,0,0,0,0); // Grove
AddPlayerClass(107,2486.7302,-1646.1447,14.0703,178.8743,0,0,0,0,0,0); // Grove
AddPlayerClass(102,2520.3413,-1269.8400,34.9172,92.3740,0,0,0,0,0,0); // Ballas
AddPlayerClass(103,2520.1514,-1272.5846,34.8872,92.3014,0,0,0,0,0,0); // Ballas
AddPlayerClass(104,2519.8794,-1275.8303,34.8543,91.9881,0,0,0,0,0,0); // Ballas
AddPlayerClass(108,2091.1516,-1278.1311,26.1797,177.5771,0,0,0,0,0,0); // Vagos
AddPlayerClass(109,2100.6931,-1321.1943,25.9531,0.3971,0,0,0,0,0,0); // Vagos
AddPlayerClass(110,2126.6907,-1319.8890,26.6241,359.1438,0,0,0,0,0,0); // Vagos
AddPlayerClass(280,238.0694,81.3392,1005.0391,177. 9750,0,0,0,0,0,0); // Police
AddPlayerClass(284,254.0679,79.4351,1003.6406,184. 2418,0,0,0,0,0,0); // Police
AddPlayerClass(285,251.9365,69.7897,1003.6406,182. 3534,0,0,0,0,0,0); // Police
AddPlayerClass(0,-4710.60000976563, -2141.1999511719, 3,0,0,0,0,0,0,0); //Admin

total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");

Cars[Grove] = AddStaticVehicleEx(521,2504.1831,-1681.2936,13.4167,313.4581,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(567,2507.7161,-1676.5947,13.4150,328.0182,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(567,2509.7583,-1668.0225,13.4151,4.5082,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(492,2506.2393,-1661.5188,13.3711,30.4039,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(492,2499.9861,-1656.0059,13.3640,66.1636,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(492,2486.9788,-1655.2881,13.3001,89.6201,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(567,2477.8030,-1655.1450,13.2881,85.6544,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(521,2470.1208,-1669.4840,13.2762,194.7010,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(567,2482.7283,-1682.2708,13.2957,257.8247,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(521,2473.6814,-1691.4963,13.4823,355.3263,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(492,2492.7900,-1667.4320,13.3082,91.3398,16,16,200); // grove cars
Cars[Grove] = AddStaticVehicleEx(492,-2482.1794,741.7360,34.9838,177.3357,16,16,200); // grove cars

Cars[Ballas] = AddStaticVehicleEx(517,2517.2578,-1269.2622,34.6518,0.6344,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(412,2517.3618,-1279.1846,34.5842,1.0586,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(412,2517.5024,-1288.4667,34.5847,1.1375,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2506.0754,-1268.5667,34.7061,357.3175,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2506.1113,-1276.9868,34.5891,359.0419,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(521,2505.9934,-1285.8048,34.5832,358.9858,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(521,2505.7996,-1293.9130,34.6427,358.3488,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2506.3281,-1303.9473,34.5854,0.5607,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2497.6331,-1297.6099,33.6986,268.5708,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(412,2489.2539,-1297.4132,31.6066,268.6092,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(412,2516.9897,-1297.3716,34.5843,1.8464,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2517.2505,-1306.3623,34.5850,1.9360,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2497.3076,-1310.5127,34.6847,273.0965,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(517,2519.7905,-1251.0106,34.7905,87.8803,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(412,2512.1719,-1250.7924,34.7899,90.9067,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(412,2504.9294,-1243.6633,35.5174,179.7809,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(521,2496.9771,-1277.1754,33.5404,273.1626,18,18,200); // ballas cars
Cars[Ballas] = AddStaticVehicleEx(521,2487.5352,-1276.9391,31.1641,270.3904,18,18,200); // ballas cars

Cars[Vagos] = AddStaticVehicleEx(521,2136.9758,-1272.6902,25.2209,179.8333,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(521,2137.8257,-1282.0659,24.7039,180.3275,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(421,2137.8818,-1290.4994,23.8267,180.0450,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(521,2127.7202,-1295.4674,23.6272,88.8410,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(421,2146.4373,-1295.6436,23.6284,89.9669,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(467,2121.0525,-1295.1941,23.6236,89.8223,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(467,2113.0447,-1295.1909,23.6220,89.8825,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(467,2105.6450,-1295.1965,23.6220,89.8951,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(467,2102.6968,-1287.2336,24.1916,182.7039,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(421,2102.3328,-1279.4446,25.0922,182.6211,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2102.0029,-1269.1632,25.2151,181.6679,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2095.6672,-1278.7257,25.2222,180.8575,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2095.6277,-1286.3131,24.4552,177.1500,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2088.2161,-1295.3016,23.6221,90.7153,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2096.1912,-1328.1865,25.2698,359.8462,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(421,2096.1262,-1320.2067,24.8310,0.5762,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2096.1025,-1311.2137,23.8345,359.4650,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2084.8406,-1306.4240,23.6298,87.8697,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(466,2102.6438,-1306.5737,23.6344,89.4859,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2109.8848,-1306.2804,23.6363,90.0858,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2120.9751,-1306.6559,23.6392,89.0898,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2130.7627,-1306.5465,23.6423,88.5727,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2135.9355,-1314.7562,24.1499,359.5461,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2135.8562,-1324.9437,25.1730,359.5646,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2141.0217,-1313.9171,24.0616,0.3629,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2141.0828,-1323.4319,25.0907,0.3512,6,6,200); // vagos cars
Cars[Vagos] = AddStaticVehicleEx(412,2151.7292,-1306.4357,23.6368,270.7486,6,6,200); // vagos cars

Cars[Police] = AddStaticVehicleEx(523,1534.5154,-1644.3500,5.5969,359.9719,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1530.4299,-1645.3601,5.5973,0.7343,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1526.3368,-1644.7292,5.5976,1.6345,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1545.0204,-1650.9500,5.5972,270.0413,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1544.7876,-1654.8024,5.5970,270.1172,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1544.9452,-1662.9974,5.5978,269.7078,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1544.8580,-1667.9487,5.5970,269.5803,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1544.4977,-1672.0206,5.5976,268.7257,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1544.5427,-1676.1750,5.5973,270.9517,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1544.4313,-1680.2073,5.5977,270.4905,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1529.3984,-1688.1602,5.5969,89.5717,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1558.9564,-1710.4376,5.5966,180.8348,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1564.5616,-1710.0542,5.5969,181.2003,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1570.3276,-1710.3354,5.5986,180.9288,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1578.7135,-1710.6337,5.5974,180.9164,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1583.5629,-1709.8947,5.5978,180.6574,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1587.5587,-1709.7699,5.5972,180.8993,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1591.5131,-1709.7134,5.5975,180.0194,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1595.6508,-1709.6755,5.5975,180.7994,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1601.0807,-1699.9777,5.5976,270.7956,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1600.8729,-1691.9951,5.5977,269.0189,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1600.3466,-1687.8993,5.5979,269.9349,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1600.6891,-1683.9172,5.5974,269.9779,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(523,1585.9421,-1671.7094,5.6008,90.1356,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(596,1585.5795,-1667.5155,5.5992,90.0943,47,95,200); // police cars
Cars[Police] = AddStaticVehicleEx(497,1565.3105,-1615.6497,13.0898,177.8273,47,95,200); // police helicopters
Cars[Police] = AddStaticVehicleEx(497,1576.5695,-1614.2402,13.0899,179.9302,47,95,200); // police helicopters
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Grove])
{
if(gTeam[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, RED, "You Don't have the keys for this car!");
return 1;
}
else
{
SendClientMessage(playerid, RED, "You have the keys for this car");
}
}

if(CarCheck == Cars[Ballas])
{
if(gTeam[playerid] != 2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, RED, "You Don't have the keys for this car!");
return 1;
}
else
{
SendClientMessage(playerid, RED, "You have the keys for this car");
}
}

if(CarCheck == Cars[Vagos])
{
if(gTeam[playerid] != 3)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, RED, "You Don't have the keys for this car!");
return 1;
}
else
{
SendClientMessage(playerid, RED, "You have the keys for this car");
}
}

if(CarCheck == Cars[Police])
{
if(gTeam[playerid] != 4)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, RED, "You Don't have the keys for this car!");
return 1;
}
else
{
SendClientMessage(playerid, RED, "You have the keys for this car");
}
}
return 1;
}
return 1;
}

Reply


Messages In This Thread
Team Cars and Team Players - by Emanuel_Rodriguez - 17.07.2010, 20:30
Re: Team Cars and Team Players - by Thebest96 - 17.07.2010, 21:02
Re: Team Cars and Team Players - by [XST]O_x - 17.07.2010, 21:05
Re: Team Cars and Team Players - by Thebest96 - 17.07.2010, 21:08
Re: Team Cars and Team Players - by Desertsoulz - 20.07.2010, 23:35
Re: Team Cars and Team Players - by Scenario - 20.07.2010, 23:46
Re: Team Cars and Team Players - by 3ventic - 26.07.2010, 15:22
Re: Team Cars and Team Players - by R@ger - 26.07.2010, 15:34
Re: Team Cars and Team Players - by Steven82 - 29.07.2010, 19:30
Re: Team Cars and Team Players - by Scenario - 30.07.2010, 03:40
Re: Team Cars and Team Players - by CEZALAND - 31.07.2010, 22:17
Re: Team Cars and Team Players - by sDAAw - 03.08.2010, 22:27
Re: Team Cars and Team Players - by MadalinX5 - 08.08.2010, 10:08
Re: Team Cars and Team Players - by nexco - 21.08.2010, 20:29
Re: Team Cars and Team Players - by bertuspiteri - 22.08.2010, 20:18
Re: Team Cars and Team Players - by Nekrus2 - 22.08.2010, 23:20
Re: Team Cars and Team Players - by sekol - 30.08.2010, 13:17
Re: Team Cars and Team Players - by Yamoo - 30.08.2010, 17:11
Re: Team Cars and Team Players - by Thebest96 - 01.09.2010, 14:47
Re: Team Cars and Team Players - by Thebest96 - 03.09.2010, 06:25
Re: Team Cars and Team Players - by Nekrus2 - 03.09.2010, 16:40
Re: Team Cars and Team Players - by Nekrus2 - 03.09.2010, 16:42
Re: Team Cars and Team Players - by Thebest96 - 03.09.2010, 21:19
Re: Team Cars and Team Players - by tanush - 16.10.2010, 19:11
Re: Team Cars and Team Players - by IndoScripter - 29.10.2010, 12:03
Re: Team Cars and Team Players - by Tessar - 30.10.2010, 19:45
Re: Team Cars and Team Players - by fysssical - 17.11.2010, 15:33
Re: Team Cars and Team Players - by Miado_Hulk - 20.11.2010, 16:36
Re: Team Cars and Team Players - by ollis93 - 21.11.2010, 17:57
Re: Team Cars and Team Players - by EstSampBro - 20.06.2013, 20:12
Re: Team Cars and Team Players - by hitman14 - 12.08.2014, 12:10
Re: Team Cars and Team Players - by killerbigpoint - 10.10.2014, 16:55
Re: Team Cars and Team Players - by TheRaGeLord - 04.01.2015, 12:59
Re: Team Cars and Team Players - by Ankon - 12.10.2015, 03:58

Forum Jump:


Users browsing this thread: 1 Guest(s)