Unterschiedlich da halt auch je nach Busfahrerskill, längere Strecken hinzukommen
Eigentlich soll er als Daten aus new bsInfo[][busstationInfo] mit der ID 0 oder ID 1 raussuchen. Die ID übergebe ich ja mit SetPVarInt(playerid, "linec1",buslinie);
Inspiriert ist dieses System von meinem bereits vorhandenem Autohaussystem
enum dealerInfo{
Float:d_x,
Float:d_y,
Float:d_z,
Float:d_r
}
enum dealercarInfo{
model,
Float:dc_x,
Float:dc_y,
Float:dc_z,
Float:dc_r,
c_price,
ah_id,
id_x
}
new dInfo[][dealerInfo] = {
{557.0468,-1261.9884,17.0489,359.2499},
{-1973.2737,302.4986,34.8973,144.3221},
{-1636.3423,1204.9303,6.9615,224.0114},
{2135.3066,-1121.4271,24.9404,260.1840},
{-2344.2195,2283.4219,-0.3001,270.0000}
};
new dcInfo[][dealercarInfo] ={
{477,541.3029,-1272.5945,17.0018,276.5305,160000,0},
{506,531.0538,-1279.7189,16.9444,245.5976,180000,0},
{541,527.4791,-1282.1392,16.8681,245.2433,245000,0},
{451,538.5888,-1286.8911,16.9384,329.7926,215000,0},
{415,543.2477,-1287.0684,17.0146,330.0099,215000,0},
{429,549.4346,-1282.2029,16.9242,45.5237,235000,0},
{411,554.9614,-1282.0664,16.9763,47.4740,250000,0},
{558,-1953.6899,299.7094,40.6796,59.6099,60000,1},
{560,-1953.9619,292.8849,40.7580,122.4033,90000,1},
{602,-1956.4889,262.2754,40.8539,340.7159,80000,1},
{561,-1947.6492,270.5701,40.8673,121.4072,35000,1},
{458,-1946.5969,256.9943,40.9256,31.1106,30000,1},
{587,-1955.9135,299.2500,35.1931,122.1016,70000,1},
{562,-1948.2290,256.8454,35.1282,50.8513,80000,1},
{565,-1946.3008,264.3329,35.0962,80.6945,50000,1},
{559,-1946.9475,273.1875,35.1312,125.5180,95000,1},
{508,-1676.9236,1208.2162,21.5321,244.6534,45000,2},
{409,-1660.5477,1210.8756,20.9572,325.5594,200000,2},
{424,-1663.1184,1222.0819,20.9371,195.9398,50000,2},
{442,-1649.7162,1206.9401,20.9790,282.0497,50000,2},
{546,-1677.9932,1208.1829,13.3971,243.2681,20000,2},
{426,-1664.5753,1224.3408,13.4193,201.2205,35000,2},
{550,-1659.5996,1217.7181,13.4894,339.2775,30000,2},
{547,-1657.0798,1211.7637,13.4123,290.5632,20000,2},
{551,-1648.7928,1207.5220,13.4678,68.9961,20000,2},
{540,-1657.5420,1214.5105,7.1145,267.1867,22000,2},
{462,2135.7932,-1134.5253,25.2950,68.3711,22000,3},
{586,2118.2900,-1135.0996,24.7416,311.0427,22000,3},
{468,2136.9927,-1129.2795,25.2884,103.1719,22000,3},
{462,2126.0593,-1130.0297,25.1065,33.0627,22000,3},
{581,2123.2844,-1137.8687,24.8146,320.6566,22000,3},
{522,2123.6748,-1146.0350,24.2052,316.2347,22000,3},
{521,2131.2915,-1141.7277,24.6563,36.5554,22000,3},
{461,2136.4080,-1140.1373,24.9229,29.4827,22000,3},
{446,-2371.7278,2305.4863,-0.3001,270.0000,750000,4},
{452,-2359.1152,2309.7383,-0.3001,180.0000,650000,4},
{454,-2377.1187,2314.9712,-0.3001,270.0000,1500000,4},
{484,-2349.1306,2309.8010,-0.3001,180.0000,2500000,4},
{493,-2380.3813,2303.5715,-0.3001,180.0000,1000000,4}
};
public OnGameModeInit()
{
for(new i=0; i<sizeof(dcInfo); i++)
{
dcInfo[i][id_x]=AddStaticVehicle(dcInfo[i][model],dcInfo[i][dc_x],dcInfo[i][dc_y],dcInfo[i][dc_z],dcInfo[i][dc_r],-1,-1);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate==PLAYER_STATE_ONFOOT && newstate==PLAYER_STATE_DRIVER)
{
new vID = GetPlayerVehicleID(playerid);
new vModel = GetVehicleModel(vID);
new str[128];
format(str, sizeof(str), "%s",CarName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
for(new i=0; i<sizeof(dcInfo); i++)
{
if(dcInfo[i][id_x]!=vID)continue;
SetPVarInt(playerid,"buyCarID",i);
new string[256];
format(string,sizeof(string),"Möchtest du dieses Fahrzeug für %i $ kaufen?",dcInfo[i][c_price]);
ShowPlayerDialog(playerid,DIALOG_CARDEAL,DIALOG_STYLE_MSGBOX,str,string,"Kaufen","Austeigen");
break;
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_CARDEAL)
{
if(response)
{
new id=GetPVarInt(playerid,"buyCarID");
if(pInfo[playerid][money]<dcInfo[id][c_price])
{
SendClientMessage(playerid,COLOR_RED,"((Info)) Du hat nicht genug Geld, um dir dieses Auto kaufen zu können!");
RemovePlayerFromVehicle(playerid);
return 1;
}
pInfo[playerid][money]-=dcInfo[id][c_price];
createPlayerCar(playerid,dcInfo[id][model],dInfo[dcInfo[id][ah_id]][d_x],dInfo[dcInfo[id][ah_id]][d_y],dInfo[dcInfo[id][ah_id]][d_z],dInfo[dcInfo[id][ah_id]][d_r]);
SendClientMessage(playerid,COLOR_GREEN,"((Info)) Herzlichen Glückwunsch! Du hast dir soeben ein neues Auto gekauft!");
RemovePlayerFromVehicle(playerid);
}
else
{
RemovePlayerFromVehicle(playerid);
}
return 1;
}
return 1;
}