[Help] Saving Character online time.
#2

here is a quick one I made up :P

pawn Код:
#include <a_samp>

forward GameTime(playerid);

new gtm[MAX_PLAYERS] = 0;
new gth[MAX_PLAYERS] = 0;
public OnPlayerConnect(playerid)
{
    SetTimerEx("GameTime",60000,1,"i",playerid);
    return 1;
}

public GameTime(playerid)
{
    if(gtm[playerid]<60)
    {
      gtm[playerid]++;
    }
    if(gtm[playerid] == 60)
    {
      gth[playerid]++;
      gtm[playerid] = 0;
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/gametime", cmdtext, true, 10) == 0)
    {
        new string[128];
        format(string,sizeof(string),"You Have Been On This Server For %i hours and %i minutes!",gth[playerid],gtm[playerid]);
        SendClientMessage(playerid,COLOR,string);
        return 1;
    }
    return 0;
}
NOT TESTED
Reply


Messages In This Thread
[Help] Saving Character online time. - by Mowgli - 01.09.2009, 00:09
Re: [Help] Saving Character online time. - by Yuryfury - 01.09.2009, 02:01
Re: [Help] Saving Character online time. - by brett7 - 01.09.2009, 02:02
Re: [Help] Saving Character online time. - by snoob - 01.09.2009, 04:41
Re: [Help] Saving Character online time. - by Abernethy - 01.09.2009, 05:52

Forum Jump:


Users browsing this thread: 1 Guest(s)