13.01.2017, 00:18
Works but i can't see textdraw when player capturing
Код:
new Text:CountText[MAX_PLAYERS];
Код:
OnPlayerConnect CountText[playerid] = TextDrawCreate(192.000000, 416.000000, "0/25 seconds left to capture"); TextDrawBackgroundColor(CountText[playerid], 255); TextDrawFont(CountText[playerid], 1); TextDrawLetterSize(CountText[playerid], 0.460000, 1.900000); TextDrawColor(CountText[playerid], -1); TextDrawSetOutline(CountText[playerid], 1); TextDrawSetProportional(CountText[playerid], 1);
Код:
forward CountDown(); public CountDown() { foreach(Player, playerid) { if(IsPlayerInDynamicCP(playerid, CP[CAPZONE]) && UnderAttack[CAPZONE] == 1 && IsPlayerCapturing[playerid][CAPZONE] == 1) { CountVar[playerid][CAPZONE]--; new str1[124]; TextDrawShowForPlayer(playerid, CountText[playerid]); format(str1, sizeof(str1),"~r~%d/~y~25 ~w~seconds left ~g~to capture", CountVar[playerid][CAPZONE]); TextDrawSetString(CountText[playerid], str1); } if(IsPlayerInDynamicCP(playerid, CP[SNAKE]) && UnderAttack[SNAKE] == 1 && IsPlayerCapturing[playerid][SNAKE] == 1) { CountVar[playerid][SNAKE]--; new str1[124]; TextDrawShowForPlayer(playerid, CountText[playerid]); format(str1, sizeof(str1),"~r~%d/~y~25 ~w~seconds left ~g~to capture", CountVar[playerid][SNAKE]); TextDrawSetString(CountText[playerid], str1); } if(IsPlayerInDynamicCP(playerid, CP[OLD]) && UnderAttack[OLD] == 1 && IsPlayerCapturing[playerid][OLD] == 1) { CountVar[playerid][OLD]--; new str1[124]; TextDrawShowForPlayer(playerid, CountText[playerid]); format(str1, sizeof(str1),"~r~%d/~y~25 ~w~seconds left ~g~to capture", CountVar[playerid][OLD]); TextDrawSetString(CountText[playerid], str1); } if(IsPlayerInDynamicCP(playerid, CP[Town]) && UnderAttack[Town] == 1 && IsPlayerCapturing[playerid][Town] == 1) { CountVar[playerid][Town]--; new str1[124]; TextDrawShowForPlayer(playerid, CountText[playerid]); format(str1, sizeof(str1),"~r~%d/~y~25 ~w~seconds left ~g~to capture", CountVar[playerid][Town]); TextDrawSetString(CountText[playerid], str1); } } return 1; }