Peršokti į turinį

[TD] Pamoka ~ Kurimas - Pinigai | [1]


Ms-Studio

Recommended Posts

Na ka pradedam. Dauguma skripteri┼│ kiek ma─Źiau nemokejo tai padaryti ar tesiog naujokai ir dar nieko ne┼żino. tad pradesim nuo papra─Źiausio:) ─»d─Śja u┼żgim─Ś kai Renas para┼íe , kad jam reiktu pinigu sukoduoto TD. tad pamokinsiu jus:)

Pradedam:

  1. nusipiešiame TextDraw . aš naudojau programa: iPLEOMAX - cia autorius.

  2. nusipiešiame ka norite, bet kokia išvaizda:

DEMESIO! KODO LYGIAVIMAS SUGADINTAS. TIKSLUS LYGIAVIMAS PASTEBIN:

http://pastebin.com/NMkrzPxr

pradedam prie kodo:

pirma i┼í td konvertuojam i pwn. konventeris yra pa─Źia td kurimo programoje

pirma kuriame Variables

new Text:Textdraw0[MAX_PLAYERS];
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2[MAX_PLAYERS];
new Text:Textdraw3[MAX_PLAYERS];

kuriame 1 forward'a

forward UpdatePlayerInfo(playerid);

td einame prie paciu TD

po public OnFilterScriptInit() ar public OnFilterGamemodeInit()

dedame koda:

SetTimer("UpdatePlayerInfo",1000,1);//atnaujina ┼żaid─Śjo info kas 1min
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
Textdraw0[playerid] = TextDrawCreate(484.000000, 77.279998, "LD_SPAC:white");
TextDrawLetterSize(Textdraw0[playerid], 0.000000, 0.000000);
TextDrawTextSize(Textdraw0[playerid], 125.000000, 21.839996);
TextDrawAlignment(Textdraw0[playerid], 1);
TextDrawColor(Textdraw0[playerid], -1061109505);
TextDrawSetShadow(Textdraw0[playerid], 0);
TextDrawSetOutline(Textdraw0[playerid], 0);
TextDrawFont(Textdraw0[playerid], 4);
Textdraw1[playerid] = TextDrawCreate(488.500000, 79.520004, "$");
TextDrawLetterSize(Textdraw1[playerid], 0.421999, 1.583199);
TextDrawAlignment(Textdraw1[playerid], 1);
TextDrawColor(Textdraw1[playerid], 16711935);
TextDrawSetShadow(Textdraw1[playerid], 0);
TextDrawSetOutline(Textdraw1[playerid], 1);
TextDrawBackgroundColor(Textdraw1[playerid], 51);
TextDrawFont(Textdraw1[playerid], 2);
TextDrawSetProportional(Textdraw1[playerid], 1);
Textdraw2[playerid] = TextDrawCreate(483.000000, 87.360015, "......................");
TextDrawLetterSize(Textdraw2[playerid], 0.449999, 1.600000);
TextDrawAlignment(Textdraw2[playerid], 1);
TextDrawColor(Textdraw2[playerid], -1);
TextDrawSetShadow(Textdraw2[playerid], 0);
TextDrawSetOutline(Textdraw2[playerid], 1);
TextDrawBackgroundColor(Textdraw2[playerid], 51);
TextDrawFont(Textdraw2[playerid], 1);
TextDrawSetProportional(Textdraw2[playerid], 1);
Textdraw3[playerid] = TextDrawCreate(483.000000, 66.640045, "......................");
TextDrawLetterSize(Textdraw3[playerid], 0.449999, 1.600000);
TextDrawAlignment(Textdraw3[playerid], 1);
TextDrawColor(Textdraw3[playerid], -1);
TextDrawSetShadow(Textdraw3[playerid], 0);
TextDrawSetOutline(Textdraw3[playerid], 1);
TextDrawBackgroundColor(Textdraw3[playerid], 51);
TextDrawFont(Textdraw3[playerid], 1);
TextDrawSetProportional(Textdraw3[playerid], 1);

Td einame prie callbacko: OnFilterScriptExit arba OnFilterGememodeExit

ir rašome:

for ( new i = 0; i < MAX_PLAYERS; i++)
    {
    //slepiam kol Minato nepamate
    TextDrawHideForPlayer(i, Textdraw0[i]);
    TextDrawHideForPlayer(i, Textdraw1[i]);
    TextDrawHideForPlayer(i, Textdraw2[i]);
    TextDrawHideForPlayer(i, Textdraw3[i]);
    }

td kuriame publicka: public UpdatePlayerInfo(playerid)

public UpdatePlayerInfo(playerid)
{
 new str[128];
    format(str, sizeof(str), "$ %d", GetPlayerMoney(playerid));
    TextDrawSetString(Textdraw1[playerid], str);
    TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
    return 1;
}

Galutinis vaizdas:

003a7931b35f8bb99a1032c2d8f331d5365.png

TextDraw faila galite gauti parase i skype: vilmantux11 ar per pm:)

Pamoka baigta:)

Autorius: MaxSis , kopijuoti draud┼żiama be sutykimo.

Laukite kitu TD pamoku:)

  • Teigiamai 3
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Apskritai, optimizavimo at┼żvilgiu chujnia ─Źia yra.

TD, kuris niekada nekei─Źiamas u┼żtekt┼│ sukurti vien─ů kart─ů, j─» parodyti visiems ┼żaid─Śjams.

O pinig┼│ rodym─ů irgi tik string─ů keisti, o ne destroyint,hidint ir per nauj─ů kurin─Śt.

Redaguota , nario inwyax
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Kod─Śl kuri taimer─»? Neb┼źt┼│ papra┼í─Źiau atnaujinim─ů d─Śti ─» OnPlayerUpdate?

Nes kvies labai da┼żnai ir sukyla resursai. I┼ívis geriausia b┼źt┼│ pasidaryti savo pinig┼│ davimo funkcij─ů ir tik tuomet kai pinigai b┼źna duodami atnaujiname textdraw'─ů.

Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Sve─Źias
┼ái tema yra u┼żrakinta.
  • ┼áiame puslapyje nar┼ío:   0 nariai

    • N─Śra registruot┼│ nari┼│ per┼żi┼źrin─Źi┼│ ┼í─» forum─ů.


├Ś
├Ś
  • Sukurti nauj─ů...