Hallo wenn ich die Fahrzeuge um Parke (Fraktions Fahrzeuge) und dann Relog mache Spawnen die Fahrzeuge alle in der Mitte
if (strcmp(cmd, "/bparken", true) ==0 || strcmp(cmdtext, "/bpark", true)==0){
if(!IsPlayerInAnyVehicle(playerid)) return 1;
if (GetPlayerState(playerid) != 2){
SendClientMessage(playerid, COLOR_RED, "Du musst der Fahrer sein, um diesen Befehl benutzen zu können!");
return 1;
}
if(VehicleSystem[GetPlayerVehicleID(playerid)][nn_sperre] == 1){
SendClientMessage(playerid, COLOR_RED, "Dieses Fraktionsfahrzeug ist gesperrt!");
return 1;
}
if(PlayerInfo[playerid][Team] == 0){
SendClientMessage(playerid, COLOR_RED,"Du bist in keiner Fraktion");
return 1;
}
if(PlayerInfo[playerid][Leader] == 0){
SendClientMessage(playerid, COLOR_RED,"Du bist kein Leader einer Fraktion");
return 1;
}
if(DFraktion[PlayerInfo[playerid][Team]][bpark] == 0){
SendClientMessage(playerid, COLOR_RED, "Deine Fraktion hat nicht die Berechtigung dazu!");
return 1;
}
new carids;
new vehicleid = GetPlayerVehicleID(playerid);
new sql[256];
if(PlayerInfo[playerid][Leader] == PlayerInfo[playerid][Team]){
if(VehicleSystem[vehicleid][fraktion] == PlayerInfo[playerid][Leader]){
carids = VehicleSystem[vehicleid][fraksid];
new Float:vx,Float:vy,Float:vz,Float:va, aamodel, kasu;
GetVehiclePos(vehicleid,vx,vy,vz);
GetVehicleZAngle(vehicleid,va);
aamodel = GetVehicleModel(vehicleid);
new world = GetPlayerVirtualWorld(playerid);
format(sql, sizeof(sql), "UPDATE server_frakcars SET `posX` = '%f', `posY` = '%f', `posZ` = '%f', `posR` = '%f', world = '%d' WHERE id = '%d'", vx, vy, vz, va, world, carids);
mysql_query(sql);
SendClientMessage(playerid, COLOR_GREEN,"Fahrzeug (um)geparkt");
for(new i = 0; i < MAX_PLAYERS; i ++) {
if(IsPlayerConnected(i)) {
if (PlayerInfo[playerid][Team] == PlayerInfo[i][Team] ) {
format(string, sizeof(string), "%s parkt ein Fraktionsfahrzeug um. F-Nummer: %d",PlayerName(playerid), VehicleSystem[vehicleid][fraksid]);
SendClientMessage(i, TEAM_AZTECAS_COLOR, string);
}
}
}
printf("%s", string);
VehicleSystem[vehicleid][fraktion] = 0;
VehicleSystem[vehicleid][fraksid] = 0;
DestroyVehicle3(vehicleid);
VehicleSystem[vehicleid][faaktiv] = 0;
kasu = CreateVehicle2(aamodel, vx, vy, vz, va, VehicleSystem[vehicleid][farr1], VehicleSystem[vehicleid][farr2], SPAWN_CAR);
SetVehicleVirtualWorld(kasu, world);
VehicleSystem[kasu][cSpawnWorld] = world;
VehicleSystem[kasu][fraktion] = PlayerInfo[playerid][Leader];
VehicleSystem[kasu][fraksid] = carids;
VehicleSystem[kasu][owner] = MafiaNamen[PlayerInfo[playerid][Leader]];
VehicleSystem[kasu][akku] = 10;
PutPlayerInVehicleM(playerid, kasu, 0);
SetPlayerArmedWeapon(playerid, 0);
SetTimerEx("NOWEP", 1000, 0, "d", playerid);
VehicleSystem[kasu][farr1] = VehicleSystem[vehicleid][farr1];
VehicleSystem[kasu][farr2] = VehicleSystem[vehicleid][farr1];
VehicleSystem[kasu][Benzin] = get_MaxGasFullTank(kasu);
GetVehicleParamsEx(kasu,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(kasu,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
}
return 1;
}