Jump to content

script Odehraný čas


Guest Mort

Recommended Posts

V spoileri je môje počítadlo...zatiaľ je na sekundy ešte ho chcem dať na hodiny ale na to som nenašiel čas "lol"

 

 

#include

#include

#include

#include

#define FILTERSCRIPT

 

 

#if defined FILTERSCRIPT

 

new time[MAX_PLAYERS];

 

public OnFilterScriptInit()

{

print("Blank skript");

return 1;

}

 

public OnFilterScriptExit()

{

return 1;

}

 

new timer1;

forward casovac(playerid);

public OnPlayerConnect(playerid)

{

new f[40];

format(f,40,"%s",PlayerName(playerid));

if(!dini_Exists(f)) {

dini_Create(f);

dini_IntSet(f,"Sekundy",0);

}

if(dini_Exists(f)) {

time[playerid]=dini_Int(f,"Cas_Online");

}

timer1 = SetTimer("casovac",1000,true);

}

public OnPlayerDisconnect(playerid, reason)

{

new f[40];

format(f,40,"%s",PlayerName(playerid));

if(dini_Exists(f)) {

dini_IntSet(f,"Sekundy",time[playerid]);

}

KillTimer(timer1);

return 1;

}

 

public casovac(playerid)

{

time[playerid]++;

}

 

#else

 

main()

{

print("\n----------------------------------");

print(" Blank Gamemode by your name here");

print("----------------------------------\n");

}

 

#endif

 

 

Je to jednoduché..toto som zbúchal keď som začínal s pawnom a trvalo to celé 5minút.

Link to comment
Share on other sites

  • 3 months later...
prosím mohol by niekto napísať aj ukladanie pre dudb

Connect

Minuty[playerid] = dUserINT(PlayerName(playerid)).("Minuty");

disconnect

dUserSetINT(PlayerName(playerid)).("Minuty",Minuty[playerid]);

zbytek si udělej podle toho

v "" je uvedeno jak to bude uložené jako název můžeš si tam třeba napsat minutešqy a to musíš napsat do "" i v disconnectu ... Jinak Minuty[playerid] promenne ..

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...