Quote:
Originally Posted by vvhy
game text makes people lag when its a countdown, I've tried it
|
Try this one then. Just created for you [UNTESTED]
pawn Код:
//Countdown
forward CountDown(playerid, seconds);
public CountDown(playerid, seconds)
{
new string[50];
if(seconds > 0)
{
new Text:TextdrawCT;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "~R~%d", seconds);
TextdrawCT = TextDrawCreate(262.000000, 163.000000, "string");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -16776961);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
PlayerPlaySound(playerid, 1056, X, Y, Z);
TextDrawShowForPlayer(playerid,TextdrawCT);
seconds = seconds -1;
SetTimerEx("CountDown", 1000, 0, "ii", playerid, seconds);
return 1;
}
if(seconds == 0)
{
new Text:TextdrawCT1;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
PlayerPlaySound(playerid, 1057, X, Y, Z);
TextdrawCT = TextDrawCreate(262.000000, 163.000000, "GO..");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -16776961);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
TogglePlayerControllable(playerid, 1);
return 1;
}
return 1;
}