[HELP] Activity for player
#1

He wanted make command activity for players online and offline, but I pretended not to expel me if the name of the player offline just eject the current player who is online on the server.

PHP код:
enum pInfo
            pDani
,
            
pMinutes,
            
pHours,
            
pSeconds
new PlayerInfo[MAX_PLAYERS][pInfo]; 
PHP код:
                format(var, 64"Dani=%d\n",PlayerInfo[playerid][pDani]);fwrite(hFile, var);
                
format(var, 64"Minutes=%d\n",PlayerInfo[playerid][pMinutes]);fwrite(hFile, var);
                
format(var, 64"Hours=%d\n",PlayerInfo[playerid][pHours]);fwrite(hFile, var);
                
format(var, 64"Seconds=%d\n",PlayerInfo[playerid][pSeconds]);fwrite(hFile, var); 
PHP код:
public OnPlayerConnect(playerid)
{
    
SetTimerEx("Aktivnost"1000true"i"playerid);

PHP код:
forward Aktivnost();
public 
Aktivnost()
{
    foreach (
Playeri)
    {
        
PlayerInfo[i][pSeconds] += 1;
        if (
PlayerInfo[i][pSeconds] == 60)
        {
            
PlayerInfo[i][pMinutes] += 1;
            
PlayerInfo[i][pSeconds] = 0;
        }
        if (
PlayerInfo[i][pMinutes] == 60)
        {
            
PlayerInfo[i][pHours] += 1;
            
PlayerInfo[i][pMinutes] = 0;
        }
        if (
PlayerInfo[i][pHours] == 24)
        {
            
PlayerInfo[i][pDani] += 1;
            
PlayerInfo[i][pHours] = 0;
        }
    }
    return 
1;

PHP код:
CMD:aktivnost(playerid,params[])
{
 new 
aktivnost[2024];      format(aktivnost,2024,"%s{FF0000}|----------------------------------------------------------------------|\n",aktivnost);
   for(new 
place 0place != 30; ++place)
    {
    new 
Days PlayerInfo[place][pDani];
    new 
Hours PlayerInfo[place][pHours];
    new 
Minutes PlayerInfo[place][pMinutes];
    new 
Seconds PlayerInfo[place][pSeconds];//
    
format(aktivnost,2024,"%s{FF0000}%d. {FFFFFF}%s: %d dana %d h %d min %d sec\n",aktivnost,place 1,ImeIgracaaa(place),DaysHoursMinutesSeconds);
    }
    
format(aktivnost,2024,"%s{FF0000}|----------------------------------------------------------------------|\n\n",aktivnost);
    
ShowPlayerDialog(playerid713DIALOG_STYLE_MSGBOX"{FF0000}GAMING {FFFFFF} Top Lista 30 sa najvise ne-afk vreme na serveru"aktivnost"OK""OK");
    return 
1;

Reply


Messages In This Thread
[HELP] Activity for player - by Markoni990 - 17.03.2015, 13:20
Re: [HELP] Activity for player - by Ciarannn - 17.03.2015, 16:51
Respuesta: [HELP] Activity for player - by Markoni990 - 17.03.2015, 17:16
Respuesta: [HELP] Activity for player - by Markoni990 - 18.03.2015, 09:17
Respuesta: [HELP] Activity for player - by Markoni990 - 19.03.2015, 10:48
Respuesta: [HELP] Activity for player - by Markoni990 - 19.03.2015, 20:01
Respuesta: [HELP] Activity for player - by Markoni990 - 21.03.2015, 11:10
Respuesta: [HELP] Activity for player - by Markoni990 - 22.03.2015, 17:07
Respuesta: [HELP] Activity for player - by Markoni990 - 22.03.2015, 23:56
Re: [HELP] Activity for player - by SickAttack - 23.03.2015, 05:48

Forum Jump:


Users browsing this thread: 1 Guest(s)