14.04.2010, 18:04
Could anyone help me put a TextDraw a timer showing the time for only the players of that particular gang are attacking the gang area.
Position stopwatch wanted to stay on as in the photo below
Command below:
Thanks to those who help me thanks same. :P
Position stopwatch wanted to stay on as in the photo below
Command below:
Код:
public GangZoneTimer() { for(new i = 0 ; i < MAX_PLAYERS ; i++) { for(new j=0; j<MAX_GZS; j++) { PayPlayerInGz(i, j, GangZonePos[j][0], GangZonePos[j][1], GangZonePos[j][2], GangZonePos[j][3], 500); if(IsPlayerInTerritory(i, j)) { if(playerGang[i] > 0) { if(playerGang[i] != GangZoneOwner[j]) { if(GangZoneUnderAttack[j] == 1) { if(GangZoneWave[j][playerGang[i]] < 15) { GangZoneWave[j][playerGang[i]] = 0; } } if(GangZoneWave[j][playerGang[i]] < 15) { GangZoneWave[j][playerGang[i]] ++; } if(GangZoneWave[j][playerGang[i]] >= 15 && GangZoneWave[j][playerGang[i]] < 100) { if(GangZoneUnderAttack[j] == 0) { if(GangZoneOwner[j] < 999) { new string[256]; format(string, sizeof(string), "~n~ ~n~ ~n~ ~n~ ~n~~w~Gang ~r~%s ~w~attacking this area ~y~%s ~w~the gang ~r~%s", gangNames[playerGang[i]], GangZoneName[j], gangNames[GangZoneOwner[j]]); GameTextForAll(string, 5000, 3); } if(GangZoneOwner[j] == 999) { new string[256]; format(string, sizeof(string), "~n~ ~n~ ~n~ ~n~ ~n~~w~Gang ~r~%s ~w~attacking this area ~y~%s", gangNames[playerGang[i]], GangZoneName[j]); GameTextForAll(string, 5000, 3); } GangZoneFlashForAll(GangZone[j], gangInfo[playerGang[i]][2]); GangZoneUnderAttack[j] = 1; } GangZoneWave[j][playerGang[i]] ++; } if(GangZoneWave[j][playerGang[i]] == 100) { if(GangZoneOwner[j] < 999) { new string[256]; format(string, sizeof(string), "~n~ ~n~ ~n~ ~n~ ~n~~w~Gang ~r~%s ~w~conquered the area ~y~%s ~w~the gang ~r~%s", gangNames[playerGang[i]], GangZoneName[j], gangNames[GangZoneOwner[j]]); GameTextForAll(string, 5000, 3); } if(GangZoneOwner[j] == 999) { new string[256]; format(string, sizeof(string), "~n~ ~n~ ~n~ ~n~ ~n~~w~Gang ~r~%s ~w~conquered the area ~y~%s", gangNames[playerGang[i]], GangZoneName[j]); GameTextForAll(string, 5000, 3); } GangZoneUnderAttack[j] = 0; GangZoneWave[j][playerGang[i]] = 0; GangZoneColor[j] = gangInfo[playerGang[i]][2]; GangZoneOwner[j] = playerGang[i]; GangZoneStopFlashForAll(GangZone[j]); GangZoneHideForAll(GangZone[j]); GangZoneShowForAll(GangZone[j], GangZoneColor[j]); } } } } else { if(GangZoneWave[j][playerGang[i]] > 0 && GetCountOnTerritory(playerGang[i], j) == 0) { if(GangZoneUnderAttack[j] == 1) { if(GangZoneWave[j][playerGang[i]] >= 15) { new string[256]; format(string, sizeof(string), "~r~His gang not conquered the area ~y~%s", GangZoneName[j]); GameTextForGang(playerGang[i], string); GangZoneUnderAttack[j] = 0; GangZoneWave[j][playerGang[i]] = 0; GangZoneStopFlashForAll(GangZone[j]); GangZoneHideForAll(GangZone[j]); GangZoneShowForAll(GangZone[j], GangZoneColor[j]); } } GangZoneWave[j][playerGang[i]] = 0; } } } } return 1; }
Код:
public GangZoneTextTimer(playerid, GzID) { TextDrawHideForPlayer(playerid, GangZoneText[playerid]); if(IsPlayerConnected(playerid) && IsPlayerInTerritory(playerid, GzID)) { if(GangZoneOwner[GzID] == 999) { GangZoneText[playerid] = TextDrawCreate(480.000000,425.000000,"~w~Zone ~r~No Owner"); TextDrawAlignment(GangZoneText[playerid],0); TextDrawBackgroundColor(GangZoneText[playerid],0x000000ff); TextDrawFont(GangZoneText[playerid],1); TextDrawLetterSize(GangZoneText[playerid],0.399999,1.000000); TextDrawColor(GangZoneText[playerid],0xffffffff); TextDrawSetOutline(GangZoneText[playerid],1); TextDrawSetProportional(GangZoneText[playerid],1); TextDrawSetShadow(GangZoneText[playerid],1); } else { new string[256]; format(string, sizeof(string), "~w~Zone Gang: ~r~%s", gangNames[GangZoneOwner[GzID]]); GangZoneText[playerid] = TextDrawCreate(480.000000,425.000000,string); TextDrawAlignment(GangZoneText[playerid],0); TextDrawBackgroundColor(GangZoneText[playerid],0x000000ff); TextDrawFont(GangZoneText[playerid],1); TextDrawLetterSize(GangZoneText[playerid],0.399999,1.000000); TextDrawColor(GangZoneText[playerid],0xffffffff); TextDrawSetOutline(GangZoneText[playerid],1); TextDrawSetProportional(GangZoneText[playerid],1); TextDrawSetShadow(GangZoneText[playerid],1); } } else { new string[256]; format(string, sizeof(string), "~w~Zone not controllable"); GangZoneText[playerid] = TextDrawCreate(480.000000,425.000000,string); TextDrawAlignment(GangZoneText[playerid],0); TextDrawBackgroundColor(GangZoneText[playerid],0x000000ff); TextDrawFont(GangZoneText[playerid],1); TextDrawLetterSize(GangZoneText[playerid],0.399999,1.000000); TextDrawColor(GangZoneText[playerid],0xffffffff); TextDrawSetOutline(GangZoneText[playerid],1); TextDrawSetProportional(GangZoneText[playerid],1); TextDrawSetShadow(GangZoneText[playerid],1); } TextDrawShowForPlayer(playerid, GangZoneText[playerid]); return 1; }