28.06.2014, 09:10
Hi, I'm using this script for my clock system:
And I get this warning after compiling
The problem line is
Please help me solve this..
pawn Код:
#include <a_samp>
#define WHITE 0xFFFFFFAA
new Text:Servt;
new Tsec;
new THrs;
public OnFilterScriptInit()
{
SetWorldTime(Servt);
Servt = TextDrawCreate(545, 31, "00:00");
TextDrawColor(Servt, WHITE);
Tsec= 0;
THrs= 0;
SetTimer("TimeU", 60000,true);
return 1;
}
public OnFilterScriptExit()
{
TextDrawDestroy(Servt);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Servt);
return 1;
}
forward TimeU(playerid);
public TimeU(playerid)
{
new string[7]; // it makes a variable for a string with size 128
Tsec+=1; //this adds 1 to the existing time variable
if(Tsec==60) { //this resets the mins to 00 one it reaches 60
Tsec=00;
THrs+=1; //this adds 1 to the hours every 60 seconds
}
if(THrs==24) { //This Checks if time is 24:00
Tsec=00; //This Sets resets Mins
THrs=0; //this Resets Hours
}
if(Tsec<10) { // This Adds a 0 Before The Mins Display For it To look like an actual clock
//formats string
format(string,sizeof(string),"%d:%d0",THrs,Tsec);
}
if(Tsec>10) { // This Removes a 0 Before The Mins Display after it has reached 10
//formats string
format(string,sizeof(string),"%d:%d",THrs,Tsec);
}
if(THrs<10) {
//formats string
format(string,sizeof(string),"0%d:%d",THrs,Tsec);
}
for(new i; i<MAX_PLAYERS; i++) { //loops through all players
if(IsPlayerConnected(i)) { //checks if the player is connected
SetPlayerTime(i,THrs,Tsec); //sets All players time
}
}
TextDrawSetString(Servt,string); //updates the textdraw
}
Код:
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\filterscripts\clock.pwn(11) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
pawn Код:
SetWorldTime(Servt);