why am i getting these errors? - 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: why am i getting these errors? (
/showthread.php?tid=69289)
why am i getting these errors? -
CJ101 - 17.03.2009
ok i made a time system for my server, but i get two errors:
Код:
C:\PROGRA~1\ROCKST~1\GTASAN~1\GAMEMO~1\EASTSI~1.PWN(219) : warning 213: tag mismatch
C:\PROGRA~1\ROCKST~1\GTASAN~1\GAMEMO~1\EASTSI~1.PWN(223) : warning 213: tag mismatch
here's my code:
Код:
//top of script
new MyTime;
forward TimeTmr();
public TimeTmr()
{
new newtime;
newtime = MyTime + 1.00; //line 219
MyTime = newtime;
if(MyTime == 24.00)
{
MyTime = 0.00; //line 223
}
return 0;
}
Re: why am i getting these errors? -
On_Top_Non_Stop - 17.03.2009
To use decimal points in a variable it needs to be a float so change new
MyTime; to
new Float:MyTime; and
new newtime; to
new Float:new newtime;.
Re: why am i getting these errors? -
CJ101 - 17.03.2009
also, the command does not display the time:
Код:
if(strcmp(cmdtext, "/time", true) == 0)
{
new string[126];
format(string, 256, "[TIME]: %s", MyTime);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;
}
Re: why am i getting these errors? -
Kinetic - 17.03.2009
Quote:
Originally Posted by On_Top_Non_Stop
To use decimal points in a variable it needs to be a float so change new MyTime; to new Float:MyTime; and new newtime; to new Float:new newtime;.
|
Time is not done in floats.
Re: why am i getting these errors? -
CJ101 - 17.03.2009
Quote:
Originally Posted by Kinetic
Quote:
Originally Posted by On_Top_Non_Stop
To use decimal points in a variable it needs to be a float so change new MyTime; to new Float:MyTime; and new newtime; to new Float:new newtime;.
|
Time is not done in floats.
|
well, the time system works.
can someone check that command?
Re: why am i getting these errors? -
propilot - 17.03.2009
it warning not error ;o
Re: why am i getting these errors? -
On_Top_Non_Stop - 17.03.2009
Quote:
Originally Posted by Kinetic
Quote:
Originally Posted by On_Top_Non_Stop
To use decimal points in a variable it needs to be a float so change new MyTime; to new Float:MyTime; and new newtime; to new Float:new newtime;.
|
Time is not done in floats.
|
Hmm, how did i miss that O.o
pawn Код:
if(strcmp(cmdtext, "/time", true) == 0)
{
new string[10];
format(string, sizeof(string), "[TIME]: %d", MyTime);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;
}
Remove the
Float: from MyTime and newtime and to set the variables do MyTime +=1;, MyTime +=2; etc and don't add a decimal point.