Jump to content
  • 0

Cum pun interiorul unei mape la /createhouse


KripToN.

Question

Recommended Posts

  • 0
Acum 37 minute, Geani a spus:

trebuie sa faci un interior cu acel interior din mapa pusa ei codul z,x,y si il pui la createhouse

Exemplu ceva?

CMD:createhouse(playerid, params[])
{
    new pret, nivel;
    if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, COLOR_WHITE, "Nu ai acces!");
    if(CreateHouse[playerid] == 1) return SCM(playerid, COLOR_YELLOW2, "Eroare: Deja creezi o casa!");
    if(sscanf(params, "ii", pret, nivel)) return SendClientMessage(playerid, COLOR_GREY, "Sintaxa: {FFFFFF}/createhouse <pret> <nivel>");
    PlayerTextDrawSetString(playerid, ShopTDs[1], "Seteaza");
    CreateHouse[playerid] = 1;
    SInterior[playerid] = 1;
    pPret[playerid] = pret;
    pNivel[playerid] = nivel;
    GetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]);
    pInteriorID[playerid] = GetPlayerInterior(playerid), pVirtual[playerid] = GetPlayerVirtualWorld(playerid);
    SetInteriorCamera(playerid);
    ShowShopTDs(playerid);
    SetPlayerVirtualWorld(playerid, playerid+900);
    return 1;
}

Link to comment
Share on other sites

  • 0
Acum 44 minute, WopsS a spus:

Vad ca in comanda ta trebuie sa fii la coordonatele casei, du-te unde este acea casa si ruleaza comanda.

Nu este casa(exterior) este un (interior al casei)

Comanda e automata cind dau /createhouse mi se pune citeva textdraw si trebuie sa aleg inteior pina la 36

Link to comment
Share on other sites

  • 0
Just now, Th3FuK3R said:

Nu este casa(exterior) este un (interior al casei)

Comanda e automata cind dau /createhouse mi se pune citeva textdraw si trebuie sa aleg inteior pina la 36

Arata-ne ce ai luat. Acel interior trebuie sa se afle la niste coordonate, interiorul ar trebui sa fie 0.

Link to comment
Share on other sites

  • 0
Chiar acum, WopsS a spus:

Arata-ne ce ai luat. Acel interior trebuie sa se afle la niste coordonate, interiorul ar trebui sa fie 0.

Da are coordonate eu asta si intreb cum pun coordonatele celea la /createhouse sau sal schimb cu un alt interior

Link to comment
Share on other sites

  • 0
1 minute ago, Th3FuK3R said:

Da are coordonate eu asta si intreb cum pun coordonatele celea la /createhouse sau sal schimb cu un alt interior

Trebuie sa te duci cu o comanda unde se afla cel interior sau sa-ti modifici comanda in asa fel incat sa accepte parametrii pentru pozitie.

Link to comment
Share on other sites

  • 0
Chiar acum, WopsS a spus:

Trebuie sa te duci cu o comanda unde se afla cel interior sau sa-ti modifici comanda in asa fel incat sa accepte parametrii pentru pozitie.

Am coordonatele acelui interior doar ca nu stiu cu care sal modific(unde)

Link to comment
Share on other sites

  • 0
1 minute ago, Th3FuK3R said:

Am coordonatele acelui interior doar ca nu stiu cu care sal modific(unde)

Nu inteleg. Daca le ai, du-te la acele coordonate prin comanda /goto sau ceva asemanator si executa comanda /createhouse.

Link to comment
Share on other sites

  • 0
Acum 2 minute, WopsS a spus:

Arata-ne functia ShowShopTDs.

function ShowShopTDs(playerid) {
    TextDrawShowForPlayer(playerid, ShopTD[0]);
    TextDrawShowForPlayer(playerid, ShopTD[1]);
    PlayerTextDrawShow(playerid, ShopTDs[0]);
    PlayerTextDrawShow(playerid, ShopTDs[1]);
    TextDrawShowForPlayer(playerid, ShopTD[4]);
    PlayerTextDrawSetString(playerid, ShopTDs[0], "Interior id: 1");
    PlayerTextDrawShow(playerid, ShopTDs[0]);
    SelectTextDraw(playerid, 0xFF0000FF);
    return 1;
}

function HideShopTDs(playerid) {
    TextDrawHideForPlayer(playerid, ShopTD[0]);
    TextDrawHideForPlayer(playerid, ShopTD[1]);
    PlayerTextDrawHide(playerid, ShopTDs[0]);
    PlayerTextDrawHide(playerid, ShopTDs[1]);
    TextDrawHideForPlayer(playerid, ShopTD[4]);
    CancelSelectTextDraw(playerid);
    return 1;
}

Link to comment
Share on other sites

  • 0

ShopTDs[0] = CreatePlayerTextDraw(playerid, 258.609130, 360.333251, "Interior ID: 5");
    PlayerTextDrawLetterSize(playerid, ShopTDs[0], 0.318944, 1.570832);
    PlayerTextDrawAlignment(playerid, ShopTDs[0], 1);
    PlayerTextDrawColor(playerid, ShopTDs[0], -1);
    PlayerTextDrawSetShadow(playerid, ShopTDs[0], 0);
    PlayerTextDrawSetOutline(playerid, ShopTDs[0], 1);
    PlayerTextDrawBackgroundColor(playerid, ShopTDs[0], 255);
    PlayerTextDrawFont(playerid, ShopTDs[0], 2);
    PlayerTextDrawSetProportional(playerid, ShopTDs[0], 1);
    PlayerTextDrawSetShadow(playerid, ShopTDs[0], 0);

    ShopTDs[1] = CreatePlayerTextDraw(playerid, 265.636871, 381.916564, "Cumpara");
    PlayerTextDrawLetterSize(playerid, ShopTDs[1], 0.529779, 1.576666);
    PlayerTextDrawTextSize(playerid, ShopTDs[1], 359.000000, 15.000000);
    PlayerTextDrawAlignment(playerid, ShopTDs[1], 1);
    PlayerTextDrawColor(playerid, ShopTDs[1], -1);
    PlayerTextDrawSetShadow(playerid, ShopTDs[1], 0);
    PlayerTextDrawSetOutline(playerid, ShopTDs[1], 1);
    PlayerTextDrawBackgroundColor(playerid, ShopTDs[1], 255);
    PlayerTextDrawFont(playerid, ShopTDs[1], 3);
    PlayerTextDrawSetProportional(playerid, ShopTDs[1], 1);
    PlayerTextDrawSetShadow(playerid, ShopTDs[1], 0);
    PlayerTextDrawSetSelectable(playerid, ShopTDs[1], true);

Acum 3 minute, WopsS a spus:

Nu stiu ce face fiecare buton, mai bine ne arati functia cand shimbi un interior.

 

Link to comment
Share on other sites

  • 0
Acum 2 minute, WopsS a spus:

ShopTD presupun ca sunt sagetiile. Arata-ne OnPlayerClickTextDraw cand verifica clickedid cu ID-ul butoanelor.

P.S: Foloseste tag-ul de cod (<>) pentru C in loc de HTML.

if(clickedid == ShopTD[0]) {
    // --
        if(SInterior[playerid] == 1) SInterior[playerid] = 37;
        SInterior[playerid] --;
        SetInteriorCamera(playerid);
    }
    if(clickedid == ShopTD[1]) {
    // ++
        if(SInterior[playerid] == 36) SInterior[playerid] = 0;
        SInterior[playerid] ++;
        SetInteriorCamera(playerid);
        SetPlayerVirtualWorld(playerid, pVirtual[playerid]);
    }
    if(clickedid == ShopTD[4]) HideShopTDs(playerid), SetCameraBehindPlayer(playerid), SetPlayerInterior(playerid, pInteriorID[playerid]), SetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]), CreateHouse[playerid] = 0;
    return 1;
}
 

Link to comment
Share on other sites

  • 0
Acum 3 minute, WopsS a spus:

ShopTD presupun ca sunt sagetiile. Arata-ne OnPlayerClickTextDraw cand verifica clickedid cu ID-ul butoanelor.

P.S: Foloseste tag-ul de cod (<>) pentru C in loc de HTML.

Sau asta?

if(playertextid == ShopTDs[1]) {
        if(CreateHouse[playerid] == 0) {
            if(PlayerInfo[playerid][pGoldPoints] < 45) return SCM(playerid, COLOR_YELLOW2, "Eroare: Ai nevoie de 45 puncte gold pentru a lua acest produs.");
            HideShopTDs(playerid), SetCameraBehindPlayer(playerid), SetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]);
            SetPlayerVirtualWorld(playerid, pVirtual[playerid]);
            new bouse = PlayerInfo[playerid][pPhousekey],playername[25], i = SInterior[playerid]-1;
            GetPlayerName(playerid, playername, sizeof(playername));
            if (bouse != 999 && strcmp(GetName(playerid), HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
            {
                HouseInfo[bouse][hExitx] = InteriorPos[0];
                HouseInfo[bouse][hExity] = InteriorPos[1];
                HouseInfo[bouse][hExitz] = InteriorPos[2];
                HouseInfo[bouse][hInterior] = GetPlayerInterior(playerid);
                HUpdate(bouse, hExitxx);
                HUpdate(bouse, hExityx);
                HUpdate(bouse, hExitzx);
                HUpdate(bouse, hInteriorx);
                PlayerInfo[playerid][pGoldPoints]-=45;
                Update(playerid, pGoldPointsx);
                SCM(playerid, COLOR_GOLD, "Felicitari! Ti-ai cumparat un interior din magazin.");
                foreach(Player, x) {
                    if(InHouse[x] == bouse && IsPlayerConnected(x)) {
                        SCM(x, COLOR_YELLOW, "Ai fost teleportat intr-un nou interior deoarece propietarul casei a achizitionat unul nou din magazin.");
                        SpawnPlayer(x);
                    }
                }
                SetPlayerInterior(playerid, pInteriorID[playerid]);
            }
            else return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Nu detii o casa."), SetPlayerInterior(playerid, pInteriorID[playerid]);
        }
        else {
            new x = SInterior[playerid]-1;
            new xQuery[1024];
            mysql_format(SQL, xQuery, sizeof(xQuery),"INSERT INTO houses (`Entrancex`, `Entrancey`, `Entrancez`, `Exitx`, `Exity`, `Exitz`, `Interior`, `Level`, `Value`) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d')",
            pPos[playerid][0], pPos[playerid][1], pPos[playerid][2], InteriorPos[x][0], InteriorPos[x][1], InteriorPos[x][2], GetPlayerInterior(playerid), pNivel[playerid], pPret[playerid]);
            new Cache: result = mysql_query(SQL, xQuery);
            new i = cache_insert_id();
            cache_delete(result);
            HouseInfo[hID] = i;
            HouseInfo[hExitx] = InteriorPos[x][0];
            HouseInfo[hExity] = InteriorPos[x][1];
            HouseInfo[hExitz] = InteriorPos[x][2];
            HouseInfo[hEntrancex] = pPos[playerid][0];
            HouseInfo[hEntrancey] = pPos[playerid][1];
            HouseInfo[hEntrancez] = pPos[playerid][2];
            HouseInfo[hLevel] = pNivel[playerid];
            HouseInfo[hVirtual] = i;
            format(string, sizeof(string), "SELECT `houses` SET `Virtual`='%d' WHERE `ID`='%d'", i, i);
            mysql_query(SQL, string);
            HouseInfo[hValue] = pPret[playerid];
            HouseInfo[hInterior] = GetPlayerInterior(playerid);

            HUpdate(i, hExitxx);
            HUpdate(i, hExityx);
            HUpdate(i, hExitzx);
            HUpdate(i, hInteriorx);
            OnPropTextdrawUpdate(1, i);
            SCM(playerid, COLOR_GOLD, "Casa a fost creata cu succes!");
            format(string, sizeof(string), "Informatii: Interior %d, Nivel %d, Pret $%s.", x, pNivel[playerid], FormatNumber(pPret[playerid]));
            SCM(playerid, COLOR_GOLD, string);
            HideShopTDs(playerid), SetCameraBehindPlayer(playerid), SetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]);
            SetPlayerVirtualWorld(playerid, pVirtual[playerid]);
            SetPlayerInterior(playerid, pInteriorID[playerid]);
            CreateHouse[playerid] = 0;
        }
    }
 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.