Hi,
habe ein Problem mit diesem Command: Ingame kommt Meldung "Server:unknown cmd", beim compil. kommen keine fehler
if(strcmp(cmdtext, "/spawncar", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, DARKRED, "Benutze: /createcar [Modell]");
return 1;
}
new tmpmodell;
tmpmodell = strval(tmp);
new tmpcar;
if(tmpmodell > 399 && tmpmodell < 612)
{
for(tmpcar= 1; tmpcar<= 300;)
{
format(file2, sizeof(file2), "/Cars/car%d.ini",tmpcar);
if(!dini_Exists(file2))
{
dini_Create(file2);
new Float:carx, Float:cary, Float:carz, Float:cara;
GetPlayerPos(playerid, carx, cary, carz);
GetPlayerFacingAngle(playerid, cara);
dini_IntSet(file2, "carsid", tmpcar);
dini_IntSet(file2, "modell", tmpmodell);
dini_FloatSet(file2, "carshealth", 1000);
dini_IntSet(file2, "carscolor1", 1);
dini_IntSet(file2, "carscolor2", 1);
dini_IntSet(file2, "carscolor3", 1);
dini_FloatSet(file2, "carsparkx", carx);
dini_FloatSet(file2, "carsparky", cary);
dini_FloatSet(file2, "carsparkz", carz);
dini_FloatSet(file2, "carsparka", cara);
dini_IntSet(file2, "fstosstange", 0);
dini_IntSet(file2, "rstosstange", 0);
dini_IntSet(file2, "fgitter", 0);
dini_IntSet(file2, "rgitter", 0);
dini_IntSet(file2, "wheels", 0);
dini_IntSet(file2, "spoiler", 0);
dini_IntSet(file2, "auspuff", 0);
dini_IntSet(file2, "hydraulik", 0);
dini_IntSet(file2, "lackierung", 0);
dini_IntSet(file2, "dachlufteinlass", 0);
dini_IntSet(file2, "haubelufteinlass", 0);
dini_IntSet(file2, "lichter", 0);
dini_IntSet(file2, "bassboost", 0);
dini_IntSet(file2, "nitro", 0);
dini_IntSet(file2, "carslock", 0);
dini_IntSet(file2, "tankvalue", 40);
dini_IntSet(file2, "tankaktuell", 40);
dini_IntSet(file2, "firmencar", 0);
CarInfo[tmpcar][carsid] = tmpcar;
CarInfo[tmpcar][modell] = tmpmodell;
CarInfo[tmpcar][carshealth] = 1000;
CarInfo[tmpcar][carscolor1] = 1;
CarInfo[tmpcar][carscolor2] = 1;
CarInfo[tmpcar][carscolor3] = 1;
CarInfo[tmpcar][carsparkx] = carx;
CarInfo[tmpcar][carsparky] = cary;
CarInfo[tmpcar][carsparkz] = carz;
CarInfo[tmpcar][carsparka] = cara;
CarInfo[tmpcar][fstosstange] = 0;
CarInfo[tmpcar][rstosstange] = 0;
CarInfo[tmpcar][fgitter] = 0;
CarInfo[tmpcar][rgitter] = 0;
CarInfo[tmpcar][wheels] = 0;
CarInfo[tmpcar][spoiler] = 0;
CarInfo[tmpcar][auspuff] = 0;
CarInfo[tmpcar][hydraulik] = 0;
CarInfo[tmpcar][lackierung] = 0;
CarInfo[tmpcar][dachlufteinlass] = 0;
CarInfo[tmpcar][haubelufteinlass] = 0;
CarInfo[tmpcar][lichter] = 0;
CarInfo[tmpcar][bassboost] = 0;
CarInfo[tmpcar][nitro] = 0;
CarInfo[tmpcar][carslock] = 0;
CarInfo[tmpcar][tankvalue] = 40;
CarInfo[tmpcar][tankaktuell] = 40;
CarInfo[tmpcar][firmencar] = 0;
CreateVehicle(CarInfo[tmpcar][modell], CarInfo[tmpcar][carsparkx], CarInfo[tmpcar][carsparky], CarInfo[tmpcar][carsparkz], CarInfo[tmpcar][carsparka], CarInfo[tmpcar][carscolor1], CarInfo[tmpcar][carscolor2], 60000);
format(string, sizeof(string), "Du hast Fahrzeug %d erstellt.", tmpcar);
SendClientMessage(playerid, DARKGREEN, string);
//PutPlayerInVehicle(playerid, tmpcar, 0);
return 1;
}
tmpcar++;
}
}
else
{
SendClientMessage(playerid, DARKRED, "Du kannst nur Autos von 411 - 611 spawnen!");
return 1;
}
}
else
{
SendClientMessage(playerid, DARKRED, "Du musst als Rcon eingeloggt sein!");
return 1;
}
return 1;
}
Grüße
samu