Time Update
#1

Код:
C:\Users\i5\Desktop\Script\gamemodes\test.pwn(4140) : error 017: undefined symbol "SetVipTime"
D:\Users\i5\Desktop\Script\gamemodes\test.pwn(4140) : warning 215: expression has no effect
D:\Users\i5\Desktop\Script\gamemodes\test.pwn(4140) : error 001: expected token: ";", but found "]"
D:\Users\i5\Desktop\Script\gamemodes\test.pwn(4140) : error 029: invalid expression, assumed zero
D:\Users\i5\Desktop\Script\gamemodes\test.pwn(4140) : fatal error 107: too many error messages on one line

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


4 Errors.
Code:

Код:
forward TimeUpdate();

public TimeUpdate()
{

	 if (gTimeStats[1] < 59)
 	 {
 	 	gTimeStats[1] ++;
 	 }
	 else
 	 {
  		gTimeStats[1] = 0;
  		gTimeStats[0] = gTimeStats[0] < 23 ? gTimeStats[0] + 1 : 0;
 	 }
 	 new string1[24];
 	 if (gTimeStats[0] < 10)
 	 {
  		if (gTimeStats[1] < 10) format(string1, 12, "0%d:0%d", gTimeStats[0], gTimeStats[1]);
  		else format(string1, 12, "0%d:%d", gTimeStats[0], gTimeStats[1]);
 	 }
	 else
 	 {
  		if (gTimeStats[1] < 10) format(string1, 12, "%d:0%d", gTimeStats[0], gTimeStats[1]);
  		else format(string1, 12, "%d:%d", gTimeStats[0], gTimeStats[1]);
 	 }
 	 for(new i = 0; i < PLAYERS; i++)
	 {
		if(SetVipTime[i] == 0)
		{
	 		 SetPlayerTime(i, gTimeStats[0], gTimeStats[1]);
		}
	 }
 	 TextDrawSetString(Clock, string1);

}
Can someone help me with fixing it? I tried stuff myself but can't fix it.
Reply
#2

Undefined symbol if(SetVipTime[i] == 0)

The cause may be: You don't have created that define/stock/public , take a look
Reply
#3

Код:
CMD:setviptime(playerid, params[])
{
	new hour, minute;
    if(vip[playerid] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Only VIPs can use this command!");
	if(sscanf(params, "dd", hour, minute)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /vtime [hour] [minutes]");
	SetPlayerTime(playerid, hour, minute);
    SetVipTime[playerid] = 1;
	return 1;
}
Runs fine without the define, weird i guess. Can you help me make a define? or show me how it's done.
Reply
#4

probably you got SetVipTime not defined yet on public function, simply move the TimeUpdate function codes under after setviptime commands.
Reply
#5

I suggest you to use this instead https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#6

Thanks , i got it fixed by adding this at the top of the gamemode:

new SetVipTime[PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)