30.03.2016, 20:39
Im using this turf system(found it while looking for one xD) and compiled it with my gm. It works but not good. I just wanna add a command to show all turfs and which gang owns them. /turfs
PHP код:
#define FILTERSCRIPT
#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS (200)
#include <gangzonesc>
#define TURF_STATE_NORMAL (0)
#define TURF_STATE_ATTACKED (1)
#define TURF_STATE_PROVOKED (2)
#define TURF_REQUIRED_KILLS (3)
#define TURF_REQUIRED_PLAYERS (1)
#define TURF_REQUIRED_CAPTURETIME (2 * 60 * 1000)
#define TURF_REQUIRED_PROVOKETIME (10 * 1000)
#define COLOR_GREEN (0x00CC00FF)
#define COLOR_CHANGE_ALPHA(%1) ((%1 & ~0xFF) | (clamp(100, 0x00, 0xFF)))
enum e_TEAM {
teamName[35],
teamColor
};
enum e_TURF {
turfName[35],
turfOwner,
turfAttacker,
Float: turfPos[4],
turfOwnerKills,
turfAttackerKills,
turfState,
turfTimer,
turfId
};
new const g_Team[][e_TEAM] = {
{"Groves", 0x00FF00FF},
{"Ballas", 0x800080FF},
{"Cops", 0x0080FFFF},
{"Vagos", 0xFFFF00FF},
{"Aztecas", 0x00FFFFFF},
{"Bikers", 0xFF4B00FF},
{"Barbers", 0xA52A2AFF}
};
new const g_Turf[][e_TURF] = {
{"Ganton", 0, NO_TEAM, {2222.50, -1852.80, 2632.80, -1722.30}},
{"Ganton", 0, NO_TEAM, {2222.50, -1722.30, 2632.80, -1628.50}},
{"Idlewood", 0, NO_TEAM, {2124.60, -1742.30, 2222.50, -1494.00}},
{"Idlewood", 0, NO_TEAM, {1971.60, -1852.80, 2222.50, -1742.30}},
{"Willow Field", 0, NO_TEAM, {2324.00, -2059.20, 2541.70, -1852.80}},
{"East Los Santos", 0, NO_TEAM, {2421.00, -1628.50, 2632.80, -1454.30}},
{"East Los Santos", 0, NO_TEAM, {2222.50, -1628.50, 2421.00, -1494.00}},
{"Jefferson", 1, NO_TEAM, {2056.80, -1372.00, 2281.40, -1210.70}},
{"Jefferson", 1, NO_TEAM, {2056.80, -1210.70, 2185.30, -1126.30}},
{"Jefferson", 1, NO_TEAM, {2056.80, -1449.60, 2266.20, -1372.00}},
{"Las Colinas", 1, NO_TEAM, {1994.30, -1100.80, 2056.80, -920.80}},
{"Las Colinas", 1, NO_TEAM, {2056.80, -1126.30, 2126.80, -920.80}},
{"Las Colinas", 1, NO_TEAM, {2185.30, -1154.50, 2281.40, -934.40}},
{"Las Colinas", 1, NO_TEAM, {2126.80, -1126.30, 2185.30, -934.40}},
{"Las Colinas", 1, NO_TEAM, {2632.70, -1135.00, 2747.70, -945.00}},
{"Glen Park", 1, NO_TEAM, {1812.60, -1350.70, 2056.80, -1100.80}},
{"Idlewood", 2, NO_TEAM, {1812.60, -1852.80, 1971.60, -1742.30}},
{"Idlewood", 2, NO_TEAM, {1951.60, -1742.30, 2124.60, -1602.30}},
{"Idlewood", 2, NO_TEAM, {1812.60, -1602.30, 2124.60, -1449.60}},
{"Idlewood", 2, NO_TEAM, {1812.60, -1742.30, 1951.60, -1602.30}},
{"Pershing Square", 2, NO_TEAM, {1327.8929,-1729.3352,1821.7725,-1573.5878}},
{"East Beach", 3, NO_TEAM, {2747.70, -1498.60, 2959.30, -1120.00}},
{"Los Flores", 3, NO_TEAM, {2581.70, -1393.40, 2747.70, -1135.00}},
{"Las Colinas", 3, NO_TEAM, {2281.40, -1135.00, 2632.70, -945.00}},
{"East Los Santos", 3, NO_TEAM, {2266.20, -1494.00, 2381.60, -1372.00}},
{"East Los Santos", 3, NO_TEAM, {2281.60, -1372.00, 2381.60, -1135.00}},
{"East Los Santos", 3, NO_TEAM, {2381.60, -1454.30, 2462.10, -1135.00}},
{"East Los Santos", 3, NO_TEAM, {2462.10, -1454.30, 2581.70, -1135.00}},
{"Willow Field", 5, NO_TEAM, {1970.60, -2179.20, 2089.00, -1852.80}},
{"Willow Field", 5, NO_TEAM, {2089.00, -1989.90, 2324.00, -1852.80}},
{"Willow Field", 5, NO_TEAM, {2089.00, -2235.80, 2201.80, -1989.90}},
{"El Corona", 5, NO_TEAM, {1812.60, -2179.20, 1970.60, -1852.80}},
{"El Corona", 5, NO_TEAM, {1692.60, -2179.20, 1812.60, -1842.20}},
{"Rodeo", 5, NO_TEAM, {-187.7, -1596.76, 17.0632, -1276.6}},
{"Rodeo", 5, NO_TEAM, {422.68, -1570.2, 466.223, -1406.05}},
{"Rodeo", 5, NO_TEAM, {466.223, -1570.2, 558.099, -1385.07}},
{"Rodeo", 5, NO_TEAM, {558.099, -1684.65, 647.522, -1384.93}},
{"Rodeo", 5, NO_TEAM, {422.68, -1684.65, 558.099, -1570.2}},
{"Rodeo", 5, NO_TEAM, {312.803, -1684.65, 422.68, -1501.95}},
{"Rodeo", 5, NO_TEAM, {334.503, -1501.95, 422.68, -1406.05}},
{"Rodeo", 5, NO_TEAM, {647.712, -1804.21, 851.449, -1577.59}},
{"Market", 6, NO_TEAM, {1252.33, -926.999, 1357.0, -910.17}},
{"Market", 6, NO_TEAM, {1252.33, -1026.33, 1391.05, -926.999}},
{"Market", 6, NO_TEAM, {1252.33, -1130.85, 1378.33, -1026.33}},
{"Market", 6, NO_TEAM, {1072.66, -1416.25, 1370.85, -1130.85}},
{"Temple", 6, NO_TEAM, {1391.05, -1026.33, 1463.9, -926.999}},
{"Temple", 6, NO_TEAM, {1378.33, -1130.85, 1463.9, -1026.33}},
{"Downtown LS.", 6, NO_TEAM, {1370.85, -1170.87, 1463.9, -1130.85}},
{"Downtown LS.", 6, NO_TEAM, {1370.85, -1384.95, 1463.9, -1170.87}}
};
new
g_MembersInTurf[sizeof(g_Turf)][sizeof(g_Team)],
PlayerText: g_PlayerTurfTxt[MAX_PLAYERS][3],
PlayerText: g_PlayerTurfNotifyTxt[MAX_PLAYERS][4],
g_PlayerTurfNotifyTimer[MAX_PLAYERS][4]
;
public OnFilterScriptInit() {
new
iTeamTurfs[sizeof(g_Team)]
;
for (new i, j = sizeof(g_Turf); i < j; i++) {
g_Turf[i][turfId] = GangZoneCreate(g_Turf[i][turfPos][0], g_Turf[i][turfPos][1], g_Turf[i][turfPos][2], g_Turf[i][turfPos][3], COLOR_CHANGE_ALPHA(g_Team[g_Turf[i][turfOwner]][teamColor]), 1.8);
g_Turf[i][turfTimer] = -1;
for (new k, l = sizeof(g_Team); k < l; k++) {
g_MembersInTurf[i][k] = 0;
}
iTeamTurfs[g_Turf[i][turfOwner]]++;
}
print(" ");
print("_________________| Turfwar Script |_________________");
print("Attempting to initialize ''turfs.amx''...");
print(" ");
for (new i, j = sizeof(g_Team); i < j; i++) {
printf("Loaded %i turfs for team %s", iTeamTurfs[i], g_Team[i][teamName]);
}
print(" ");
printf("Total %i turfs loaded", sizeof(g_Turf));
print("_________________________________________________");
print(" ");
return 1;
}
public OnFilterScriptExit() {
for (new i, j = sizeof(g_Turf); i < j; i++) {
GangZoneDestroy(g_Turf[i][turfId]);
if (g_Turf[i][turfTimer] != -1) {
KillTimer(g_Turf[i][turfTimer]);
}
g_Turf[i][turfTimer] = -1;
}
return 1;
}
public OnPlayerConnect(playerid) {
g_PlayerTurfTxt[playerid][0] = CreatePlayerTextDraw(playerid,317.000000, 378.000000, "Turfwar in ~b~~h~~h~~h~Gangton");
PlayerTextDrawAlignment(playerid,g_PlayerTurfTxt[playerid][0], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfTxt[playerid][0], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfTxt[playerid][0], 2);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfTxt[playerid][0], 0.240000, 1.200000);
PlayerTextDrawColor(playerid,g_PlayerTurfTxt[playerid][0], -1);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfTxt[playerid][0], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfTxt[playerid][0], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfTxt[playerid][0], 0);
g_PlayerTurfTxt[playerid][1] = CreatePlayerTextDraw(playerid,317.000000, 389.000000, "Grove~w~~h~: ~r~13 ~w~~h~kills with ~r~4 ~w~~h~players");
PlayerTextDrawAlignment(playerid,g_PlayerTurfTxt[playerid][1], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfTxt[playerid][1], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfTxt[playerid][1], 2);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfTxt[playerid][1], 0.180000, 0.899999);
PlayerTextDrawColor(playerid,g_PlayerTurfTxt[playerid][1], 16711935);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfTxt[playerid][1], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfTxt[playerid][1], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfTxt[playerid][1], 0);
g_PlayerTurfTxt[playerid][2] = CreatePlayerTextDraw(playerid,317.000000, 397.000000, "Aztecas~w~~h~: ~r~16 ~w~~h~kills with ~r~7 ~w~~h~players");
PlayerTextDrawAlignment(playerid,g_PlayerTurfTxt[playerid][2], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfTxt[playerid][2], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfTxt[playerid][2], 2);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfTxt[playerid][2], 0.180000, 0.899999);
PlayerTextDrawColor(playerid,g_PlayerTurfTxt[playerid][2], 16777215);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfTxt[playerid][2], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfTxt[playerid][2], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfTxt[playerid][2], 0);
g_PlayerTurfNotifyTxt[playerid][0] = CreatePlayerTextDraw(playerid,317.000000, 348.000000, "~g~We have won the turfwar against the ~b~~h~~h~~h~Grove ~g~in ~b~~h~~h~~h~Gangton ~g~(/turfs)");
PlayerTextDrawAlignment(playerid,g_PlayerTurfNotifyTxt[playerid][0], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfNotifyTxt[playerid][0], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfNotifyTxt[playerid][0], 1);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfNotifyTxt[playerid][0], 0.180000, 0.799999);
PlayerTextDrawColor(playerid,g_PlayerTurfNotifyTxt[playerid][0], -1);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfNotifyTxt[playerid][0], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfNotifyTxt[playerid][0], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfNotifyTxt[playerid][0], 0);
g_PlayerTurfNotifyTxt[playerid][1] = CreatePlayerTextDraw(playerid,317.000000, 355.000000, "~r~We have lost the turfwar against the ~b~~h~~h~~h~Azetecas ~r~in ~b~~h~~h~~h~LS. Beach ~r~(/turfs)");
PlayerTextDrawAlignment(playerid,g_PlayerTurfNotifyTxt[playerid][1], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfNotifyTxt[playerid][1], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfNotifyTxt[playerid][1], 1);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfNotifyTxt[playerid][1], 0.180000, 0.799999);
PlayerTextDrawColor(playerid,g_PlayerTurfNotifyTxt[playerid][1], -1);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfNotifyTxt[playerid][1], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfNotifyTxt[playerid][1], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfNotifyTxt[playerid][1], 0);
g_PlayerTurfNotifyTxt[playerid][2] = CreatePlayerTextDraw(playerid,317.000000, 362.000000, "~y~We have provoked a turfwar again ~b~~h~~h~~h~Vagos ~y~in ~b~~h~~h~~h~Blueberry ~y~(/findwar)");
PlayerTextDrawAlignment(playerid,g_PlayerTurfNotifyTxt[playerid][2], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfNotifyTxt[playerid][2], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfNotifyTxt[playerid][2], 1);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfNotifyTxt[playerid][2], 0.180000, 0.799999);
PlayerTextDrawColor(playerid,g_PlayerTurfNotifyTxt[playerid][2], -1);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfNotifyTxt[playerid][2], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfNotifyTxt[playerid][2], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfNotifyTxt[playerid][2], 0);
g_PlayerTurfNotifyTxt[playerid][3] = CreatePlayerTextDraw(playerid,317.000000, 369.000000, "~y~We have got a turfwar again ~b~~h~~h~~h~Vagos ~y~in ~b~~h~~h~~h~Blueberry ~y~(/findwar)");
PlayerTextDrawAlignment(playerid,g_PlayerTurfNotifyTxt[playerid][3], 2);
PlayerTextDrawBackgroundColor(playerid,g_PlayerTurfNotifyTxt[playerid][3], 255);
PlayerTextDrawFont(playerid,g_PlayerTurfNotifyTxt[playerid][3], 1);
PlayerTextDrawLetterSize(playerid,g_PlayerTurfNotifyTxt[playerid][3], 0.180000, 0.799999);
PlayerTextDrawColor(playerid,g_PlayerTurfNotifyTxt[playerid][3], -1);
PlayerTextDrawSetOutline(playerid,g_PlayerTurfNotifyTxt[playerid][3], 1);
PlayerTextDrawSetProportional(playerid,g_PlayerTurfNotifyTxt[playerid][3], 1);
PlayerTextDrawSetSelectable(playerid,g_PlayerTurfNotifyTxt[playerid][3], 0);
ShowAllGangZonesForPlayer(playerid);
return 1;
}
public OnPlayerSpawn(playerid) {
for (new i, j = sizeof(g_Turf); i < j; i++) {
if (g_Turf[i][turfState] == TURF_STATE_ATTACKED) {
GangZoneFlashForPlayer(playerid, g_Turf[i][turfId], COLOR_CHANGE_ALPHA(g_Team[g_Turf[i][turfAttacker]][teamColor]));
}
}
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][0]);
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][1]);
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][2]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][0]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][1]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][2]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][3]);
return 1;
}
public OnPlayerRequestClass(playerid, classid) {
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][0]);
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][1]);
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][2]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][0]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][1]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][2]);
PlayerTextDrawHide(playerid, g_PlayerTurfNotifyTxt[playerid][3]);
return 1;
}
NotifyTeam(team, type, text[]) {
for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
if (IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_WASTED && GetPlayerTeam(i) == team) {
if (g_PlayerTurfNotifyTimer[i][type] != -1) {
KillTimer(g_PlayerTurfNotifyTimer[i][type]);
}
g_PlayerTurfNotifyTimer[i][type] = SetTimerEx("OnTeamNotified", 5000, false, "ii", team, type);
PlayerTextDrawSetString(i, g_PlayerTurfNotifyTxt[i][type], text);
PlayerTextDrawShow(i, g_PlayerTurfNotifyTxt[i][type]);
}
}
}
forward OnTeamNotified(team, type);
public OnTeamNotified(team, type) {
for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
if (IsPlayerConnected(i) && GetPlayerTeam(i) == team) {
g_PlayerTurfNotifyTimer[i][type] = -1;
PlayerTextDrawHide(i, g_PlayerTurfNotifyTxt[i][type]);
}
}
}
public OnPlayerDeath(playerid, killerid, reason) {
if (killerid != INVALID_PLAYER_ID) {
if (0 <= GetPlayerTeam(playerid) < sizeof(g_Team) && 0 <= GetPlayerTeam(killerid) < sizeof(g_Team)) {
for (new i, j = sizeof(g_Turf); i < j; i++) {
if (IsPlayerInGangZone(playerid, g_Turf[i][turfId])) {
if (g_Turf[i][turfState] == TURF_STATE_NORMAL) {
if (GetPlayerTeam(killerid) != g_Turf[i][turfOwner]) {
g_Turf[i][turfAttackerKills]++;
if (g_Turf[i][turfAttackerKills] >= TURF_REQUIRED_KILLS) {
g_Turf[i][turfState] = TURF_STATE_ATTACKED;
g_Turf[i][turfAttacker] = GetPlayerTeam(killerid);
g_Turf[i][turfTimer] = SetTimerEx("OnTurfwarEnd", TURF_REQUIRED_CAPTURETIME, false, "i", i);
GangZoneFlashForAll(g_Turf[i][turfId], COLOR_CHANGE_ALPHA(g_Team[GetPlayerTeam(killerid)][teamColor]));
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
new
szBuffer[156]
;
strcat(szBuffer, "Turfwar in ~b~~h~~h~~h~");
strcat(szBuffer, g_Turf[i][turfName]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][0], szBuffer);
PlayerTextDrawShow(p, g_PlayerTurfTxt[p][0]);
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfOwner]][teamName], g_Turf[i][turfOwnerKills], g_MembersInTurf[i][g_Turf[i][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][1], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
PlayerTextDrawShow(p, g_PlayerTurfTxt[p][1]);
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfAttacker]][teamName], g_Turf[i][turfAttackerKills], g_MembersInTurf[i][g_Turf[i][turfAttacker]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][2], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
PlayerTextDrawShow(p, g_PlayerTurfTxt[p][2]);
}
}
new
szText[156]
;
strcat(szText, "~y~We have provoked a turfwar against ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[i][turfOwner]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[i][turfName]);
strcat(szText, " ~y~(/findwar)");
NotifyTeam(g_Turf[i][turfAttacker], 2, szText);
szText[0] = EOS;
strcat(szText, "~y~We have been attacked by ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[i][turfAttacker]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[i][turfName]);
strcat(szText, " ~y~(/findwar)");
NotifyTeam(g_Turf[i][turfOwner], 3, szText);
}
}
}
else if (g_Turf[i][turfState] == TURF_STATE_ATTACKED) {
if (GetPlayerTeam(killerid) == g_Turf[i][turfOwner]) {
g_Turf[i][turfOwnerKills]++;
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
new
szBuffer[156]
;
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfOwner]][teamName], g_Turf[i][turfOwnerKills], g_MembersInTurf[i][g_Turf[i][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][1], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
}
}
}
else if (GetPlayerTeam(killerid) == g_Turf[i][turfAttacker]) {
g_Turf[i][turfAttackerKills]++;
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
new
szBuffer[156]
;
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfAttacker]][teamName], g_Turf[i][turfAttackerKills], g_MembersInTurf[i][g_Turf[i][turfAttacker]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][2], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
}
}
}
}
return 1;
}
}
}
}
return 1;
}
public OnPlayerEnterGangZone(playerid, zone) {
if (0 <= GetPlayerTeam(playerid) < sizeof(g_Team) && GetPlayerState(playerid) != PLAYER_STATE_WASTED && ! GetPlayerInterior(playerid) && ! GetPlayerVirtualWorld(playerid)) {
for (new i, j = sizeof(g_Turf); i < j; i++) {
if (zone == g_Turf[i][turfId]) {
new
szTurfText[156]
;
strcat(szTurfText, "~y~~h~");
strcat(szTurfText, g_Team[g_Turf[i][turfOwner]][teamName]);
strcat(szTurfText, "'s ");
strcat(szTurfText, g_Turf[i][turfName]);
GameTextForPlayer(playerid, szTurfText, 3000, 1);
g_MembersInTurf[i][GetPlayerTeam(playerid)]++;
if (GetPlayerTeam(playerid) != g_Turf[i][turfOwner]) {
if (g_Turf[i][turfState] == TURF_STATE_NORMAL) {
if (g_MembersInTurf[i][GetPlayerTeam(playerid)] >= TURF_REQUIRED_PLAYERS) {
g_Turf[i][turfState] = TURF_STATE_PROVOKED;
g_Turf[i][turfAttacker] = GetPlayerTeam(playerid);
g_Turf[i][turfTimer] = SetTimerEx("OnTurfwarProvoked", TURF_REQUIRED_PROVOKETIME, false, "i", i);
return 1;
}
}
}
else if (g_Turf[i][turfState] == TURF_STATE_ATTACKED) {
new
szBuffer[156]
;
strcat(szBuffer, "Turfwar in ~b~~h~~h~~h~");
strcat(szBuffer, g_Turf[i][turfName]);
PlayerTextDrawSetString(playerid, g_PlayerTurfTxt[playerid][0], szBuffer);
PlayerTextDrawShow(playerid, g_PlayerTurfTxt[i][0]);
PlayerTextDrawColor(playerid, g_PlayerTurfTxt[playerid][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
PlayerTextDrawShow(playerid, g_PlayerTurfTxt[i][1]);
PlayerTextDrawColor(playerid, g_PlayerTurfTxt[playerid][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
PlayerTextDrawShow(playerid, g_PlayerTurfTxt[i][2]);
if (GetPlayerTeam(playerid) == g_Turf[i][turfOwner]) {
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfOwner]][teamName], g_Turf[i][turfOwnerKills], g_MembersInTurf[i][g_Turf[i][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][1], szBuffer);
}
}
}
else if (GetPlayerTeam(playerid) == g_Turf[i][turfAttacker]) {
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfOwner]][teamName], g_Turf[i][turfOwnerKills], g_MembersInTurf[i][g_Turf[i][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][1], szBuffer);
}
}
}
}
return 1;
}
}
}
return 1;
}
forward OnTurfwarProvoked(turfid);
public OnTurfwarProvoked(turfid) {
g_Turf[turfid][turfState] = TURF_STATE_ATTACKED;
g_Turf[turfid][turfTimer] = SetTimerEx("OnTurfwarEnd", TURF_REQUIRED_CAPTURETIME, false, "i", turfid);
new
szText[156]
;
strcat(szText, "~y~We have provoked a turfwar against ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[turfid][turfOwner]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[turfid][turfName]);
strcat(szText, " ~y~(/findwar)");
NotifyTeam(g_Turf[turfid][turfAttacker], 2, szText);
szText[0] = EOS;
strcat(szText, "~y~We have been attacked by ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[turfid][turfAttacker]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[turfid][turfName]);
strcat(szText, " ~y~(/findwar)");
NotifyTeam(g_Turf[turfid][turfOwner], 3, szText);
GangZoneFlashForAll(g_Turf[turfid][turfId], COLOR_CHANGE_ALPHA(g_Team[g_Turf[turfid][turfAttacker]][teamColor]));
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[turfid][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
new
szBuffer[156]
;
strcat(szBuffer, "Turfwar in ~b~~h~~h~~h~");
strcat(szBuffer, g_Turf[turfid][turfName]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][0], szBuffer);
PlayerTextDrawShow(p, g_PlayerTurfTxt[p][0]);
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[turfid][turfOwner]][teamName], g_Turf[turfid][turfOwnerKills], g_MembersInTurf[turfid][g_Turf[turfid][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][1], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][1], g_Team[g_Turf[turfid][turfOwner]][teamColor]);
PlayerTextDrawShow(p, g_PlayerTurfTxt[p][1]);
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[turfid][turfAttacker]][teamName], g_Turf[turfid][turfAttackerKills], g_MembersInTurf[turfid][g_Turf[turfid][turfAttacker]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][2], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][2], g_Team[g_Turf[turfid][turfAttacker]][teamColor]);
PlayerTextDrawShow(p, g_PlayerTurfTxt[p][2]);
}
}
}
forward OnTurfwarEnd(turfid);
public OnTurfwarEnd(turfid) {
g_Turf[turfid][turfTimer] = -1;
new
iScores[2],
szText[156]
;
iScores[0] = g_Turf[turfid][turfOwnerKills] + g_MembersInTurf[turfid][g_Turf[turfid][turfOwner]];
iScores[1] = g_Turf[turfid][turfAttackerKills] + g_MembersInTurf[turfid][g_Turf[turfid][turfAttacker]];
if (iScores[0] < iScores[1]) {
strcat(szText, "~y~We have won the turfwar against ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[turfid][turfOwner]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[turfid][turfName]);
strcat(szText, " ~y~(/turfs)");
NotifyTeam(g_Turf[turfid][turfAttacker], 1, szText);
szText[0] = EOS;
strcat(szText, "~y~We have lost the turfwar against ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[turfid][turfAttacker]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[turfid][turfName]);
strcat(szText, " ~y~(/turfs)");
NotifyTeam(g_Turf[turfid][turfOwner], 0, szText);
format(szText, sizeof(szText), "* The last turf scores for \"%s\" were: %s - %i, %s - %i.", g_Turf[turfid][turfName], g_Team[g_Turf[turfid][turfOwner]][teamName], iScores[0], g_Team[g_Turf[turfid][turfAttacker]][teamName], iScores[1]);
for (new i, j = sizeof(g_Team); i < j; i++) {
if (GetPlayerTeam(i) == g_Turf[turfid][turfOwner]) {
SendClientMessage(i, COLOR_GREEN, szText);
}
else if (GetPlayerTeam(i) == g_Turf[turfid][turfAttacker]) {
GivePlayerMoney(i, 7000);
SetPlayerScore(i, GetPlayerScore(i) + 5);
SendClientMessage(i, COLOR_GREEN, "Your team showed the opponenet team! [+$7000, +5 score]");
SendClientMessage(i, COLOR_GREEN, szText);
}
}
g_Turf[turfid][turfOwner] = g_Turf[turfid][turfAttacker];
}
else {
strcat(szText, "~y~We have won the turfwar against ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[turfid][turfAttacker]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[turfid][turfName]);
strcat(szText, " ~y~(/turfs)");
NotifyTeam(g_Turf[turfid][turfOwner], 1, szText);
szText[0] = EOS;
strcat(szText, "~y~We have lost the turfwar against ~b~~h~~h~~h~");
strcat(szText, g_Team[g_Turf[turfid][turfOwner]][teamName]);
strcat(szText, " ~y~in ~b~~h~~h~~h~");
strcat(szText, g_Turf[turfid][turfName]);
strcat(szText, " ~y~(/turfs)");
NotifyTeam(g_Turf[turfid][turfAttacker], 0, szText);
format(szText, sizeof(szText), "* The last turf scores for \"%s\" were: %s - %i, %s - %i.", g_Turf[turfid][turfName], g_Team[g_Turf[turfid][turfOwner]][teamName], iScores[0], g_Team[g_Turf[turfid][turfAttacker]][teamName], iScores[1]);
for (new i, j = sizeof(g_Team); i < j; i++) {
if (GetPlayerTeam(i) == g_Turf[turfid][turfOwner]) {
GivePlayerMoney(i, 7000);
SetPlayerScore(i, GetPlayerScore(i) + 5);
SendClientMessage(i, COLOR_GREEN, "Your team showed the opponenet team! [+$7000, +5 score]");
SendClientMessage(i, COLOR_GREEN, szText);
}
else if (GetPlayerTeam(i) == g_Turf[turfid][turfAttacker]) {
SendClientMessage(i, COLOR_GREEN, szText);
}
}
}
g_Turf[turfid][turfState] = TURF_STATE_NORMAL;
g_Turf[turfid][turfAttacker] = NO_TEAM;
g_Turf[turfid][turfAttackerKills] = 0;
g_Turf[turfid][turfOwnerKills] = 0;
GangZoneStopFlashForAll(g_Turf[turfid][turfId]);
GangZoneShowForAll(g_Turf[turfid][turfId], COLOR_CHANGE_ALPHA(g_Team[g_Turf[turfid][turfOwner]][teamColor]));
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[turfid][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
PlayerTextDrawHide(p, g_PlayerTurfTxt[p][0]);
PlayerTextDrawHide(p, g_PlayerTurfTxt[p][1]);
PlayerTextDrawHide(p, g_PlayerTurfTxt[p][2]);
}
}
}
public OnPlayerLeaveGangZone(playerid, zone) {
if (0 <= GetPlayerTeam(playerid) < sizeof(g_Team)) {
for (new i, j = sizeof(g_Turf); i < j; i++) {
if (zone == g_Turf[i][turfId]) {
g_MembersInTurf[i][GetPlayerTeam(playerid)]--;
if (g_Turf[i][turfState] == TURF_STATE_PROVOKED) {
if (g_MembersInTurf[i][GetPlayerTeam(playerid)] < TURF_REQUIRED_PLAYERS) {
g_Turf[i][turfState] = TURF_STATE_NORMAL;
g_Turf[i][turfAttacker] = NO_TEAM;
KillTimer(g_Turf[i][turfTimer]);
g_Turf[i][turfTimer] = -1;
return 1;
}
}
else if (g_Turf[i][turfState] == TURF_STATE_ATTACKED) {
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][0]);
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][1]);
PlayerTextDrawHide(playerid, g_PlayerTurfTxt[playerid][2]);
if (g_MembersInTurf[i][GetPlayerTeam(playerid)] < TURF_REQUIRED_PLAYERS) {
OnTurfwarEnd(i);
KillTimer(g_Turf[i][turfTimer]);
g_Turf[i][turfTimer] = -1;
g_Turf[i][turfState] = TURF_STATE_NORMAL;
g_Turf[i][turfAttacker] = NO_TEAM;
g_Turf[i][turfAttackerKills] = 0;
g_Turf[i][turfOwnerKills] = 0;
GangZoneStopFlashForAll(g_Turf[i][turfId]);
GangZoneShowForAll(g_Turf[i][turfId], COLOR_CHANGE_ALPHA(g_Team[g_Turf[i][turfOwner]][teamColor]));
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId])) {
PlayerTextDrawHide(p, g_PlayerTurfTxt[p][0]);
PlayerTextDrawHide(p, g_PlayerTurfTxt[p][1]);
PlayerTextDrawHide(p, g_PlayerTurfTxt[p][2]);
}
}
return 1;
}
else {
if (GetPlayerTeam(playerid) == g_Turf[i][turfOwner]) {
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
new
szBuffer[156]
;
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfOwner]][teamName], g_Turf[i][turfOwnerKills], g_MembersInTurf[i][g_Turf[i][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][1], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
}
}
}
else if (GetPlayerTeam(playerid) == g_Turf[i][turfAttacker]) {
for (new p, q = GetPlayerPoolSize(); p <= q; p++) {
if (IsPlayerConnected(p) && IsPlayerInGangZone(p, g_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
new
szBuffer[156]
;
format(szBuffer, sizeof(szBuffer), "%s~w~~h~: ~r~%i ~w~~h~kills with ~r~%i ~w~~h~players", g_Team[g_Turf[i][turfOwner]][teamName], g_Turf[i][turfOwnerKills], g_MembersInTurf[i][g_Turf[i][turfOwner]]);
PlayerTextDrawSetString(p, g_PlayerTurfTxt[p][2], szBuffer);
PlayerTextDrawColor(p, g_PlayerTurfTxt[p][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
}
}
}
return 1;
}
}
}
}
}
return 1;
}
Код:
C:\Users\Asus\Desktop\Los Santos - Gangwar (BETA)\filterscripts\turfs.pwn(8) : fatal error 100: cannot read from file: "gangzonesc" Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.