Ich würde gern mein Motor System nun für die Taxifahrer nur noch erweitern
hier einmal der Code
Code
ocmd:motor(playerid,params[])
{
#pragma unused params
if(!IsPlayerInAnyVehicle(playerid))return 1;
new vehicleid=GetPlayerVehicleID(playerid);
if(vehicleid==INVALID_VEHICLE_ID)return 1;
if(EventCar[GetPlayerVehicleID(playerid)] && !adminduty[playerid]) return ErrorMsg(playerid, "Das ist ein Eventfahrzeug.");
if(GetVehicleModel(vehicleid)==481||GetVehicleModel(vehicleid)==509||GetVehicleModel(vehicleid)==510)
{
return 1;
}
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
for(new i = 0; i < sizeof(PlayerAuto); i++)
{
if(!strcmp(SpielerName(playerid),PlayerAuto[i][vkey],true)&&PlayerAuto[i][vmodel]!=0&&PlayerAuto[i][id_x]==vehicleid||!strcmp(SpielerName(playerid),PlayerAuto[i][key1],true)&&strlen(PlayerAuto[i][key1])&&PlayerAuto[i][vmodel]!=0&&PlayerAuto[i][id_x]==vehicleid||!strcmp(SpielerName(playerid),PlayerAuto[i][key2],true)&&strlen(PlayerAuto[i][key2])&&PlayerAuto[i][vmodel]!=0&&PlayerAuto[i][id_x]==vehicleid
||!strcmp(SpielerName(playerid),PlayerAuto[i][key3],true)&&strlen(PlayerAuto[i][key3])&&PlayerAuto[i][vmodel]!=0&&PlayerAuto[i][id_x]==vehicleid||!strcmp(SpielerName(playerid),PlayerAuto[i][key4],true)&&strlen(PlayerAuto[i][key4])&&PlayerAuto[i][vmodel]!=0&&PlayerAuto[i][id_x]==vehicleid||!strcmp(SpielerName(playerid),PlayerAuto[i][key5],true)&&strlen(PlayerAuto[i][key5])&&PlayerAuto[i][vmodel]!=0&&PlayerAuto[i][id_x]==vehicleid)
{
if(engine==1)
{
engineOff(vehicleid);
GameTextForPlayer(playerid,"~w~Motor ~r~ausgeschaltet",1500,4);
}
else
{
if(tank[vehicleid]>0)
{
if(istkaputt[vehicleid]==0)
{
engineOn(vehicleid);
GameTextForPlayer(playerid,"~w~Motor ~g~angeschaltet",1500,4);
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"Der Motor ist kaputt.");
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"ACHTUNG: Kein Benzin!");
}
}
}
}
for(new i = 0; i < sizeof(FraktAuto); i++)
{
if(vehicleid == FraktAuto[i][id_x])
{
if(!IsPlayerInFrakt(playerid,FraktAuto[i][besitzer]))
{
SendClientMessage(playerid, 0xFF0000FF, "Error: Du bist nicht in der Fraktion dieses Fahrzeugs.");
return 1;
}
if(engine==1)
{
engineOff(vehicleid);
GameTextForPlayer(playerid,"~w~Motor ~r~angeschaltet",1500,4);
}
if(engine==0)
{
engineOn(vehicleid);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~g~aus!", 2000, 5);
}
break;
}
}
return 1;
}
Alles anzeigen
leider weiß ich nicht genau wie ich das ganze Richtig realisiere.
Die Autos werden wie folgt erstellt
Code
new taxicar[35]
taxicar[0]=AddStaticVehicleEx(420,1143.7366,-1409.4393,13.3057,268.6709,6,1,60); // Taxi1
taxicar[1]=AddStaticVehicleEx(420,1136.5320,-1409.1310,13.2710,269.5165,6,1,60); // Taxi2
taxicar[2]=AddStaticVehicleEx(420,1128.6962,-1409.0643,13.2310,269.5055,6,1,60); // Taxi3
taxicar[3]=AddStaticVehicleEx(420,1120.8845,-1409.0001,13.1963,269.5352,6,1,60); // Taxi4
taxicar[4]=AddStaticVehicleEx(420,1111.6664,-1408.9298,13.2031,269.5458,6,1,60); // Taxi5
taxicar[5]=AddStaticVehicleEx(438,1050.5005,-1378.1759,13.4710,177.7959,6,76,60); // Taxi6
taxicar[6]=AddStaticVehicleEx(438,1050.8190,-1369.6045,13.3921,177.8810,6,76,60); // Taxi7
taxicar[7]=AddStaticVehicleEx(438,1050.7854,-1359.8807,13.3872,177.5562,6,76,60); // Taxi8
taxicar[8]=AddStaticVehicleEx(438,1050.6504,-1348.3679,13.3864,179.6256,6,76,60); // Taxi9
taxicar[9]=AddStaticVehicleEx(438,1728.0596,-1857.3757,13.4175,269.6006,6,76,60); // Taxi10
taxicar[10]=AddStaticVehicleEx(438,1740.1840,-1857.4603,13.4163,269.6007,6,76,60); // Taxi11
taxicar[11]=AddStaticVehicleEx(438,1752.6537,-1857.5471,13.4151,269.6006,6,76,60); // Taxi12
taxicar[12]=AddStaticVehicleEx(420,1761.2740,-1857.4293,13.1935,269.6945,6,1,60); // Taxi13
taxicar[13]=AddStaticVehicleEx(420,1768.3048,-1857.4670,13.1944,269.6945,6,1,60); // Taxi14
taxicar[14]=AddStaticVehicleEx(420,1775.6135,-1857.5059,13.1941,269.6946,6,1,60); // Taxi15
taxicar[15]=AddStaticVehicleEx(420,1785.0443,-1857.5563,13.1910,269.6948,6,1,60); // Taxi16
taxicar[16]=AddStaticVehicleEx(420,1795.5613,-1857.6123,13.1892,269.6951,6,1,60); // Taxi17
taxicar[17]=AddStaticVehicleEx(420,1805.0453,-1857.6627,13.1895,269.6956,6,1,60); // Taxi18
taxicar[18]=AddStaticVehicleEx(438,2861.2126,-1904.1444,10.9388,1.0194,6,76,60); // Taxi19
taxicar[19]=AddStaticVehicleEx(438,2861.4614,-1918.1346,10.9393,1.0180,6,76,60); // Taxi20
taxicar[20]=AddStaticVehicleEx(438,2861.0581,-1931.5226,10.9371,357.9123,6,76,60); // Taxi21
taxicar[21]=AddStaticVehicleEx(438,2860.8391,-1944.0321,10.9430,359.1193,6,76,60); // Taxi22
taxicar[22]=AddStaticVehicleEx(420,1786.9514,-1690.6276,13.2313,140.3997,6,1,60); // Taxi36
taxicar[23]=AddStaticVehicleEx(420,1781.3175,-1690.5793,13.2210,138.0859,6,1,60); // Taxi37
taxicar[24]=AddStaticVehicleEx(420,1773.7286,-1690.4177,13.2107,140.7546,6,1,60); // Taxi38
taxicar[25]=AddStaticVehicleEx(420,2861.0002,-1995.7167,10.7149,1.2149,6,1,60); // Taxi26
taxicar[26]=AddStaticVehicleEx(420,2861.2188,-2008.2367,10.7145,359.4226,6,1,60); // Taxi27
taxicar[27]=AddStaticVehicleEx(420,2861.0930,-2020.6819,10.7154,359.4196,6,1,60); // Taxi28
taxicar[28]=AddStaticVehicleEx(420,2861.2080,-2033.7750,10.7203,0.6356,6,1,60); // Taxi29
taxicar[29]=AddStaticVehicleEx(420,2861.3535,-2047.1915,10.7191,0.6187,6,1,60); // Taxi30
taxicar[30]=AddStaticVehicleEx(438,1752.4453,-1650.0365,13.3867,358.5240,6,76,60); // Taxi31
taxicar[31]=AddStaticVehicleEx(438,1752.3444,-1662.0284,13.3864,0.9167,6,76,60); // Taxi32
taxicar[32]=AddStaticVehicleEx(438,1752.2312,-1675.7593,13.3860,359.1940,6,76,60); // Taxi33
taxicar[33]=AddStaticVehicleEx(438,1797.7559,-1690.5951,13.5036,142.3643,6,76,60); // Taxi34
taxicar[34]=AddStaticVehicleEx(420,1793.1224,-1690.4962,13.2563,144.5417,6,1,60); // Taxi35
Alles anzeigen
ich wäre um eure Hilfe dankbar