@Über mir C&P von Systemen die du nicht gemacht hast tz.tz.tz
Also erst brauchst du eine Variable gaaanz oben in deinen Script:
new bool:AdminSpawned[MAX_VEHICLES]; //boolean true/False
ocmd:veh(playerid,params[])
{
if(!isPlayerAnAdmin(playerid,4))return SendClientMessage(playerid,Rot,"S.Y.S.T.E.M: Du bist kein Admin / Rang 4.");
{
new Float:x, Float:y, Float:z;
new Text3D:supportveh[MAX_VEHICLES];
new c1,c2,vid;
if(sscanf(params,"iii",vid,c1,c2))return SendClientMessage(playerid,Orange,"S.Y.S.T.E.M: /veh [CarID] [Farbe1] [Farbe2]");
{
if(vid<402||vid>603)return SendClientMessage(playerid,Rot,"Ungültige Fahrzeug-ID.");
{
GetPlayerPos(playerid,x,y,z);
new car;
SetVehicleNumberPlate(car = CreateVehicle(vid,x,y,z,3,c1,c2,-1),"Support");
PutPlayerInVehicle(playerid,car,0);
SendClientMessage(playerid,Rot,"Du hast ein Support Fahrzeug gespawnt.");
supportveh[car] = Create3DTextLabel("Support Fahrzeug", Blau,0.0,0.0,0.0,30.0,0,1);
Attach3DTextLabelToVehicle(supportveh[car],car,0.0,0.0,2.0);
AdminSpawned[car] = true; // Auf "Ja" setzen ..
return 1;
}
}
}
}
ocmd:delall(playerid,params[])
{
if(isPlayerAnAdmin(playerid,4))
{
for(new v=0; v < MAX_VEHICLES; v++) {//durch alle vehicles loopen
if(AdminSpawned[v]) // WEnn AdminSpawned ja ist
{
DestroyVehicle(v); // Löschen
AdminSpawned[v]=false;//weil es nichtmehr existiert nein ^^
}
}
}
return 1;
}