@Alf21 Hab das statt den "Woran scheiterts" hinzugefügt:
format(string, sizeof(string), "1 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
SendClientMessage(i,F_Gray,string);
Aber mir wird bei allen dreien 0 ausgegeben.. Bei dem Befehl zum Fraktionsfahrzeuge erstellen, funktionierts aber...
dcmd_efa(playerid,params[]){
if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL)
{
new vehid,col1,col2,faction[5];
if(!sscanf(params,"dddd",vehid,col1,col2,faction[0]))
{
sscanf(params,"dddddddd",vehid,col1,col2,faction[0],faction[1],faction[2],faction[3],faction[4]);
if(vehid < 400 || vehid > 611) return SendClientMessage(playerid,FACTION_COL_GREY,"Vehicle-ID nur von 400 bis 611.");
if(col1 < 0 || col1 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(1)!");
if(col2 < 0 || col2 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(2)!");
if(faction[0] && faction[0] <= MAX_FACTIONS)
{
for(new f;f<5;f++)
{
if(faction[f] <= 0 || faction[f] > MAX_FACTIONS)
{
faction[f] = -255;
}
}
for(new fc;fc<sizeof(FactionCars);fc++)
{
if(FactionCars[fc][fVehid] < 400 || FactionCars[fc][fVehid] > 611)
{
for(new i=0; i<sizeof(AutohausVehs); i++)
{
FactionCars[fc][fVehid] = vehid;
new Float:fX,Float:fY,Float:fZ,Float:fA;
GetPlayerPos(playerid,fX,fY,fZ),GetPlayerFacingAngle(playerid,fA);
FactionCars[fc][fPos][0] = fX;
FactionCars[fc][fPos][1] = fY;
FactionCars[fc][fPos][2] = fZ;
FactionCars[fc][fPos][3] = fA;
FactionCars[fc][fCol][0] = col1;
FactionCars[fc][fCol][1] = col2;
for(new f;f<5;f++){
FactionCars[fc][fFaction][f] = faction[f];
}
FactionCars[fc][fFuel] = CarInfo[vehid-400][ci_CarMaxGas]*100;
FactionCars[fc][fPrice] = 0;
for(new mood;mood<14;mood++)
FactionCars[fc][fTuning][mood] = 0;
FactionCars[fc][fCarid] = CreateVehicle(FactionCars[fc][fVehid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2],FactionCars[fc][fPos][3],FactionCars[fc][fCol][0],FactionCars[fc][fCol][1],-255);
#if defined FACTION_CARS_LOCKABLE
FactionCars[fc][fLock] = true;
#endif
SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug erfolgreich erstellt.");
SendClientMessage(playerid,FACTION_COL_YELLOW,"Vergesse es nicht mit '/fpark' umzuparken.");
PutPlayerInVehicle(playerid,FactionCars[fc][fCarid],0);
new stringo[128];
format(stringo, sizeof(stringo), "Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
SendClientMessage(playerid,F_Gray,stringo);
return true;
}
}
}SendClientMessage(playerid,FACTION_COL_GREY,"Die Maximale Anzahl von Fraktionsfahrzeugen wurde bereits erreicht.");
}
else
{
SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Fraktion!");
}
}
else
{
SendClientMessage(playerid,FACTION_COL_GREY,"Benutze: '/efa [Model] [Farbe(1)] [Farbe(2)] [Hauptfraktion]'.");
}
}
else
{
SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
}
return true;
}
Alles anzeigen