Problem with arrays [PlayerTime]
#1

Helle everyone!

I have a little problem with an array. I have set an online timer and it saves in a file. It is for saving the online time from players.
But at the end when I finished to script it I get some errors..I dunno really how to fix it. Could someone help pls?


Код:
public PlayerTime(playerid)
{
new i;
for(i=0;i<MAX_PLAYERS;i++)
   if(IsPlayerConnected(i))
   {
   if(Seconds[i] == 0)
   {
   Seconds[i]++;
   }else if(Seconds[i] == 60 && Minutes[i] < 60)
	 {
   Seconds[i] = 0;
   Minutes[i]++;
   }
   if(Minutes[i] == 60 && Hours[i] < 60)
	 {
   Minutes[i] = 0;
   Hours[i]++;
   }
   if(Hours[i] == 60){
   Hours++;
   }
   }
}
ERRORS:

Adminscript.pwn(2711) : error 028: invalid subscript (not an array or too many subscripts): "Seconds"
Adminscript.pwn(2711) : warning 215: expression has no effect
Adminscript.pwn(2711) : error 001: expected token: ";", but found "]"
Adminscript.pwn(2711) : error 029: invalid expression, assumed zero
Adminscript.pwn(2711) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

At this line:

if(Seconds[i] == 0)
Reply
#2

Show how you create the variable Seconds
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)