public PlayerCarSpawn(playerid,Slot)
{
if(IsPlayerConnected(playerid))
{
if(Dtc_PlayerHaveCar[playerid][Slot])
{
if(PlayerCar[playerid][Slot][CarHeal] == 0)
{
Motorschaden[PlayerCar[playerid][Slot][CarId]] = 1;
}
PlayerCar[playerid][Slot][CarId] = CreateVehicle(PlayerCar[playerid][Slot][CarModel],PlayerCar[playerid][Slot][CarPos_x],PlayerCar[playerid][Slot][CarPos_y],PlayerCar[playerid][Slot][CarPos_z],PlayerCar[playerid][Slot][CarRotate],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2], 60000);
ChangeVehicleColor(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2]);
if(PlayerCar[playerid][Slot][CarPJ] >= 0) {ChangeVehiclePaintjob(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarPJ]);}
if(PlayerCar[playerid][Slot][CarNitro] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarNitro]);}
if(PlayerCar[playerid][Slot][CarHyd] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHyd]);}
if(PlayerCar[playerid][Slot][CarWheel] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarWheel]);}
if(PlayerCar[playerid][Slot][CarAusp] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarAusp]);}
if(PlayerCar[playerid][Slot][CarSideL] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideL]);}
if(PlayerCar[playerid][Slot][CarSideR] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideR]);}
if(PlayerCar[playerid][Slot][CarFB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarFB]);}
if(PlayerCar[playerid][Slot][CarRB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRB]);}
if(PlayerCar[playerid][Slot][CarSpoiler] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSpoiler]);}
if(PlayerCar[playerid][Slot][CarRoof] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRoof]);}
if(PlayerCar[playerid][Slot][CarHood] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHood]);}
if(PlayerCar[playerid][Slot][CarVents] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarVents]);}
if(PlayerCar[playerid][Slot][CarLamps] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarLamps]);}
if(Dtc_LockOnSpawn)
{
Dtc_Carlock[PlayerCar[playerid][Slot][CarId]] = 1;
Dtc_LockCar(PlayerCar[playerid][Slot][CarId]);
}
new strings[15];
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof name);
format(str, sizeof str, "/Privatcars/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
format(strings, sizeof(strings), "%s", dini_Get(str, "Kennzeichen"));
SetVehicleNumberPlate(PlayerCar[playerid][Slot][CarId], strings);
SetVehicleToRespawn(PlayerCar[playerid][Slot][CarId]);
/*for(new x = 0; x < MaxVeh; x++)
{
PlayerCar[playerid][x][CarNumber] = strings;
}*/
if(PlayerCar[playerid][Slot][CarMotorschaden] == 1)
{
Motorschaden[PlayerCar[playerid][Slot][CarId]] = 1;
SetVehicleHealth(PlayerCar[playerid][Slot][CarId], 350);
}
if(PlayerCar[playerid][Slot][CarMotorschaden] == 0)
{
SetVehicleHealth(PlayerCar[playerid][Slot][CarId], PlayerCar[playerid][Slot][CarHeal]);
}
if(PlayerCar[playerid][Slot][Kralle] == 1)
{
Parkkralle[PlayerCar[playerid][Slot][CarId]] = 1;
}
Gas[PlayerCar[playerid][Slot][CarId]] = PlayerCar[playerid][Slot][CarTank];
if(PlayerCar[playerid][Slot][Neon]>=1)
{
if(PlayerCar[playerid][Slot][Neon] == 1)
{
new Float:x,Float:y,Float:z;
Neonrohr[playerid][Neon] = CreateObject(18648,x,y,z,0,0,0,283);
Neonrohr[playerid][Neon1] = CreateObject(18648,x,y,z,0,0,0,283);
AttachObjectToVehicle(Neonrohr[playerid][Neon], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0.8,0,-0.70,0,0,0);
AttachObjectToVehicle(Neonrohr[playerid][Neon1], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], -0.8,0,-0.70,0,0,0);
}
if(PlayerCar[playerid][Slot][Neon] == 2)
{
new Float:x,Float:y,Float:z;
Neonrohr[playerid][Neon] = CreateObject(18647,x,y,z,0,0,0,283);
Neonrohr[playerid][Neon1] = CreateObject(18647,x,y,z,0,0,0,283);
AttachObjectToVehicle(Neonrohr[playerid][Neon], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0.8,0,-0.70,0,0,0);
AttachObjectToVehicle(Neonrohr[playerid][Neon1], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], -0.8,0,-0.70,0,0,0);
}
if(PlayerCar[playerid][Slot][Neon] == 3)
{
new Float:x,Float:y,Float:z;
Neonrohr[playerid][Neon] = CreateObject(18649,x,y,z,0,0,0,283);
Neonrohr[playerid][Neon1] = CreateObject(18649,x,y,z,0,0,0,283);
AttachObjectToVehicle(Neonrohr[playerid][Neon], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0.8,0,-0.70,0,0,0);
AttachObjectToVehicle(Neonrohr[playerid][Neon1], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], -0.8,0,-0.70,0,0,0);
}
if(PlayerCar[playerid][Slot][Neon] == 4)
{
new Float:x,Float:y,Float:z;
Neonrohr[playerid][Neon] = CreateObject(18652,x,y,z,0,0,0,283);
Neonrohr[playerid][Neon1] = CreateObject(18652,x,y,z,0,0,0,283);
AttachObjectToVehicle(Neonrohr[playerid][Neon], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0.8,0,-0.70,0,0,0);
AttachObjectToVehicle(Neonrohr[playerid][Neon1], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], -0.8,0,-0.70,0,0,0);
}
if(PlayerCar[playerid][Slot][Neon] == 5)
{
new Float:x,Float:y,Float:z;
Neonrohr[playerid][Neon] = CreateObject(18651,x,y,z,0,0,0,283);
Neonrohr[playerid][Neon1] = CreateObject(18651,x,y,z,0,0,0,283);
AttachObjectToVehicle(Neonrohr[playerid][Neon], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0.8,0,-0.70,0,0,0);
AttachObjectToVehicle(Neonrohr[playerid][Neon1], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], -0.8,0,-0.70,0,0,0);
}
if(PlayerCar[playerid][Slot][Neon] == 6)
{
new Float:x,Float:y,Float:z;
Neonrohr[playerid][Neon] = CreateObject(18650,x,y,z,0,0,0,283);
Neonrohr[playerid][Neon1] = CreateObject(18650,x,y,z,0,0,0,283);
AttachObjectToVehicle(Neonrohr[playerid][Neon], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0.8,0,-0.70,0,0,0);
AttachObjectToVehicle(Neonrohr[playerid][Neon1], PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], -0.8,0,-0.70,0,0,0);
}
}
print("PlayerCarSpawn 2");
}
}
}
Alles anzeigen