Hallo Zusammen,
Ich habe ein Problem mit dem Autohaus man kann sich kein auto kaufen dort steht "maximale anzahl an Privatfahrzeugen erreicht" obwohl ich nicht mal ein Auto habe und dann noch wenn man das kurz raus nimmt mit privatfahrzeugen maximalanzahl dann kann man sich ja welche kaufen aber egal wie viele das wollen wir ja nicht.. und dann Speichert das Auto nicht in der Datenbank und immer wenn man sich einloggt hat man bei /carinfo ein Stratum wenn man noch keins gekauft hat
Code:
PHP
enum ahCar
{
Carid,
OwnerID,
Typ,
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:z_angle,
Status,
Lock,
Paintjob,
Farbe1,
Farbe2,
mod1,
mod2,
mod3,
mod4,
mod5,
mod6,
mod7,
mod8,
mod9,
mod10,
mod11,
mod12,
mod13,
mod14,
mod15,
mod16,
mod17,
Float:SpawnSaveX,
Float:SpawnSaveY,
Float:SpawnSaveZ,
Float:SpawnSaveRot,
Float:TankVolumen,
Float:KiloMeter,
Meter,
AH_Abgeschleppt,
AH_Abgeschlepptname,
AH_Abgeschlepptzeit,
AH_Abgeschlepptpreis,
AH_Motorschaden,
};
new Carlist[MAX_PLAYERS][3][ahCar];
new MaxVeh[MAX_PLAYERS];
enum ahSpawn
{
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:z_angle,
};
new Autospawns[7][ahSpawn] =
{
{1198.7744,-1834.0280,13.3933,270.0},
{1620.6758, -1319.6353, 16.9044,0.0},
{2217.1833,1420.9259,14.1,90.1},
{2147.6760,-1157.4119,23.5502,270.0},
{-2502.2808,1195.3693,40.1,282.1},
{2148.2312,-1157.4254,30.0,270.1},
{2148.2312,-1157.4254,30.0,270.1}
};
enum ahModell
{
Autohaus,
Name[128],
Modelid,
Preis,
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:z_angle,
Autolevel,
Carid,
};
new Kaufliste[92][ahModell] =
{
//Fahrzeugname,Autohaus,Modelid,Carid,Preis,Reppreis,x,y,z,z_angel,level
{0,"Stratum",561,30000,1279.7844,-1800.6394,13.1676,56.8819,5,-1},
{0,"Slamvan",535,35000,1279.9872,-1804.3492,13.1441,56.1564,4,-1},
{0,"Remington",534,25000,1279.5415,-1808.0443,13.1220,56.2476,3,-1},
{0,"Voodoo",412,50000,1279.2413,-1811.4188,13.2205,58.1607,2,-1},
{0,"Feltzer",533,30500,1279.8131,-1815.6072,13.1073,62.1538,3,-1},
{0,"Savanna",567,88000,1279.4025,-1819.2769,13.2898,60.7807,4,-1},
{0,"Windsor",555,90000,1280.3005,-1823.5054,13.0967,59.3672,3,-1},
{0,"Blade",536,12000,1279.4652,-1826.4945,13.1105,60.1778,2,-1},
{0,"Huntley",579,30000,1279.6381,-1830.5081,13.2736,61.9526,6,-1},
{0,"Mesa",500,24000,1280.0411,-1834.4298,13.5158,66.0782,5,-1},
{0,"Fortune",526,20000,1279.7028,-1796.1798,13.1469,62.3256,3,-1},
{0,"Freeway",463,16000,1238.3553,-1815.1594,12.9628,245.0638,3,-1},
{0,"Sanchez",468,18000,1237.9779,-1817.2621,13.0852,238.0622,3,-1},
{0,"Faggio",462,5000,1237.6866,-1819.6456,13.0101,227.1782,1,-1},
{0,"Clover",542,20000,1257.9854,-1833.8541,13.1311,332.8192,1,-1},
{0,"Glendale",466,5000,1253.8921,-1833.8160,13.1316,332.9895,2,-1},
{0,"Banshee",429,260000,1249.4163,-1833.9287,13.0673,334.0308,6,-1},
{0,"Sultan",560,80000,1244.9237,-1834.3491,13.0940,328.3795,6,-1},
{0,"Patriot",470,80000,1244.6635,-1810.5121,13.4168,204.3302,7,-1},
{0,"Flash",565,300000,1248.4609,-1807.8080,13.0358,215.7912,6,-1},
{0,"Alpha",602,100000,1252.2128,-1805.4340,13.2252,214.2724,2,-1},
{0,"Sunrise",550,90000,1255.8724,-1803.1240,13.2397,227.7115,3,-1},
{0,"Vincent",540,80000,1258.1085,-1800.0142,13.2930,236.6056,2,-1},
{0,"Elegy",562,40000,1259.7440,-1796.3119,13.0572,237.1471,4,-1},
{0,"Manana",410,15000,1268.9276,-1794.8065,13.3984,89.2459,1,-1},
{1,"Blista Compact",496,4000,1658.5516, -1319.5526, 17.1533, 180.0000,3,-1},
{1,"Buffalo",402,285000,1688.6694, -1345.0376, 17.1278, 90.0000,8,-1},
{1,"Bullet",541,315000,1688.6694, -1350.0385, 17.1278, 90.0000,9,-1},
{1,"Cheetah",415,300000,1688.6694, -1340.4288, 17.1278, 90.0000,9,-1},
{1,"Club",589,35000,1654.8309, -1319.5526, 17.1533, 180.0000,4,-1},
{1,"Euros",587,200000,1662.1489, -1319.5526, 17.1533, 180.0000,5,-1},
{1,"Infernus",411,350000,1688.6694, -1330.8474, 17.1278, 90.0000,10,-1},
{1,"Jester",559,200000,1688.6694, -1335.6604, 17.1278, 90.0000,3,-1},
{1,"Phoenix",603,26000,1653.9594, -1330.8474, 17.2363, 270.0000,4,-1},
{1,"Super GT",506,290000, 1653.9594, -1335.6604, 16.9764, 270.0000,9,-1},
{1,"Turismo",451,325000,1653.9594, -1345.0376, 16.9764, 270.0000,10,-1},
{1,"Premier",426,200000,1653.9594, -1350.0385, 17.0412, 270.0000,6,-1},
{1,"ZR-350",477,175000,1653.9594, -1340.4288, 17.0874, 270.0000,5,-1},
{1,"PCJ-600",461,200000,1682.2719,-1318.9880,17.0379, 160.000,7,-1},
{1,"FCR-900",521,200000,1680.2645,-1318.8717,17.0471, 160.0000,7,-1},
{1,"BF-400",581,200000,1684.9094,-1319.2750,17.0153, 160.0000,7,-1},
{2,"Mower",572,50000,2145.7375,1399.1079,10.3926,180.1,3,-1},
{2,"Quad",471,50000,2139.0044,1398.7233,10.2785,180.1,2,-1},
{2,"Kart",571,100000,2132.9026,1398.6613,10.1022,180.1,6,-1},
{2,"Caddy",457,50000,2126.3518,1398.6478,10.4298,180.1,5,-1},
{2,"Camper",483,70000,2151.6248,1398.0774,10.8088,180.1,3,-1},
{2,"Hotknife",434,150000,2126.3159,1407.8312,10.7936,0.1,10,-1},
{2,"BF Injection",424,400000,2120.1184,1408.3947,10.5944,0.1,5,-1},
{2,"Bandito",568,60000,219.8989,1399.2928,10.6762,180.1,6,-1},
{2,"Mountain Bike",510,1,2132.8442,1408.3944,11.2474,0.1,1,-1},
{2,"Vortex",539,150000,2139.0022,1408.6088,10.8161,0.1,2,-1},
{2,"Hotring A",502,1000000,2145.6438,1409.0603,10.7136,0.1,12,-1},
{2,"Sandking",495,250000,2151.8958,1407.6707,11.1689,0.1,4,-1},
{3,"Tampa",549,25000,2118.4197,-1145.2118,24.2614,263.4678,4,-1},
{3,"Perenniel",404,31000,2118.8809,-1141.1678,24.6702,261.3519,4,-1},
{3,"Comet",480,35000,2118.8523,-1136.8408,24.9428,265.1098,4,-1},
{3,"Majestic",517,24000,2119.1660,-1132.5302,25.1466,269.2719,4,-1},
{3,"Sabre",475,20000,2119.2268,-1128.3412,25.1729,269.0081,4,-1},
{3,"Bobcat",422,26000,2119.6328,-1123.8883,25.3762,266.5765,4,-1},
{3,"Hermes",474,30000,2161.8550,-1152.9042,23.6991,89.2034,4,-1},
{3,"Virgo",491,15000,2161.9241,-1158.2540,23.5956,91.0091,4,-1},
{3,"Tahoma",566,29000,2161.6514,-1163.2643,23.6010,90.5704,4,-1},
{3,"Emperor",585,24000,2161.7988,-1167.9106,23.4063,89.9135,4,-1},
{3,"Solair",458,30000,2161.7898,-1172.9202,23.6985,90.4139,4,-1},
{3,"Rancher",489,40000,2162.0647,-1178.0060,23.9625,89.2404,4,-1},
{3,"Greenwood",492,50000,2162.0952,-1182.3607,23.5993,90.9639,4,-1},
{3,"Fortune",526,40000,2162.3328,-1187.4722,23.5864,89.9645,4,-1},
{4,"Maverick",487,2500000,2103.1494,1437.4559,10.8203,211.0000,7,-1},
{2,"Limousine",409,1000000,2117.7676,1399.5448,10.6163,90.2126,10,-1},
{6,"Sultan",560, 150000, -2273.5811,-152.0925,35.0292,126.3187, 1, -1},//Wert 71
{6,"Elegy",562, 120000, -2297.6001, -176.3837, 34.9539, 45.0, 1, -1},
{6,"Stratum",561, 50000, -2292.1655, -176.1162, 35.0344, 45.0, 1, -1},
{6,"Jester",559, 130000, -2298.4331, -145.3361, 34.8833, 135.0000, 1, -1},
{6,"Uranus",558, 90000, -2294.3303, -145.3361, 34.8833, 135.0000, 1, -1},
{6,"Windsor",555, 70000, -2290.5281, -145.3361, 34.9592, 135.0000, 1, -1},
{6,"Yosemite",554, 80000, -2286.4207, -145.3361, 35.3085, 135.0000, 1, -1},
{6,"Tampa",549, 30000, -2282.1565, -145.3361, 35.0015, 135.0000, 1, -1},
{6,"Primo",547, 25000, -2277.8093, -145.3361, 34.9525, 135.0000, 1, -1},
{6,"Sadler",543, 20000, -2273.4707, -145.3361, 35.1025, 135.0000, 1, -1},
{6,"PCJ-600",461, 90000, -2283.5137, -176.0727, 39.1842, -45.0000, 1, -1},
{6,"FCR-900",521, 100000, -2286.4700, -175.9212, 39.2162, -45.0000, 1, -1},
{6,"Stafford",580, 80000, -2291.9580, -175.6868, 39.4196, -45.0000, 1, -1},
{6,"Tahoma",566, 50000, -2297.8035, -175.9512, 39.4196, -45.0000, 1, -1},
{6,"Sanchez",468, 25000, -2284.3572, -157.1387, 39.3671, -45.0000, 1, -1},
{6,"Blade",536, 45000,-2297.4817, -167.5811, 39.4196, -45.0000, 1, -1},
{6,"Feltzer",533, 55000,-2297.4817, -154.2146, 39.4196, -135.0000, 1, -1},
{6,"Washington",421, 45000,-2297.3481, -147.2706, 39.5700, 225.0000, 1, -1},
{6,"Savanna",567, 35000,-2290.3474, -147.2706, 39.5700, 225.0000, 1, -1},
{6,"Slamvan",535, 40000,-2283.5271, -147.2706, 39.5700, 225.0000, 1, -1},
{6,"Voodoo",412, 30000,-2275.9395, -147.2706, 39.5700, 225.0000, 1, -1},
{6,"Sentinel",405, 60000,-2274.3159, -166.3387, 39.5700, 45.0000, 1, -1},
{6,"Limousine",409, 500000,-2280.8999, -167.1196, 39.3600, 45.0000, 1, -1}
};
forward PlayerCarConnect(playerid);
public PlayerCarConnect(playerid){
if(IsPlayerNPC(playerid)) return 1;
new string[258],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
format(string, sizeof(string),"SELECT * FROM `usercars` WHERE `SQLID` = '%d' AND `Slot` = '%d'", PlayerInfo[playerid][pSQLID], h);
self_mysql_queryEx(string);
mysql_store_result();
new val[ 256 ], Variable;
while(mysql_fetch_row_format(string,"|"))
{
self_mysql_get_field("AH_Typ", val); Carlist[playerid][h][Typ] = strval( val );
self_mysql_get_field("AH_X", val); Carlist[playerid][h][pos_x] = strval( val );
self_mysql_get_field("AH_Y", val); Carlist[playerid][h][pos_y] = strval( val );
self_mysql_get_field("AH_Z", val); Carlist[playerid][h][pos_z] = strval( val );
self_mysql_get_field("AH_Rot", val); Carlist[playerid][h][z_angle] = strval( val );
self_mysql_get_field("AH_Status", val); Carlist[playerid][h][Status] = strval( val );
self_mysql_get_field("AH_Lock", val); Carlist[playerid][h][Lock] = strval( val );
self_mysql_get_field("AH_Paintjob", val); Carlist[playerid][h][Paintjob] = strval( val );
self_mysql_get_field("AH_Farbe1", val); Carlist[playerid][h][Farbe1] = strval( val );
self_mysql_get_field("AH_Farbe2", val); Carlist[playerid][h][Farbe2] = strval( val );
self_mysql_get_field("AH_mod1", val); Carlist[playerid][h][mod1] = strval( val );
self_mysql_get_field("AH_mod2", val); Carlist[playerid][h][mod2] = strval( val );
self_mysql_get_field("AH_mod3", val); Carlist[playerid][h][mod3] = strval( val );
self_mysql_get_field("AH_mod4", val); Carlist[playerid][h][mod4] = strval( val );
self_mysql_get_field("AH_mod5", val); Carlist[playerid][h][mod5] = strval( val );
self_mysql_get_field("AH_mod6", val); Carlist[playerid][h][mod6] = strval( val );
self_mysql_get_field("AH_mod7", val); Carlist[playerid][h][mod7] = strval( val );
self_mysql_get_field("AH_mod8", val); Carlist[playerid][h][mod8] = strval( val );
self_mysql_get_field("AH_mod9", val); Carlist[playerid][h][mod9] = strval( val );
self_mysql_get_field("AH_mod10", val); Carlist[playerid][h][mod10] = strval( val );
self_mysql_get_field("AH_mod11", val); Carlist[playerid][h][mod11] = strval( val );
self_mysql_get_field("AH_mod12", val); Carlist[playerid][h][mod12] = strval( val );
self_mysql_get_field("AH_mod13", val); Carlist[playerid][h][mod13] = strval( val );
self_mysql_get_field("AH_mod14", val); Carlist[playerid][h][mod14] = strval( val );
self_mysql_get_field("AH_mod15", val); Carlist[playerid][h][mod15] = strval( val );
self_mysql_get_field("AH_mod16", val); Carlist[playerid][h][mod16] = strval( val );
self_mysql_get_field("AH_mod17", val); Carlist[playerid][h][mod17] = strval( val );
self_mysql_get_field("AH_SpawnSaveX", val); Carlist[playerid][h][SpawnSaveX] = strval( val );
self_mysql_get_field("AH_SpawnSaveY", val); Carlist[playerid][h][SpawnSaveY] = strval( val );
self_mysql_get_field("AH_SpawnSaveZ", val); Carlist[playerid][h][SpawnSaveZ] = strval( val );
self_mysql_get_field("AH_SpawnSaveRot", val); Carlist[playerid][h][SpawnSaveRot] = strval( val );
self_mysql_get_field("AH_TankVolumen", val); Carlist[playerid][h][TankVolumen] = strval( val );
self_mysql_get_field("AH_Meter", val); Carlist[playerid][h][Meter] = strval( val );
self_mysql_get_field("AH_Kilometer", val); Carlist[playerid][h][KiloMeter] = strval( val );
self_mysql_get_field("AH_Abgeschleppt", val); Carlist[playerid][h][AH_Abgeschleppt] = strval( val );
self_mysql_get_field("AH_Abgeschlepptname", val); strmid(Carlist[playerid][h][AH_Abgeschlepptname], val, 0, strlen(val), 255);//Carlist[playerid][h][AH_Abgeschlepptname] = strval( val );
self_mysql_get_field("AH_Abgeschlepptzeit", val); strmid(Carlist[playerid][h][AH_Abgeschlepptzeit], val, 0, strlen(val), 255);//Carlist[playerid][h][AH_Abgeschlepptzeit] = strval( val );
self_mysql_get_field("AH_AbgeschlepptPreis", val); Carlist[playerid][h][AH_Abgeschlepptpreis] = strval( val );
self_mysql_get_field("AH_Motorschaden", val); Carlist[playerid][h][AH_Motorschaden] = strval( val );
self_mysql_get_field("AH_Neon", val); Variable = strval( val );
mysql_free_result();
}
if(Carlist[playerid][h][Typ] != -1 && Carlist[playerid][h][Status] == 0)
{
Carlist[playerid][h][Carid] = CreateTunedCar(playerid, h);
NeonObject[Carlist[playerid][h][Carid]][3] = Variable;
if(NeonObject[Carlist[playerid][h][Carid]][3] != -1)
{
NeonObject[Carlist[playerid][h][Carid]][1] = CreateDynamicObjectEx(NeonObject[Carlist[playerid][h][Carid]][3], 0, 0, 0, 0, 0, 0);
NeonObject[Carlist[playerid][h][Carid]][2] = CreateDynamicObjectEx(NeonObject[Carlist[playerid][h][Carid]][3], 0, 0, 0, 0, 0, 0);
AttachDynamicObjectToVehicle(NeonObject[Carlist[playerid][h][Carid]][1], Carlist[playerid][h][Carid], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachDynamicObjectToVehicle(NeonObject[Carlist[playerid][h][Carid]][2], Carlist[playerid][h][Carid], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
}
}
}
return 1;
}
forward PlayerCarUpdate(playerid);
public PlayerCarUpdate(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
new endstring[4000];
new var[129];
format(endstring, sizeof(endstring), "UPDATE `usercars` SET ");
format(var, sizeof(var), "`AH_Typ`='%d', ", Carlist[playerid][h][Typ]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_X`='%f', ", Carlist[playerid][h][pos_x]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Y`='%f', ", Carlist[playerid][h][pos_y]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Z`='%f', ", Carlist[playerid][h][pos_z]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Rot`='%f', ", Carlist[playerid][h][z_angle]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Kilometer`='%f', ", Kilometerstand[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Status`='%d', ", Carlist[playerid][h][Status]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Lock`='%d', ", Carlist[playerid][h][Lock]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Paintjob`='%d', ", Carlist[playerid][h][Paintjob]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Farbe1`='%d', ", Carlist[playerid][h][Farbe1]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Farbe2`='%d', ", Carlist[playerid][h][Farbe2]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod1`='%d', ", Carlist[playerid][h][mod1]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod2`='%d', ", Carlist[playerid][h][mod2]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod3`='%d', ", Carlist[playerid][h][mod3]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod4`='%d', ", Carlist[playerid][h][mod4]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod5`='%d', ", Carlist[playerid][h][mod5]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod6`='%d', ", Carlist[playerid][h][mod6]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod7`='%d', ", Carlist[playerid][h][mod7]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod8`='%d', ", Carlist[playerid][h][mod8]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod9`='%d', ", Carlist[playerid][h][mod9]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod10`='%d', ", Carlist[playerid][h][mod10]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod11`='%d', ", Carlist[playerid][h][mod11]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod12`='%d', ", Carlist[playerid][h][mod12]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod13`='%d', ", Carlist[playerid][h][mod13]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod14`='%d', ", Carlist[playerid][h][mod14]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod15`='%d', ", Carlist[playerid][h][mod15]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod16`='%d', ", Carlist[playerid][h][mod16]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_mod17`='%d', ", Carlist[playerid][h][mod17]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_SpawnSaveX`='%f', ", Carlist[playerid][h][SpawnSaveX]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_SpawnSaveY`='%f', ", Carlist[playerid][h][SpawnSaveY]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_SpawnSaveZ`='%f', ", Carlist[playerid][h][SpawnSaveZ]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_SpawnSaveRot`='%f', ", Carlist[playerid][h][SpawnSaveRot]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_TankVolumen`='%f', ", Gas[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Meter`='%d', ", Carlist[playerid][h][Meter]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Neon`='%d', ", NeonObject[Carlist[playerid][h][Carid]][3]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Abgeschleppt`='%d', ", CarAbgeschleppt[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Abgeschlepptname`='%s', ", CarAbgeschlepptName[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Abgeschlepptzeit`='%s', ", CarAbgeschlepptZeit[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_AbgeschlepptPreis`='%d', ", CarAbgeschlepptPreis[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "`AH_Motorschaden`='%d' ", Motorschaden[Carlist[playerid][h][Carid]]);
strcat(endstring, var);
format(var, sizeof(var), "WHERE `SQLID`='%d' AND `Slot`='%d'", PlayerInfo[playerid][pSQLID], h);
strcat(endstring, var);
mysql_query(endstring);
}
return 1;
}
forward PlayerCarDisconnect(playerid);
public PlayerCarDisconnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
PlayerCarUpdate(playerid);
for(new h = 0; h < MaxVeh[playerid]; h++)
{
if(Carlist[playerid][h][Carid] != -1)
{
//Carlist[playerid][h][TankVolumen] = Gas[Carlist[playerid][h][Carid]];
//Carlist[playerid][h][KiloMeter] = Kilometerstand[Carlist[playerid][h][Carid]];
DestroyVehicleSelfmade(Carlist[playerid][h][Carid]);
Carlist[playerid][h][Carid] = -1;
}
}
if(Spectating[playerid] != -1)
{
ForAllPlayers(i)
{
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid],i,0,0);
}
Spectating[playerid] = -1;
}
return 1;
}
if(dialogid == DIALOG_AUTOHAUS){
new FreeSlot = -1;
if(!response){
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
}}
RemovePlayerFromVehicle(playerid);
}
if(response){
new preis = Kaufliste[Spectating[playerid]][Preis];
{
if(PlayerInfo[playerid][pKreditkarte] == 1 && PlayerInfo[playerid][pKreditkartebenutzen] == 1)
{
if(Kaufliste[Spectating[playerid]][Autolevel]-1 >= PlayerInfo[playerid][pLevel]){
format(string, sizeof(string), "Du hast nicht das Benötigte Level für das Fahrzeug (benötigt: %d)", Kaufliste[Spectating[playerid]][Autolevel]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
}}
RemovePlayerFromVehicle(playerid);
return 1;
}
if(preis < PlayerInfo[playerid][pBank])
{
PlayerInfo[playerid][pKreditkartenkosten] += preis;
SendClientMessage(playerid,COLOR_YELLOW,"Du hast erfolgreich mit deiner Kreditkarte bezahlt, der Betrag wird beim Payday abgebucht.");
}
else
{
format(string, sizeof(string), "Du hast nicht genug Geld für das Auto (benötigt: $%i)", preis);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
ForAllPlayers(i)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
}
}
RemovePlayerFromVehicle(playerid);
return 1;
}
}else{
if(Kaufliste[Spectating[playerid]][Autolevel]-1 >= PlayerInfo[playerid][pLevel]){
format(string, sizeof(string), "Du hast nicht das Benötigte Level für das Fahrzeug (benötigt: %d)", Kaufliste[Spectating[playerid]][Autolevel]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
}}
RemovePlayerFromVehicle(playerid);
return 1;
}
if(preis <= PlayerInfo[playerid][pCash])
{
GivePlayerMoneys(playerid, - preis);
}
else
{
format(string, sizeof(string), "Du hast nicht genug Geld für das Auto (benötigt: $%i)", preis);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
}}
RemovePlayerFromVehicle(playerid);
return 1;
}
}
for(new i=0; i<MaxVeh[playerid]; i++)
{
if(Carlist[playerid][i][Typ] == -1)
{
FreeSlot=i;
break;
}
}
if(FreeSlot == -1)
{
SendClientMessage(playerid,COLOR_RED,"Du hast bereits die maximale Anzahl an Privatfahrzeugen erreicht.");
return 1;
}
new autohaus = Kaufliste[Spectating[playerid]][Autohaus];
Carlist[playerid][FreeSlot][Typ] = Spectating[playerid];
Carlist[playerid][FreeSlot][pos_x] = Autospawns[autohaus][pos_x];
Carlist[playerid][FreeSlot][pos_y] = Autospawns[autohaus][pos_y];
Carlist[playerid][FreeSlot][pos_z] = Autospawns[autohaus][pos_z];
Carlist[playerid][FreeSlot][z_angle] = Autospawns[autohaus][z_angle];
Carlist[playerid][FreeSlot][SpawnSaveX] = Autospawns[autohaus][pos_x];
Carlist[playerid][FreeSlot][SpawnSaveY] = Autospawns[autohaus][pos_y];
Carlist[playerid][FreeSlot][SpawnSaveZ] = Autospawns[autohaus][pos_z];
Carlist[playerid][FreeSlot][SpawnSaveRot] = Autospawns[autohaus][z_angle];
Carlist[playerid][FreeSlot][Status] = 0;
Carlist[playerid][FreeSlot][Lock] = 0;
Carlist[playerid][FreeSlot][Carid] = CreateTunedCar(playerid, FreeSlot);
Carlist[playerid][FreeSlot][Meter] = 0;
Kilometerstand[Carlist[playerid][FreeSlot][Carid]] = 0.00;
Gas[Carlist[playerid][FreeSlot][Carid]] = GasDaten[GetVehicleModel(Carlist[playerid][FreeSlot][Carid])-400][Tankvolumen];
SetPlayerCheckpoint(playerid,Carlist[playerid][FreeSlot][pos_x],Carlist[playerid][FreeSlot][pos_y],Carlist[playerid][FreeSlot][pos_z],10.0);
ForAllPlayers(i)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
}
}
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_GREEN,"Du hast dir erfolgreich das Fahrzeug gekauft.");
SendClientMessage(playerid,COLOR_GREEN,"Du kannst dein Fahrzeug mit (/park) parken.");
if(Kaufliste[Spectating[playerid]][Autohaus] == 2)
{
BizInfo[14][bTill] += (preis/100)*15;
ExtortionBiz(14, (preis/100)*10);
BizInfo[14][bProducts]--;
}
if(Kaufliste[Spectating[playerid]][Autohaus] == 0)
{
SBizInfo[17][sbTill] += (preis/100)*15;
ExtortionSBiz(17, (preis/100)*10);
SBizInfo[17][sbProducts]--;
}
if(Kaufliste[Spectating[playerid]][Autohaus] == 1)
{
SBizInfo[18][sbTill] += (preis/100)*15;
ExtortionSBiz(18, (preis/100)*10);
SBizInfo[18][sbProducts]--;
}
if(Kaufliste[Spectating[playerid]][Autohaus] == 3)
{
SBizInfo[19][sbTill] += (preis/100)*25;
ExtortionSBiz(19, (preis/100)*10);
SBizInfo[19][sbProducts]--;
}
Spectating[playerid] = -1;
}
}
}
Alles anzeigen
Hoffe sie können mir weiterhelfen ...