Jump to content

Question

Posted

am pus gettime la aceasta variabila dar nu este ceea ce doream eu vreau sa imi arate cat timp ia luat de a terminat misiunea nu la ce ora a terminato

2lac.png

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

9 answers to this question

Recommended Posts

Posted

GetTime este folosita pentru a afla timpul real(ceasul). Daca vrei sa faci asa trebuie sa faci 3 varabile

new secunde[MAX_PLAYERS], minute[MAX_PLAYERS], ore[MAX_PLAYERS]; dupa faci un public care contureaza secundele.

public ContTime()

{

    secunde++;

    if(secunde == 60)

    {

        minute++;

    }

.................................. si tot asa

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

GetTime este folosita pentru a afla timpul real(ceasul). Daca vrei sa faci asa trebuie sa faci 3 varabile

new secunde[MAX_PLAYERS], minute[MAX_PLAYERS], ore[MAX_PLAYERS]; dupa faci un public care contureaza secundele.

public ContTime()

{

    secunde++;

    if(secunde == 60)

    {

        minute++;

    }

.................................. si tot asa

nu prea miam dat seama dar trebuie sa incerc acest server e bazat pe include dar na incerca sa vad ce pot face multumesc ai fost de mare ajutor :x

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Posted

Nu ai nevoie de timer pentru o chestie de genul...

Declari o variabila care sa retina un UTS (Unix TimeStamp)

Cand jucatorul intra in primul checkpoint, se salveaza UTS-ul curent in variabila.

Cand jucatorul intra in urmatorul checkpoint faci: UTS-ul curent - UTS-ul din variabila (de la primul checkpoint) si il decodezi.

Astfel, lucrezi mai eficient si dpdv al memoriei si al timpului de executie (la nivel mic, ma rog...).

Posted

am puso dar nu stiu ce nu am facut bine :-?

[pawn]new  Days, Hours, Minutes, Seconds;

// Calculate hours

if(Seconds == 60)

{

Minutes++;

}

// Calculate minutes

if(Minutes == 60)

{

Hours++;

}

// Calculate seconds

if(Hours == 60)

{

Days++;

}[/pawn]

puteti observa sus spune 0 ore 0 minute 0 secunde dar mie mia luat cam circa 2 min

4jgc.png

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Posted

eu am asa

[pawn]new  Days, Hours, Minutes, Seconds;[/pawn]

daca pun asa cum a spus gireada imi da erori

[pawn]new secunde[MAX_PLAYERS], minute[MAX_PLAYERS], ore[MAX_PLAYERS];[/pawn]

[pawn]C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(142) : error 033: array must be indexed (variable "Seconds")

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(144) : error 022: must be lvalue (non-constant)

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(144) : warning 215: expression has no effect

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(147) : error 033: array must be indexed (variable "Minutes")

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(149) : error 022: must be lvalue (non-constant)

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(149) : warning 215: expression has no effect

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(152) : error 033: array must be indexed (variable "Hours")

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(154) : error 022: must be lvalue (non-constant)

C:\Users\KyLLeR\Desktop\JP trucking acf\pawno\include\PPC_MissionsTrucking.inc(154) : warning 215: expression has no effect

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

6 Errors.[/pawn]

si daca las asa cum am facut eu nu merge

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Posted

cineva :d

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Posted

up :D

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Posted

[pawn]new secunde[MAX_PLAYES], minute[MAX_PLAYERS];[/pawn]

la ongamemodeinit pui : SetTimer("VerTime",1000,1);

[/pawn]forward VerTime();

public VerTime()

{

    for(new i=0;i<MAX_PLAYERS;i++)

  {

      if(IsPlayerConnected(i))

      {

          if(Aici pui conditia ca jucatorul sa fie in joc)

          {

              secunde++;

              if(secunde == 60)

              {

                  minute++;

                  secunde = 0;

              }

          }

      }

    }

    return 1;

}[/pawn]

 

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

if(Aici pui conditia ca jucatorul sa fie in joc)

care e acea conditiee nu este

if(IsPlayerConnected(i))

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

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.