Botan
Изучающий
- Регистрация
- 22 Янв 2013
- Сообщения
- 415
- Лучшие ответы
- 0
- Репутация
- 195
Здравствуйте. Выкладываю свой TextDraw при /capture. То что Автор я, может доказать Sergo.
Ко всем new:
PHP:
new CaptureOn[MAX_PLAYERS];
new PlayerText:CaptureTime[MAX_PLAYERS];
new PlayerText:CaptureWar[MAX_PLAYERS];
new PlayerText:CaptureGang[MAX_PLAYERS];
PHP:
stock CaptureTextDraws(playerid)
{
CaptureTime[playerid] = CreatePlayerTextDraw(playerid,95.00000, 290.00000, "Time:~r~ 00:00");
PlayerTextDrawBackgroundColor(playerid,CaptureTime[playerid], 255);
PlayerTextDrawAlignment(playerid,CaptureTime[playerid], 2);
PlayerTextDrawLetterSize(playerid,CaptureTime[playerid], 0.330000, 1.000000);
PlayerTextDrawFont(playerid,CaptureTime[playerid],2);
PlayerTextDrawColor(playerid,CaptureTime[playerid], COLOR_GREEN);
PlayerTextDrawSetOutline(playerid,CaptureTime[playerid],1);
PlayerTextDrawSetProportional(playerid,CaptureTime[playerid],1);
PlayerTextDrawSetShadow(playerid,CaptureTime[playerid],1);
PlayerTextDrawHide(playerid, CaptureTime[playerid]);
CaptureWar[playerid] = CreatePlayerTextDraw(playerid,95.00000, 300.00000, "Vagos: ~w~10");
PlayerTextDrawBackgroundColor(playerid,CaptureWar[playerid], 255);
PlayerTextDrawAlignment(playerid,CaptureWar[playerid], 2);
PlayerTextDrawLetterSize(playerid,CaptureWar[playerid], 0.330000, 1.000000);
PlayerTextDrawFont(playerid,CaptureWar[playerid],2);
PlayerTextDrawColor(playerid,CaptureWar[playerid], COLOR_GREEN);
PlayerTextDrawSetOutline(playerid,CaptureWar[playerid],1);
PlayerTextDrawSetProportional(playerid,CaptureWar[playerid],1);
PlayerTextDrawSetShadow(playerid,CaptureWar[playerid],1);
PlayerTextDrawHide(playerid, CaptureWar[playerid]);
CaptureGang[playerid] = CreatePlayerTextDraw(playerid,95.00000, 310.00000, "Ballas: ~w~12");
PlayerTextDrawBackgroundColor(playerid,CaptureGang[playerid], 255);
PlayerTextDrawAlignment(playerid,CaptureGang[playerid], 2);
PlayerTextDrawLetterSize(playerid,CaptureGang[playerid], 0.330000, 1.000000);
PlayerTextDrawFont(playerid,CaptureGang[playerid],2);
PlayerTextDrawColor(playerid,CaptureGang[playerid], COLOR_GREEN);
PlayerTextDrawSetOutline(playerid,CaptureGang[playerid],1);
PlayerTextDrawSetProportional(playerid,CaptureGang[playerid],1);
PlayerTextDrawSetShadow(playerid,CaptureGang[playerid],1);
PlayerTextDrawHide(playerid, CaptureGang[playerid]);
}
PHP:
CaptureOn[playerid] = 0;
PHP:
if(CaptureOn[playerid] == 1)
{
CaptureOn[playerid] = 0;
PlayerTextDrawDestroy(playerid, CaptureTime[playerid]);
PlayerTextDrawDestroy(playerid, CaptureGang[playerid]);
PlayerTextDrawDestroy(playerid, CaptureWar[playerid]);
}
PHP:
public GzCheck()
{
for(new i = 0; i < sizeof(GZInfo); i++)
{
new OnZONE[130][20];
if(ZoneOnBattle[i] == 1)
{
if(GZSafeTime[i] > 0)
{
GZSafeTime[i] --;
}
foreach(new x : Player)
{
new faction = PlayerInfo[x][pMember];
if(faction == GZInfo[i][gNapad] || faction == GZInfo[i][gFrakVlad])
{
if(PlayerToKvadrat(x,GZInfo[i][gCoords][0], GZInfo[i][gCoords][1],GZInfo[i][gCoords][2],GZInfo[i][gCoords][3]))
{
if(ZoneOnBattle[i] == 1)
{
OnZONE[i][faction] ++;
}
}
}
}
foreach(new x : Player)
{
new string[200];
new y = PlayerInfo[x][pMember];
if(y == GZInfo[i][gNapad] || y == GZInfo[i][gFrakVlad])
{
if(CaptureOn[x] == 0)
{
CaptureTextDraws(x);
PlayerTextDrawShow(x, CaptureTime[x]);
PlayerTextDrawShow(x, CaptureGang[x]);
PlayerTextDrawShow(x, CaptureWar[x]);
CaptureOn[x] = 1;
}
format(string,120,"~y~Time:~w~ %s",Convert(GZSafeTime[i]));
PlayerTextDrawSetString(x,CaptureTime[x],string);
format(string,120,"~y~%s:~w~ %d",GetGangName(GZInfo[i][gNapad]),OnZONE[i][GZInfo[i][gNapad]]);
PlayerTextDrawSetString(x,CaptureGang[x],string);
format(string,120,"~y~%s:~w~ %d",GetGangName(GZInfo[i][gFrakVlad]),OnZONE[i][GZInfo[i][gFrakVlad]]);
PlayerTextDrawSetString(x,CaptureWar[x],string);
//OnZONE[i][y] = 0;
}
}
new asd;
for(new x; x < 20; x++)
{
if(OnZONE[i][x] > 0 && IsInAllowedF(x) && GZSafeTime[i] <= 0) asd++;
}
if(asd == 1)
{
new string[200];
for(new z = 0; z < 20; z++)
{
if(OnZONE[i][z] > 0)
{
new zx,zl;
zx = z;
zl = i;
if(GZInfo[i][gFrakVlad] == z)
{
SendFamilyMessage(GZInfo[i][gFrakVlad],0x00B953AA,"Вы отстояли свою территорию");
SendFamilyMessage(GZInfo[i][gNapad],0xC56565AA,"Вам не удалось захватить территорию");
foreach(new y : Player)
{
if(PlayerInfo[y][pMember] == GZInfo[i][gNapad] || PlayerInfo[y][pMember] == GZInfo[i][gFrakVlad])
{
CaptureOn[y] = 0;
PlayerTextDrawDestroy(y, CaptureTime[y]);
PlayerTextDrawDestroy(y, CaptureGang[y]);
PlayerTextDrawDestroy(y, CaptureWar[y]);
}
}
}
else
{
SendFamilyMessage(GZInfo[i][gNapad], 0x00B953AA,"Вы взяли под свой контроль новую территорию");
for(new y = 0; y < sizeof(GZInfo); y++)
{
if(GZInfo[y][gFrakVlad] == 12) TotalGzB++;
if(GZInfo[y][gFrakVlad] == 13) TotalGzV++;
if(GZInfo[y][gFrakVlad] == 15) TotalGzG++;
if(GZInfo[y][gFrakVlad] == 17) TotalGzA++;
if(GZInfo[y][gFrakVlad] == 18) TotalGzR++;
}
switch(GZInfo[i][gNapad])
{
case 12:
{
format(string, sizeof(string), "Теперь ваша банда будет получать каждый час %d вирт",TotalGzB*300);
SendFamilyMessage(GZInfo[i][gNapad], 0x00B953AA, string);
}
case 13:
{
format(string, sizeof(string), "Теперь ваша банда будет получать каждый час %d вирт",TotalGzV*300);
SendFamilyMessage(GZInfo[i][gNapad], 0x00B953AA, string);
}
case 15:
{
format(string, sizeof(string), "Теперь ваша банда будет получать каждый час %d вирт",TotalGzG*300);
SendFamilyMessage(GZInfo[i][gNapad], 0x00B953AA, string);
}
case 17:
{
format(string, sizeof(string), "Теперь ваша банда будет получать каждый час %d вирт",TotalGzA*300);
SendFamilyMessage(GZInfo[i][gNapad], 0x00B953AA, string);
}
case 18:
{
format(string, sizeof(string), "Теперь ваша банда будет получать каждый час %d вирт",TotalGzR*300);
SendFamilyMessage(GZInfo[i][gNapad], 0x00B953AA, string);
}
}
SendFamilyMessage(GZInfo[i][gFrakVlad], 0xC56565AA,"Вы потеряли контроль одной из своих территорий");
foreach(new y : Player)
{
if(PlayerInfo[y][pMember] == GZInfo[i][gNapad] || PlayerInfo[y][pMember] == GZInfo[i][gFrakVlad])
{
CaptureOn[y] = 0;
PlayerTextDrawDestroy(y, CaptureTime[y]);
PlayerTextDrawDestroy(y, CaptureGang[y]);
PlayerTextDrawDestroy(y, CaptureWar[y]);
}
}
}
captures--;
ItsWar[GZInfo[i][gNapad]] = -1;
ItsWar[GZInfo[i][gFrakVlad]] = -1;
ClearTotalGz();
ZoneOnBattle[zl] = 0;
GZInfo[zl][gNapad] = 0;
GZInfo[zl][gFrakVlad] = zx;
GangZoneStopFlashForAll(GZInfo[zl][gID]);
GangZoneHideForAll(GZInfo[zl][gID]);
GangZoneShowForAll(GZInfo[zl][gID],GetGangZoneColor(zl));
SaveGZ();
if(captures == 0)
{
KillTimer(GzCheckTimer);
GzCheckOn = 0;
}
break;
}
}
}
}
}
}
Автор - Botan.
Понравилось ? Жду +сика
Последнее редактирование: