Guten Tag Community,
ich habe ein Problem und zwar wenn ich ingame /veh eingebe spawnen mehr als 6 cars
ocmd:veh(playerid,params[])
{
if(SpielerInfo[playerid][pEingeloggt] == 0)return SendClientMessage(playerid,COLOR_GREY,"Du bist nicht Eingeloggt");
if(!isAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GREY,"Du bist nicht befugt.");
new car,color1,color2;
if(sscanf(params,"ddd",car,color1,color2))return SendClientMessage(playerid,COLOR_GREY,"Benutzung: /veh [Carid] [Farbe1] [Farbe2]");
if(car < 400 || car > 623)return SendClientMessage(playerid,COLOR_GREY,"Benutzung: /veh [carid] [Farbe1] [Farbe2]");
new Float:X,Float:Y,Float:Z,Float:R;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,R);
new cars;
for(new i = 0; i < MAX_ADMINVEHS; i++)
{
if(pAdmincar[i] != 0) cars++;
}
if(cars == MAX_ADMINVEHS)return SendClientMessage(playerid,COLOR_GREY,"PSCCCCCHT");
new engine, lights, alarm, doors, bonnet, boot, objective;
for(new i = 0; i < MAX_ADMINVEHS; i++)
{
pAdmincar[i] = CreateVehicle(car,X,Y,Z,R,color1,color2,-1);
GetVehicleParamsEx(pAdmincar[i], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(pAdmincar[i],engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
pAdmincarlocked[pAdmincar[i]] = true;
PutPlayerInVehicle(playerid,pAdmincar[i],0);
new string[128];
format(string,sizeof(string),"%s hat ein Fahrzeug mit der id %d gespawnt",SpielerName(playerid),car);
SendAdminMessage(COLOR_RED,string);
return 1;
}
return 1;
}