SA-MP Forums Archive
Server 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)
+--- Thread: Server time (/showthread.php?tid=324632)



Server time - GNGification - 10.03.2012

I feel stupid right now... but what is wrong with this?

Код:
new Float:RandomTime[][4] =
{
    {12.00},
    {17.00},
    {20.00},
    {01.00}
};

public Time()
{
    SetPlayerTime(RandomTime);
	return 1;
}
Error:
Код:
H:\Pawno\pawno\LS.pwn(1018) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And yes I have forwarded it

and the error line is:
Код:
SetPlayerTime(RandomTime);



Re: Server time - Reklez - 10.03.2012

Nevermind


Re: Server time - park4bmx - 10.03.2012

many thing are wrong !
pawn Код:
new Float:RandomTime[4][1] =
{
    {20.00},
    {17.00},
    {20.00},
    {01.00}
};

new rand = random(sizeof(RandomTime));
SetPlayerTime(playerid,RandomTime[rand][0],0);



Re: Server time - GNGification - 10.03.2012

allready tried but then it gives this: (for both answers)
Код:
H:\Pawno\pawno\LS.pwn(1019) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
and the new code =
Код:
new Float:RandomTime[4][1] =
{
    {12.00},
    {17.00},
    {20.00},
    {01.00}
};

public Time()
{
    new rand = random(sizeof(RandomTime));
    SetPlayerTime(playerid,RandomTime[rand][0],0);
    return 1;
}
and the problem line is SetPlayerTime(playerid,RandomTime[rand][0],0);


Re: Server time - park4bmx - 10.03.2012

Quote:
Originally Posted by GNGification
Посмотреть сообщение
allready tried but then it gives this: (for both answers)
Код:
H:\Pawno\pawno\LS.pwn(1019) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
well use it inside a callback
or loop through players :X or just set the time global
pawn Код:
new rand = random(sizeof(RandomTime));
SetWorldTime(RandomTime[rand][0]);
EDIT
pawn Код:
new RandomTime[4][1] =
{
    {20},
    {17},
    {20},
    {01}
};

    new rand = random(sizeof(RandomTime));
    SetWorldTime(RandomTime[rand][0]);
Change becouse its SetWorldTime and does not need to be a Float


Re: Server time - GNGification - 10.03.2012

Fixed allready. solved myself


Re: Server time - CAR - 10.03.2012

pawn Код:
new RandomTime[4] =
{
    20, 17, 20, 01
};
This should fix it