hy leute
ich sitze nun schon den ganzen tag daran meinen /createhaus befehl zum laufen zu bekommen
Folgender Code
if(!strcmp(cmdtext,"/createhaus",true))
{
if(Spieler[playerid][pAdmin] >= 8)
{
if(!strlen(strget(cmdtext,1)))
return
SendClientMessage(playerid,COLOR_GREY,"Benutze: /createhaus [Preis] [besitzer]");
new preis = strval(strget(cmdtext,1));
new besitzer = strval(strget(cmdtext,2));
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new pfad[50];
for(new haus=1;haus<MAX_HAUS;haus++)
{
format(pfad,50,"/haus/%d.txt",haus); //nun ist der Pfad der Datei im String "pfad".
if(!fexist(pfad)) // wenn diese Datei noch nicht existiert
{
dini_Create(pfad); // dann erstellen wir sie
dini_FloatSet(pfad,"x",x); // und füllen sie mit unseren Werten.
dini_FloatSet(pfad,"y",y);
dini_FloatSet(pfad,"z",z);
dini_IntSet(pfad,"preis",preis);
dini_IntSet(pfad,"besitzer",besitzer);
return LoadHaus(haus);
}
}
}
return 1;
}
stock LoadHaus(hausid)
{
new pfad[50];
new String[64];
format(pfad,50,"/haus/%d.txt",hausid);
if(!fexist(pfad))return 0; //überprüft ob die Datei existiert, wenn nicht wird 0 zurückgegeben
HausInfo[hausid][haus_x] = dini_Float(pfad,"x"); // hier laden wir die Werte
HausInfo[hausid][haus_y] = dini_Float(pfad,"y");
HausInfo[hausid][haus_z] = dini_Float(pfad,"z");
HausInfo[hausid][haus_preis] = dini_Int(pfad,"preis");
format(HausInfo[hausid][haus_besitzer],32,"%s",dini_Get(pfad,"besitzer"));
HausInfo[hausid][haus_pickup] = CreatePickup(1273 ,23,HausInfo[hausid][haus_x],HausInfo[hausid][haus_y],HausInfo[hausid][haus_z],0);
return print("Das Haus wurde erfolgreich geladen");
}
Fehler:
Wenn ich an ein haus gehe den befehl /createhaus eingebe kommt Benutze: /createhaus [Preis] [besitzer] soo gebsch ein /createhaus 100 Keiner und siehe da Unknow Command
HÄÄÄÄÄÄ ich frage mich wo der fehler liegt
ich hoffe ma mir kann jemadn helfen