SetTimer("UpdateMapTimer", 1000, 1);
public UpdateMapTimer()
{
foreach (Player, i)
{
TextDrawShowForPlayer(i, Mapdraw0);
}
return 1;
}
public UpdateMapTimer()
{
foreach (Player, i)
{
TextDrawHideForPlayer(i, Mapdraw0);
TextDrawShowForPlayer(i, Mapdraw0);
}
return 1;
}
new bool:mapTextDrawShowing[MAX_PLAYERS]; // On top
public UpdateMapTimer()
{
foreach (Player, i)
{
if(mapTextDrawShowing[i])
// Set Map Showing Variable to: FALSE
mapTextDrawShowing[i] = false;
// Return Hide Function
return TextDrawHideForPlayer(i, Mapdraw0);
} else {
// Set Map Showing Variable to: TRUE
mapTextDrawShowing[i] = true;
// Return Show Function
return TextDrawShowForPlayer(i, Mapdraw0);
}
}
return 1;
}
Trying do make textdraw update every second but won't do it.
Gamemodeint Код:
SetTimer("UpdateMapTimer", 1000, 1); PHP код:
|
Trying do make textdraw update every second but won't do it.
PHP код:
|
TextDrawSetString(Mapdraw0, string);
What do you want exactly?
Your first code will show only the textdraw in every second. Do you want update the text of the textdraw? Use this: Код:
TextDrawSetString(Mapdraw0, string); |
public OnGamemodeInit()
{
SetTimer("UpdateMapTimer", 1000, false);
return 1;
}
public UpdateMapTimer()
{
foreach (Player, i)
{
TextDrawShowForPlayer(i, Mapdraw0);
SetTimer("UpdateMapTimer2",1000,false);
}
return 1;
}
forward UpdateMapTimer2();
public UpdateMapTimer2()
{
foreach(player,i)
{
TextDrawHideForPlayer(i,Mapdraw0);
TextDrawSetString(Mapdraw0,"New Map Name 2");
SetTimer("UpdateMapTimer3",1000,false);
}
return 1;
}
forward UpdateMapTimer3();
public UpdateMapTimer3()
{
foreach(player,i)
{
TextDrawHideForPlayer(i,Mapdraw0);
TextDrawSetString(Mapdraw0,"New Map Name 3");
SetTimer("UpdateMapTimer",1000,false);
}
return 1;
}//Back to Map 1 , Keep do It
PHP код:
And dont Forget to Change String"" ! |
public OnPlayerConnect(playerid) { TextDrawShowForPlayer(playerid, Mapdraw0); return 1; }
public UpdateMapTimer() { foreach (Player, i) { new string[25]; new hour,minute,second; gettime(hour,minute,second); format(string, sizeof(string), "Time: %d:%d:%d", hour,minute,second); TextDrawSetString(Mapdraw0, string); } return 1; }