Jump to content

[TUTORIAL]Potreby


Recommended Posts

cafte. davam vam sem Tut na Potreby ale najprv by som sa chcel podakovat Atomasovi ktory mi s Odcitanim pomohol Dik Atomas :v:

 

 

 

Hore medzi new

-------------------

new wc[MAX_PLAYERS]; // Nadefinujeme potrebu
new Text:wcx[MAX_PLAYERS]; // Nadefinujeme TD pre potrebu

 

 

Teraz medzi forwardy

-------------------------

forward uberanie(playerid);
forward text(playerid); // TextDraw

forward OdpocetWc(playerid); // Toto vytvoril Atomas a je to Odpocet Jedla

 

 

 

Teraz ideme na TD. Takze do OnGameModeInit dame toto

------------------------------------------------------------

	for (new i = 0; i < MAX_PLAYERS; i++) // TextDraw
{
wcx[i] = TextDrawCreate(501,138,"Wc : 0");
TextDrawLetterSize(wcx[i],0.500000,1.000000);
TextDrawAlignment(wcx[i],0);
TextDrawBackgroundColor(wcx[i],0xE10000ff);
TextDrawFont(wcx[i],1);
TextDrawUseBox(wcx[i],1);
TextDrawBoxColor(wcx[i],0x00000066);
TextDrawTextSize(wcx[i],601.000000,148.000000);
TextDrawSetOutline(wcx[i],1);
TextDrawSetProportional(wcx[i],1);
TextDrawSetShadow(wcx[i],1);
}

 

 

 

Teraz do OnPlayerConnect

-----------------------------

	SetTimerEx("text",1000,0,"i",playerid);
SetTimerEx("OdpocetWc",60000,1,"i",playerid); // Toto je ze vam to bude po urcitom case pridavat potrebu na wc

 

 

 

Niekam do modu. (Nie do publicu)

--------------------------------------

public text(playerid) // Public TD
{
if(IsPlayerConnected(playerid)) SetTimerEx("text",1000,0,"i",playerid);
new string[256];
format(string,sizeof(string),"Wc : %d",wc[playerid]);
TextDrawSetString(wcx[playerid],string);
TextDrawHideForPlayer(playerid,wcx[playerid]);
TextDrawShowForPlayer(playerid,wcx[playerid]);
return 1;
}
// -----> Wc <----- //
public OdpocetWc(playerid) // Odpocet
{
wc[playerid]--;
return 1;
}

 

 

 

To je vsetko. Mne to funguje takto :)

Link to comment
Share on other sites

akorat ten timer na to odpocitavani se spusti dycky kdyz se pripioji na server kdz se odpoji tiemr jede dale takze bud si das podminku pustit znovu timer kdyz je pripojeny nebo spojis odpocitavani s ukazovanim textdrawu

Link to comment
Share on other sites

Guest Lamka_s.r.o.

nevite nekdo jak udelat ze kdyz ma treba hrac nakou wc potrebu tak mu to neco udela napr odecte penize atd...? skousel sem to ale nak mi to nejde :oops::oops:

Link to comment
Share on other sites

  • 3 weeks later...

Ty si to dal do Prison Alcatraz :d a kto ti pomohol, aby si tam mal aj jedlo a logiku ? :d a aby neodpocitavalo od 0 do minusu ale od 100 k 0 ? :d lol ale dobry tut, ja to mam uz cele prerobene skor nez si to sem dal ;)

Link to comment
Share on other sites

Custe hejky pise mi to 4 errory

C:\Documents and Settings\Vasek\Plocha\dd\dd.pwn(56) : error 017: undefined symbol "wcx"

C:\Documents and Settings\Vasek\Plocha\dd\dd.pwn(56) : warning 215: expression has no effect

C:\Documents and Settings\Vasek\Plocha\dd\dd.pwn(56) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Vasek\Plocha\dd\dd.pwn(56) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Vasek\Plocha\dd\dd.pwn(56) : fatal error 107: too many error messages on one line

 

 

Řádek56:wcx = TextDrawCreate(501,138,"Wc : 0");

Link to comment
Share on other sites

  • 4 weeks later...

hej prosim jak mam udeatto ze kdyz uz tu potrebu mam velkou a chcu jit na ha*zl tak to jde jen v blizkosti u urciteho object a kdyz dam /WC tak to hodi animaci ale pokud nebudu v blyzkosti tak mi to zahlasi "potrebujes wc k vykonani potreby"pls jak to mam udelat aj s tou animaci?

Link to comment
Share on other sites

dělat potřebu přes textdraw je na nic, lepší je to přes progress bar ;)

 

ProgressBar je taky textdraw pokud vim chytráku ? ..

ve svý podstatě možná jo, ale mnohem lepší :)

Link to comment
Share on other sites

  • 10 months later...
  • 1 year later...

Mě jak se tam vytvoří ten textdraw Wc: 0 tak to je jasné že se to nepřeměňuje v žádné hodnoty je tam stále 0 a je to tím že mám vytvořeny textdraw Wc:0 pak ale jak se to má napojit když to je takhle udělaný a sry za datum ale chtěl jsem se zeptat :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...