Hey,
wie kann mans machen das Man auch Über den Namen das Auto Spawnen kann?
Also z.B. " /car Sultan 0 0"
Hier der Code
ocmd:car(playerid,params[])
{
if(!isPlayerAnAdmin(playerid, 4)) return ErrorMessages(playerid, 4);
{
if(CarTrue[playerid] == 0)
{
new car;
new string[128];
new colour1, colour2;
if(sscanf(params,"iii",car, colour1, colour2))return SendClientMessage(playerid,ORANGE,"Benutzung: /car [Model/ID] [Farbe1] [Farbe2]");
if(car < 400 || car > 611) return SendClientMessage(playerid, ROT, "ERROR: Ungültige Vehicle Model ID!");
new LVehicleID;
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
DestroyVehicle(LVehicleID);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
format(string, sizeof(string), "|- Du hast einen "%s" gespawned (Model: %d) with Colours: %d,%d -|", VehicleNames[car-400], car, colour1, colour2);
CarTrue[playerid] = 1;
return SendClientMessage(playerid,HELLBLAU, string);
}
else
{
SendClientMessage(playerid, ROT, "Du hast bereits ein Fahrzeug!");
return 1;
}
}
}