Szerző Téma: Score = Játszott óra  (Megtekintve 1492 alkalommal)

Nem elérhető Rico

Score = Játszott óra
« Dátum: 2012. április 06. - 17:18:06 »
0 Show voters
Hello!
Egy olyasmit szeretnék kérni, hogyha eltelik 1 óra akkor küldjön egy üzenetet a játékosnak(példa \"Eltelt egy óra\") És mentse is a perceket, órákat, és be is töltse!
És, ha valaki TAB-ot nyom, akkor a Score a Játszott Órát mutassa, mert a módban nem lesz szint rendszer.
Lehetõleg az includesek:
dini
dudb
a_samp
Elõre is köszönöm!
« Utoljára szerkesztve: 2012. április 06. - 17:20:19 írta Rico »

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Score = Játszott óra
« Válasz #1 Dátum: 2012. április 06. - 21:32:08 »
0 Show voters
new MP[MAX_PLAYERS];
new MPTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
       MP[playerid] = 0;
       return 1;
}
public OnPlayerSpawn(playerid)
{
       if(MPTimer[playerid] == -1)
       {
              MPTimer[playerid] = SetTimerEx(\"Timer\", 1000, true, \"i\", playerid);
              SetPlayerScore(playerid, 0);
       }
       return 1;
}
public OnPlayerDisconnect(playerid)
{
       KillTimer(MPTimer[playerid]);
       MPTimer[playerid] = -1;
       return 1;
}
public Timer(playerid)
{
        MP[playerid] ++;
        if(MP[playerid] >= 3600)
        {
              SendClientMessage(playerid, -1, \"Eltelt egy óra\");
              MP[playerid] = 0;
              SetPlayerScore(playerid, (MP[playerid] / 3600));
        }
        return 1;
}

Nem elérhető Rico

Score = Játszott óra
« Válasz #2 Dátum: 2012. április 06. - 21:45:56 »
0 Show voters
Egy warningot ad rá!Mi lehet a hiba?
 
warning 225: unreachable code

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Score = Játszott óra
« Válasz #3 Dátum: 2012. április 06. - 21:47:02 »
0 Show voters
Valahova a return 1; után tetted be a kódot

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Score = Játszott óra
« Válasz #4 Dátum: 2012. április 06. - 21:47:15 »
0 Show voters
Melyik sorban?

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Score = Játszott óra
« Válasz #5 Dátum: 2012. április 06. - 21:51:31 »
+1 Show voters
#include <a_samp>
forward Timer(playerid);
new MP[MAX_PLAYERS];
new MPTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
MP[playerid] = 0;
        return 1;
}
public OnPlayerSpawn(playerid)
{
if(MPTimer[playerid] == -1)
        {
              MPTimer[playerid] = SetTimerEx(\"Timer\", 1000, true, \"i\", playerid);
              SetPlayerScore(playerid, 0);
      }
        return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(MPTimer[playerid]);
        MPTimer[playerid] = -1;
        return 1;
}
public Timer(playerid)
{
MP[playerid] ++;
        if(MP[playerid] >= 3600)
{
               SendClientMessage(playerid, -1, \"Eltelt egy óra\");
               MP[playerid] = 0;
              SetPlayerScore(playerid, (MP[playerid] / 3600));
         }
         return 1;
}

 
Nekem így hibátlanul lefuttatja.

Nem elérhető Rico

Score = Játszott óra
« Válasz #6 Dátum: 2012. április 06. - 21:52:57 »
0 Show voters
Hiába tettem return 1; alá...
Ugyan az a warning sõt!Mostmár 2 Warnig van!
Skype van?

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Score = Játszott óra
« Válasz #7 Dátum: 2012. április 06. - 21:53:36 »
+1 Show voters
Pont azaz, hogy ne return 1;alá tedd.

Nem elérhető Rico

Score = Játszott óra
« Válasz #8 Dátum: 2012. április 06. - 21:56:17 »
0 Show voters
Jó lett!Az elõbb félre olvastam!Ment nektek a +! KÖSZÖNÖM!

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Score = Játszott óra
« Válasz #9 Dátum: 2012. április 06. - 21:56:59 »
0 Show voters
[mod]Témát máskor zárdd! Zárom.[/mod]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal