Hei,ich habe ein Kleines Fraktionautohaus...
Jedoch habe ich ein Problem und eine Frage:
Problem: Wenn ich mir z.B einen maverick kaufe Spawnen gleich ca. 100
Frage: Wie mach ich das die Geladenen Cars dan auch z.B Ballascar[] sind ?
Hier Mein system:
ocmd:fkaufen(playerid,params[])
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(IsFrakautohauscar(vehicle))
{
SendClientMessage(playerid,ORANGE,"Test!");
FraktionAutoKaufen(vehicle, playerid);
}
stock FraktionAutoKaufen(vehicle, playerid)
{
new pfad[50];
for(new car=1;car<MAX_FRAKCARS;car++)
{
if(PlayerInfo[playerid][pLeader] == 1){format(pfad,50,"/Fraktionautos/SF8/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 2){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 3){format(pfad,50,"/Fraktionautos/LSPD/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 4){format(pfad,50,"/Fraktionautos/Secret-Service/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 5){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 6){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 7){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 8){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 9){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 10){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 11){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 12){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 13){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 14){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 15){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 16){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 17){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 18){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(!fexist(pfad))
{
new modelid;
modelid = GetVehicleModel(vehicle);
dini_Create(pfad);
dini_IntSet(pfad,"modelid",modelid);
dini_FloatSet(pfad,"x",2135.2720);
dini_FloatSet(pfad,"y",1446.8075);
dini_FloatSet(pfad,"z",11.9996);
dini_FloatSet(pfad,"rot",0.00);
dini_IntSet(pfad,"farbe1",0);
dini_IntSet(pfad,"farbe2",0);
dini_IntSet(pfad,"respawntime",-1);
return LoadFrakCars(vehicle);
}
}
return 1;
}
stock LoadFrakCars(car)
{
new pfad[50];
format(pfad,50,"/Fraktionautos/FBI/1.txt",car);
if(!fexist(pfad))return 0;
FrakcarInfo[car][car_model] = dini_Int(pfad,"modelid");
FrakcarInfo[car][car_x] = dini_Float(pfad,"x");
FrakcarInfo[car][car_y] = dini_Float(pfad,"y");
FrakcarInfo[car][car_z] = dini_Float(pfad,"z");
FrakcarInfo[car][car_rot] = dini_Float(pfad,"rot");
FrakcarInfo[car][car_farbe1] = dini_Int(pfad,"farbe1");
FrakcarInfo[car][car_farbe2] = dini_Int(pfad,"farbe2");
FrakcarInfo[car][car_respawntime] = dini_Int(pfad,"respawntime");
AddStaticVehicleEx(FrakcarInfo[car][car_model],FrakcarInfo[car][car_x],FrakcarInfo[car][car_y],FrakcarInfo[car][car_z],FrakcarInfo[car][car_rot],FrakcarInfo[car][car_farbe1],FrakcarInfo[car][car_farbe2],FrakcarInfo[car][car_respawntime]);
return 1;
}
{
new pfad[50];
for(new car=1;car<MAX_FRAKCARS;car++)
{
if(PlayerInfo[playerid][pLeader] == 1){format(pfad,50,"/Fraktionautos/SF8/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 2){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 3){format(pfad,50,"/Fraktionautos/LSPD/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 4){format(pfad,50,"/Fraktionautos/Secret-Service/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 5){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 6){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 7){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 8){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 9){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 10){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 11){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 12){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 13){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 14){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 15){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 16){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 17){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(PlayerInfo[playerid][pLeader] == 18){format(pfad,50,"/Fraktionautos/FBI/%d.txt",car); }
if(!fexist(pfad))
{
new modelid;
modelid = GetVehicleModel(vehicle);
dini_Create(pfad);
dini_IntSet(pfad,"modelid",modelid);
dini_FloatSet(pfad,"x",2135.2720);
dini_FloatSet(pfad,"y",1446.8075);
dini_FloatSet(pfad,"z",11.9996);
dini_FloatSet(pfad,"rot",0.00);
dini_IntSet(pfad,"farbe1",0);
dini_IntSet(pfad,"farbe2",0);
dini_IntSet(pfad,"respawntime",-1);
return LoadFrakCars(vehicle);
}
}
return 1;
}
stock LoadFrakCars(car)
{
new pfad[50];
format(pfad,50,"/Fraktionautos/FBI/1.txt",car);
if(!fexist(pfad))return 0;
FrakcarInfo[car][car_model] = dini_Int(pfad,"modelid");
FrakcarInfo[car][car_x] = dini_Float(pfad,"x");
FrakcarInfo[car][car_y] = dini_Float(pfad,"y");
FrakcarInfo[car][car_z] = dini_Float(pfad,"z");
FrakcarInfo[car][car_rot] = dini_Float(pfad,"rot");
FrakcarInfo[car][car_farbe1] = dini_Int(pfad,"farbe1");
FrakcarInfo[car][car_farbe2] = dini_Int(pfad,"farbe2");
FrakcarInfo[car][car_respawntime] = dini_Int(pfad,"respawntime");
AddStaticVehicleEx(FrakcarInfo[car][car_model],FrakcarInfo[car][car_x],FrakcarInfo[car][car_y],FrakcarInfo[car][car_z],FrakcarInfo[car][car_rot],FrakcarInfo[car][car_farbe1],FrakcarInfo[car][car_farbe2],FrakcarInfo[car][car_respawntime]);
return 1;
}