SA-MP Forums Archive
[HELP]add time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]add time (/showthread.php?tid=224253)



[HELP]add time - Elviss - 11.02.2011

Hello!
If i onilne on the server add 1 Seconds this works.
If have two add 2 Seconds more.
What i need add here
pawn Код:
public Seconds()
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        {
            PlayerInfo[i][pConnectSeconds] += 1;
            return 1;
        }
    }
    return 1;
}
pawn Код:
SecondsTimer = SetTimer("Seconds", 1000, true);
If you need the FS i add the later


Re: [HELP]add time - Mean - 11.02.2011

pawn Код:
public Seconds( )
{
    for ( new i = 0; i < MAX_PLAYERS; i++ )// Changed GetMaxPlayers, because MAX_PLAYERS is faster!
    {
        PlayerInfo[ i ][ pConnectSeconds ] ++; // Changed some stuff in this line.
        return 1;
    }
}
Removed also 2 unneeded brackets!


Re: [HELP]add time - Elviss - 11.02.2011

If have two player
id 0 have works and id 1 not work:S


Re: [HELP]add time - Elviss - 11.02.2011

This have noting :P


Re: [HELP]add time - HyperZ - 11.02.2011

Quote:
Originally Posted by Elviss
Посмотреть сообщение
If have two player
id 0 have works and id 1 not work:S
Change:
pawn Код:
SecondsTimer = SetTimer("Seconds", 1000, true);
To:
pawn Код:
SecondsTimer = SetTimerEx("Seconds", 1000, true , "i" ,playerid);



Re: [HELP]add time - Elviss - 11.02.2011

fuck not work :S


Re: [HELP]add time - dice7 - 11.02.2011

pawn Код:
public Seconds()
{
    for(new i = 0, max = GetMaxPlayers(); i < max; i++)
    {
        {
            PlayerInfo[i][pConnectSeconds] += 1;
        }
    }
    return 1;
}


SecondsTimer = SetTimer("Seconds", 1000, true);



Re: [HELP]add time - Elviss - 11.02.2011

pawn Код:
C:\Users\Elvis\Desktop\Massive0.3c\filterscripts\TimeFS.pwn(129) : warning 219: local variable "max" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.



Re: [HELP]add time - Mean - 11.02.2011

Quote:
Originally Posted by Elviss
Посмотреть сообщение
pawn Код:
C:\Users\Elvis\Desktop\Massive0.3c\filterscripts\TimeFS.pwn(129) : warning 219: local variable "max" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Means that you already got "max" defined somewhere, delete it.