Server time
#1

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);
Reply
#2

Nevermind
Reply
#3

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);
Reply
#4

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);
Reply
#5

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
Reply
#6

Fixed allready. solved myself
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)