Szerző Téma: Játszott óra  (Megtekintve 610 alkalommal)

Nem elérhető Amf

  • 1459
    • Profil megtekintése
Játszott óra
« Dátum: 2012. Május 26. - 14:51:15 »
0 Show voters
Üdv!
Nem sokszor kérek szkriptet, de most megteszem! :(
Egy játszott óra szkript kéne
Mentse a perceket, órákat, és ha átlép egy órát akkor kapjon 1 üzit, hogy \"Óraugrás\"
És kapjon 1 pontot!
Elõre is köszönöm! :)

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
Játszott óra
« Válasz #1 Dátum: 2012. Május 26. - 15:07:34 »
0 Show voters
public OnPlayerConnect(playerid)
{
SetTimerEx(\"oraugras\", 360000, 1, \"i\", playerid);
return 1;
}
forward oraugras(playerid);
public oraugras(playerid)
{
GivePlayerScore(playerid, 1);
SendClientMessage(playerid, -1, \"Óraugrás!! Kaptál 1 pontot.\");
}

 
Így próbáld meg.

Nem elérhető zeteni

  • 1970
  • Ex-Scripter
    • Profil megtekintése
Játszott óra
« Válasz #2 Dátum: 2012. Május 26. - 15:20:04 »
0 Show voters
Ez akkor indul el mikor belép. Nem úgy akarja, hogy mikor kilép, akkor mentse el amennyit játszott?

Nem elérhető Amf

  • 1459
    • Profil megtekintése
Játszott óra
« Válasz #3 Dátum: 2012. Május 26. - 15:54:51 »
0 Show voters
De... úgy szeretném, hogy mentes is el a percet és az órát

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Játszott óra
« Válasz #4 Dátum: 2012. Május 26. - 17:17:22 »
+3 Show voters
#include < a_samp >
#include < dini >
#undef MAX_PLAYERS
#define MAX_PLAYERS 30 // slotok száma
new ora[ MAX_PLAYERS ];
new perc[ MAX_PLAYERS ];
new mperc[ MAX_PLAYERS ];
new timer;
forward oraa();
public OnFilterScriptInit( )
{
timer = SetTimer( \"oraa\",1000,true );
return 1;
}
public OnFilterScriptExit( )
{
KillTimer( timer );
return 1;
}
public oraa( )
{
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
mperc[ i ]++;
if(mperc == 60)
{
    perc[ i ] ++;
    mperc[ i ] = 0;
}
if(perc[ i ] == 60)
{
    ora[ i ] ++;
    perc[ i ] = 0;
    SendClientMessage(i,-1,\"Óraugrás.\");
    SetPlayerScore(i,GetPlayerScore(i)+1);
}
}
}
public OnPlayerConnect( playerid )
{
olvas( playerid );
return 1;
}
public OnPlayerDisconnect( playerid )
{
ment( playerid );
return 1;
}
stock ment( id )
{
new file[128];
new name[24];
GetPlayerName(id,name,24);
format(file,128,\"ora/%s.ini\",name);
    if(fexist(file))
{
    dini_IntSet(file,\"o\", ora[id]);
    dini_IntSet(file,\"p\", perc[id]);
    dini_IntSet(file,\"m\", mperc[id]);
}
}
stock olvas( id )
{
new file[128];
new name[24];
GetPlayerName(id,name,24);
format(file,128,\"ora/%s.ini\",name);
    if(fexist(file))
{
    ora[id] = dini_Int(file,\"o\");
    perc[id] = dini_Int(file,\"p\");
    mperc[id] = dini_Int(file,\"m\");
    SetPlayerScore(id,dini_Int(file,\"o\"));
}
}

Nem elérhető Amf

  • 1459
    • Profil megtekintése
Játszott óra
« Válasz #5 Dátum: 2012. Május 26. - 17:36:30 »
0 Show voters
Köszönöm Bence!Ment a +!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal