/accepthouse and /denyhouse wont work
#1

So if i type /hausakzeptieren (accepting house) it shows that i have to type ID of the player but if i type the id/name it shows me again that message "Nutzung: /hausakzeptieren [spielerid/teildesnamens]"", what is wrong?

pawn Код:
CMD:hausakzeptieren(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED,"Du hast nicht die nцtigen Rechte dazu.");
    new tmp[128], giveplayerid;
    if(!strlen(tmp)) {
        SendClientMessage(playerid, COLOR_GREY, "Nutzung: /hausakzeptieren [spielerid/teildesnamens]");
        return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid)) {
    if(giveplayerid != INVALID_PLAYER_ID) {
    if(IsApprovalPending[giveplayerid] == true) {
    new money = GetPlayerMoney(giveplayerid);
    if(money < SetupHouseInfo[giveplayerid][SetupPrice])
    {
        SendClientMessage(giveplayerid, COLOR_RED, "Du kannst dir dieses Haus nicht leisten!");
        IsSettingUpHouse[giveplayerid] = false; SettingUpEntrance[giveplayerid] = false;
        HasAlreadySetupName[giveplayerid] = false; HasAlreadySetupDesc[giveplayerid] = false;
        HasAlreadySetupEntrance[giveplayerid] = false; HasAlreadySetupInterior[giveplayerid] = false;
        HasAlreadySetupRentable[giveplayerid] = false; HasAlreadySetupRentPrice[giveplayerid] = false;
        SetupHouseInfo[giveplayerid][SetupName] = 0; SetupHouseInfo[giveplayerid][SetupDesc] = 0;
        SetupHouseInfo[giveplayerid][SetupOwner] = 0; SetupHouseInfo[giveplayerid][SetupPrice] = 0;
        SetupHouseInfo[giveplayerid][SetupPX] = 0.0; SetupHouseInfo[giveplayerid][SetupPY] = 0.0;
        SetupHouseInfo[giveplayerid][SetupPZ] = 0.0; SetupHouseInfo[giveplayerid][SetupTX] = 0.0;
        SetupHouseInfo[giveplayerid][SetupTY] = 0.0; SetupHouseInfo[giveplayerid][SetupTZ] = 0.0;
        SetupHouseInfo[giveplayerid][SetupTA] = 0.0; SetupHouseInfo[giveplayerid][SetupInt] = 0;
        SetupHouseInfo[giveplayerid][SetupVir] = 0; SetupHouseInfo[giveplayerid][SetupRentable] = 0;
        SetupHouseInfo[giveplayerid][SetupRentPrice] = 0;
        DestroyPickup(HousePickup[playerid]);
        Delete3DTextLabel(HouseLabel[playerid]);
        IsApprovalPending[giveplayerid] = false;
        PlayerPlaySound(giveplayerid, 1085, 0.0, 0.0, 0.0);
        new file[100], pname[24];
        GetPlayerName(giveplayerid, pname, 24);
        format(file, sizeof(file), "austria/hauser/%s.ini", pname);
        dini_Remove(file);
        return 1;
    }
    else {
    new str[64];
    for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        new str2[128];
        HouseInfo[h][Name] = SetupHouseInfo[giveplayerid][SetupName];
        HouseInfo[h][Desc] = SetupHouseInfo[giveplayerid][SetupDesc];
        HouseInfo[h][Owner] = SetupHouseInfo[giveplayerid][SetupOwner];
        HouseInfo[h][Price] = SetupHouseInfo[giveplayerid][SetupPrice];
        HouseInfo[h][PX] = SetupHouseInfo[giveplayerid][SetupPX];
        HouseInfo[h][PY] = SetupHouseInfo[giveplayerid][SetupPY];
        HouseInfo[h][PZ] = SetupHouseInfo[giveplayerid][SetupPZ];
        HouseInfo[h][TX] = SetupHouseInfo[giveplayerid][SetupTX];
        HouseInfo[h][TY] = SetupHouseInfo[giveplayerid][SetupTY];
        HouseInfo[h][TZ] = SetupHouseInfo[giveplayerid][SetupTZ];
        HouseInfo[h][TA] = SetupHouseInfo[giveplayerid][SetupTA];
        HouseInfo[h][Int] = SetupHouseInfo[giveplayerid][SetupInt];
        HouseInfo[h][Vir] = SetupHouseInfo[giveplayerid][SetupVir];
        HouseInfo[h][Locked] = 0;
        HouseInfo[h][Rentable] = SetupHouseInfo[giveplayerid][SetupRentable];
        HouseInfo[h][RentPrice] = SetupHouseInfo[giveplayerid][SetupRentPrice];
        PlayerPlaySound(giveplayerid, 1149, 0.0, 0.0, 0.0);
        format(str, sizeof(str), "Glьckwunsch! Du hast ein Haus fьr $%i gekauft.", SetupHouseInfo[giveplayerid][SetupPrice]);
        SendClientMessage(giveplayerid, COLOR_YELLOW, str);
        GivePlayerMoney(giveplayerid, -HouseInfo[h][Price]);
        HouseOwner[giveplayerid] = true;
        IsSettingUpHouse[giveplayerid] = false; SettingUpEntrance[giveplayerid] = false;
        HasAlreadySetupName[giveplayerid] = false; HasAlreadySetupDesc[giveplayerid] = false;
        HasAlreadySetupEntrance[giveplayerid] = false; HasAlreadySetupInterior[giveplayerid] = false;
        SetupHouseInfo[giveplayerid][SetupName] = 0; SetupHouseInfo[giveplayerid][SetupDesc] = 0;
        SetupHouseInfo[giveplayerid][SetupOwner] = 0; SetupHouseInfo[giveplayerid][SetupPrice] = 0;
        SetupHouseInfo[giveplayerid][SetupPX] = 0.0; SetupHouseInfo[giveplayerid][SetupPY] = 0.0;
        SetupHouseInfo[giveplayerid][SetupPZ] = 0.0; SetupHouseInfo[giveplayerid][SetupTX] = 0.0;
        SetupHouseInfo[giveplayerid][SetupTY] = 0.0; SetupHouseInfo[giveplayerid][SetupTZ] = 0.0;
        SetupHouseInfo[giveplayerid][SetupTA] = 0.0; SetupHouseInfo[giveplayerid][SetupInt] = 0;
        SetupHouseInfo[giveplayerid][SetupVir] = 0; HasAlreadySetupRentable[giveplayerid] = false;
        SetupHouseInfo[giveplayerid][SetupRentable] = 0; SetupHouseInfo[giveplayerid][SetupRentable] = 0;
        SetupHouseInfo[giveplayerid][SetupRentPrice] = 0;
        HasAlreadySetupRentPrice[giveplayerid] = false;
        IsApprovalPending[giveplayerid] = false;
        new pname[MAX_PLAYER_NAME];
        new name[256], desc[256];
        new file[100];
        GetPlayerName(giveplayerid, pname, sizeof(pname));
        format(file, sizeof(file), "austria/hauser/%s.ini", pname);
        name = dini_Get(file, "Name");
        desc = dini_Get(file, "Beschreibung");
        format(str2, sizeof(str2), "Name: %s\n\nBeschreibung: %s\n\nBesitzer: %s", name, desc, pname);
        HouseLabel[giveplayerid] = Create3DTextLabel(str2, COLOR_LIGHTBLUE, HouseInfo[h][PX], HouseInfo[h][PY], HouseInfo[h][PZ], 20.0, 0);
        return 1;
    }
    }
    }
    }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Dieser Spieler hat noch kein Haus erstellt!");
    }
    return 1;
}
CMD:hausablehnen(playerid, params[])
    {
        if(PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED,"Du hast nicht die nцtigen Rechte dazu.");
        new tmp[128], giveplayerid;
        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_GREY, "Nutzung: /hausablehnen [spielerid/teildesnamens]");
            return 1;
        }
        giveplayerid = ReturnUser(tmp);
        if(IsPlayerConnected(giveplayerid)) {
            if(giveplayerid != INVALID_PLAYER_ID) {
                if(IsApprovalPending[giveplayerid] == true) {
                    SendClientMessage(giveplayerid, COLOR_RED, "Dein Haus wurde abgelehnt weil es mцglicherweise am falschen Ort war.");
                    IsSettingUpHouse[giveplayerid] = false; SettingUpEntrance[giveplayerid] = false;
                    HasAlreadySetupName[giveplayerid] = false; HasAlreadySetupDesc[giveplayerid] = false;
                    HasAlreadySetupEntrance[giveplayerid] = false; HasAlreadySetupInterior[giveplayerid] = false;
                    SetupHouseInfo[giveplayerid][SetupName] = 0; SetupHouseInfo[giveplayerid][SetupDesc] = 0;
                    SetupHouseInfo[giveplayerid][SetupOwner] = 0; SetupHouseInfo[giveplayerid][SetupPrice] = 0;
                    SetupHouseInfo[giveplayerid][SetupPX] = 0.0; SetupHouseInfo[giveplayerid][SetupPY] = 0.0;
                    SetupHouseInfo[giveplayerid][SetupPZ] = 0.0; SetupHouseInfo[giveplayerid][SetupTX] = 0.0;
                    SetupHouseInfo[giveplayerid][SetupTY] = 0.0; SetupHouseInfo[giveplayerid][SetupTZ] = 0.0;
                    SetupHouseInfo[giveplayerid][SetupTA] = 0.0; SetupHouseInfo[giveplayerid][SetupInt] = 0;
                    SetupHouseInfo[giveplayerid][SetupVir] = 0; SetupHouseInfo[giveplayerid][SetupRentable] = 0;
                    SetupHouseInfo[giveplayerid][SetupRentPrice] = 0;
                    IsApprovalPending[giveplayerid] = false;
                    DestroyPickup(HousePickup[giveplayerid]);
                    Delete3DTextLabel(HouseLabel[giveplayerid]);
                    PlayerPlaySound(giveplayerid, 1085, 0.0, 0.0, 0.0);
                    new file[100], pname[24];
                    GetPlayerName(giveplayerid, pname, 24);
                    format(file, sizeof(file), "austria/hauser/%s.ini", pname);
                    dini_Remove(file);
                    return 1;
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "Dieser Spieler hat noch kein Haus erstellt!");
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)