Hallo ich hab ein Problem und zwar:
ich möchte machen das man den Cars auch Ränge geben kann also das der Leader entscheiden kann aber wlechen Rang man das Car nehmen darf...
so sieht meins bis jetzt aus:
new Float:x, Float:y, Float:z;
new platestring[8];
GetPlayerPos(playerid, x, y, z);
if(PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[playerid][pSASpawn] == 0)
{
if(slot >= 0 && slot < 40)
{
if (!strcmp(Autoname, "enforcer", true))
{
if(GetPlayerMoney(playerid) >= FcarEnforcer)
{
DestroyVehicle(PDCars[slot]);
PDCars[slot] = CreateVehicle(427, x+1.5, y+1.5, z+1.5, 0, 79, 1, 900);
GivePlayerMoney(playerid, -FcarEnforcer);
}
else
{
return SendClientMessage(playerid, 0x0019FFFF, "Du hast nicht genügend Geld");
}
}
for(new i = 0; i < sizeof(PDCars); i++)
{
if(vehi == PDCars[i])
{
RemovePlayerFromVehicle(playerid);
DestroyVehicle(PDCars[i]);
PDCars[i] = CreateVehicle(vehmodel, vehx, vehy, vehz+0.5, vehangle, 79, 1, 900);
format(platestring, sizeof(platestring), "SAPD %i", i);
SetVehicleNumberPlate(PDCars[i],platestring);
fCarparkInfo[1] [i] [ModelId] = vehmodel;
fCarparkInfo[1] [i] [ParkX] = vehx;
fCarparkInfo[1] [i] [ParkY] = vehy;
fCarparkInfo[1] [i] [ParkZ] = vehz;
fCarparkInfo[1] [i] [ParkAngle] = vehangle;
format(modelstring,sizeof(modelstring), "Car%i_Model",i);
dini_IntSet("SAPDCars.ini",modelstring,fCarparkInfo[1] [i] [ModelId]);
format(xstring,sizeof(xstring), "Car%i_X",i);
dini_FloatSet("SAPDCars.ini",xstring,fCarparkInfo[1] [i] [ParkX]);
format(ystring,sizeof(ystring), "Car%i_Y",i);
dini_FloatSet("SAPDCars.ini",ystring,fCarparkInfo[1] [i] [ParkY]);
format(zstring,sizeof(zstring), "Car%i_Z",i);
dini_FloatSet("SAPDCars.ini",zstring,fCarparkInfo[1] [i] [ParkZ]);
format(anglestring,sizeof(anglestring), "Car%i_Angle",i);
dini_FloatSet("SAPDCars.ini",anglestring,fCarparkInfo[1] [i] [ParkAngle]);
}
}
for(new i = 0; i < sizeof(PDCars); i++) //und das kommt nur wenn du das hier drin hast?? Ja bei Ballas oder so geht schau
{
format(keystring,sizeof(keystring), "Car%i_Model",i);
fCarparkInfo[1] [i] [ModelId] = dini_Int("SAPDCars.ini",keystring);
format(keystring,sizeof(keystring), "Car%i_X",i);
fCarparkInfo[1] [i] [ParkX] = dini_Float("SAPDCars.ini",keystring);
format(keystring,sizeof(keystring), "Car%i_Y",i);
fCarparkInfo[1] [i] [ParkY] = dini_Float("SAPDCars.ini",keystring);
format(keystring,sizeof(keystring), "Car%i_Z",i);
fCarparkInfo[1] [i] [ParkZ] = dini_Float("SAPDCars.ini",keystring);
format(keystring,sizeof(keystring), "Car%i_Angle",i);
fCarparkInfo[1] [i] [ParkAngle] = dini_Float("SAPDCars.ini",keystring);
if(fCarparkInfo[1] [i] [ModelId] >= 400 && fCarparkInfo[1] [i] [ModelId] <= 611)
{
PDCars[i] = CreateVehicle(fCarparkInfo[1] [i] [ModelId], fCarparkInfo[1] [i] [ParkX], fCarparkInfo[1] [i] [ParkY], fCarparkInfo[1] [i] [ParkZ], fCarparkInfo[1] [i] [ParkAngle], 79, 1, 900);
format(platestring, sizeof(platestring), "SAPD %i", i);
SetVehicleNumberPlate(PDCars[i],platestring);
}
}