Einmieten und Hausverkaufen?

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hay leute
    Ich möchte jetzt mal an einen Dynamisches Haussystem arbeiten!
    Aber wie scripte ich /einmieten und /hausverkaufen
    Ich habe mich damit noch nie beschäftigt



    Lg

  • ocmd:chouse(playerid, params[]) {
    new preis, string[255], interior;
    if ( IsPlayerAdmin(playerid) ) {
    format(string, sizeof(string), "Bitte benutze /chouse [Geld] [HausID].");
    if ( sscanf(params, "ii", preis, interior) ) { SendClientMessage(playerid, error, string); }
    else {
    if ( interior <= sizeof hEnter - 1 ) {
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    new first = -1;
    for (new i=1;i<=MAX_HOUSE;i++) {
    format(hausdatei,sizeof hausdatei, "House/House%d.cfg", i);
    if ( !dini_Exists(hausdatei) && first == -1 ) { first = i; }
    }
    format(hausdatei,sizeof hausdatei, "House/House%d.cfg", first);
    format(string,255,"Staat");
    dini_Create(hausdatei);
    dini_Set(hausdatei, "Owner", string);
    dini_IntSet(hausdatei, "Preis", preis);
    dini_IntSet(hausdatei, "Int", interior);
    dini_IntSet(hausdatei, "Locked", 1);
    dini_IntSet(hausdatei, "VW", lastVirtualWorld + 1);
    dini_FloatSet(hausdatei, "hX", pX);
    dini_FloatSet(hausdatei, "hY", pY);
    dini_FloatSet(hausdatei, "hZ", pZ);


    hInfo[first][hOwner] = string;
    hInfo[first][hPreis] = preis;
    hInfo[first][hEnterID] = interior;
    hInfo[first][hVirtualWorld] = lastVirtualWorld + 1;
    hInfo[first][hX] = pX,hInfo[first][hY] = pY,hInfo[first][hZ] = pZ;
    loadHouse(first);
    lastVirtualWorld ++;
    }
    else { SendClientMessage(playerid, error, "Falsche Interior Zahl."); }
    }
    } else { SendClientMessage(playerid, error, "Du bist kein Admin."); }
    return 1;
    }