Turf system(REP+)
#1

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.802632.80, -1722.30}},
    {
"Ganton",          0,     NO_TEAM,    {2222.50, -1722.302632.80, -1628.50}},
    {
"Idlewood",        0,     NO_TEAM,    {2124.60, -1742.302222.50, -1494.00}},
    {
"Idlewood",        0,     NO_TEAM,    {1971.60, -1852.802222.50, -1742.30}},
    {
"Willow Field",    0,     NO_TEAM,    {2324.00, -2059.202541.70, -1852.80}},
    {
"East Los Santos"0,     NO_TEAM,    {2421.00, -1628.502632.80, -1454.30}},
    {
"East Los Santos"0,     NO_TEAM,    {2222.50, -1628.502421.00, -1494.00}},
    
    {
"Jefferson",       1,     NO_TEAM,    {2056.80, -1372.002281.40, -1210.70}},
    {
"Jefferson",       1,     NO_TEAM,    {2056.80, -1210.702185.30, -1126.30}},
    {
"Jefferson",       1,     NO_TEAM,    {2056.80, -1449.602266.20, -1372.00}},
    {
"Las Colinas",     1,     NO_TEAM,    {1994.30, -1100.802056.80,  -920.80}},
    {
"Las Colinas",     1,     NO_TEAM,    {2056.80, -1126.302126.80,  -920.80}},
    {
"Las Colinas",     1,     NO_TEAM,    {2185.30, -1154.502281.40,  -934.40}},
    {
"Las Colinas",     1,     NO_TEAM,    {2126.80, -1126.302185.30,  -934.40}},
    {
"Las Colinas",     1,     NO_TEAM,    {2632.70, -1135.002747.70,  -945.00}},
    {
"Glen Park",       1,     NO_TEAM,    {1812.60, -1350.702056.80, -1100.80}},
    
    {
"Idlewood",        2,     NO_TEAM,    {1812.60, -1852.801971.60, -1742.30}},
    {
"Idlewood",        2,     NO_TEAM,    {1951.60, -1742.302124.60, -1602.30}},
    {
"Idlewood",        2,     NO_TEAM,    {1812.60, -1602.302124.60, -1449.60}},
    {
"Idlewood",        2,     NO_TEAM,    {1812.60, -1742.301951.60, -1602.30}},
    {
"Pershing Square"2,     NO_TEAM,    {1327.8929,-1729.3352,1821.7725,-1573.5878}},
    {
"East Beach",      3,     NO_TEAM,    {2747.70, -1498.602959.30, -1120.00}},
    {
"Los Flores",      3,     NO_TEAM,    {2581.70, -1393.402747.70, -1135.00}},
    {
"Las Colinas",     3,     NO_TEAM,    {2281.40, -1135.002632.70,  -945.00}},
    {
"East Los Santos"3,     NO_TEAM,    {2266.20, -1494.002381.60, -1372.00}},
    {
"East Los Santos"3,     NO_TEAM,    {2281.60, -1372.002381.60, -1135.00}},
    {
"East Los Santos"3,     NO_TEAM,    {2381.60, -1454.302462.10, -1135.00}},
    {
"East Los Santos"3,     NO_TEAM,    {2462.10, -1454.302581.70, -1135.00}},
    {
"Willow Field",    5,     NO_TEAM,    {1970.60, -2179.202089.00, -1852.80}},
    {
"Willow Field",    5,     NO_TEAM,    {2089.00, -1989.902324.00, -1852.80}},
    {
"Willow Field",    5,     NO_TEAM,    {2089.00, -2235.802201.80, -1989.90}},
    {
"El Corona",       5,     NO_TEAM,    {1812.60, -2179.201970.60, -1852.80}},
    {
"El Corona",       5,     NO_TEAM,    {1692.60, -2179.201812.60, -1842.20}},
    {
"Rodeo",            5,     NO_TEAM,    {-187.7, -1596.7617.0632, -1276.6}},
    {
"Rodeo",            5,     NO_TEAM,    {422.68, -1570.2466.223, -1406.05}},
    {
"Rodeo",            5,     NO_TEAM,    {466.223, -1570.2558.099, -1385.07}},
    {
"Rodeo",            5,     NO_TEAM,    {558.099, -1684.65647.522, -1384.93}},
    {
"Rodeo",            5,     NO_TEAM,    {422.68, -1684.65558.099, -1570.2}},
    {
"Rodeo",            5,     NO_TEAM,    {312.803, -1684.65422.68, -1501.95}},
    {
"Rodeo",            5,     NO_TEAM,    {334.503, -1501.95422.68, -1406.05}},
    {
"Rodeo",            5,     NO_TEAM,    {647.712, -1804.21851.449, -1577.59}},
    {
"Market",          6,     NO_TEAM,    {1252.33, -926.9991357.0, -910.17}},
       {
"Market",          6,     NO_TEAM,    {1252.33, -1026.331391.05, -926.999}},
    {
"Market",          6,     NO_TEAM,    {1252.33, -1130.851378.33, -1026.33}},
    {
"Market",          6,     NO_TEAM,    {1072.66, -1416.251370.85, -1130.85}},
    {
"Temple",          6,     NO_TEAM,    {1391.05, -1026.331463.9, -926.999}},
    {
"Temple",          6,     NO_TEAM,    {1378.33, -1130.851463.9, -1026.33}},
    {
"Downtown LS.",    6,     NO_TEAM,    {1370.85, -1170.871463.9, -1130.85}},
    {
"Downtown LS.",    6,     NO_TEAM,    {1370.85, -1384.951463.9, -1170.87}}
};
new
                
g_MembersInTurf[sizeof(g_Turf)][sizeof(g_Team)],
    
PlayerTextg_PlayerTurfTxt[MAX_PLAYERS][3],
    
PlayerTextg_PlayerTurfNotifyTxt[MAX_PLAYERS][4],
                
g_PlayerTurfNotifyTimer[MAX_PLAYERS][4]
;
public 
OnFilterScriptInit() {
    new
        
iTeamTurfs[sizeof(g_Team)]
    ;
    for (new 
isizeof(g_Turf); ji++) {
        
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 
ksizeof(g_Team); lk++) {
            
g_MembersInTurf[i][k] = 0;
        }
        
        
iTeamTurfs[g_Turf[i][turfOwner]]++;
    }
    print(
" ");
    print(
"_________________| Turfwar Script |_________________");
    print(
"Attempting to initialize ''turfs.amx''...");
    print(
" ");
    for (new 
isizeof(g_Team); ji++) {
        
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 
isizeof(g_Turf); ji++) {
        
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.000000378.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.2400001.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.000000389.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.1800000.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.000000397.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.1800000.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.000000348.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.1800000.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.000000355.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.1800000.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.000000362.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.1800000.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.000000369.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.1800000.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 
isizeof(g_Turf); ji++) {
        if (
g_Turf[i][turfState] == TURF_STATE_ATTACKED) {
            
GangZoneFlashForPlayer(playeridg_Turf[i][turfId], COLOR_CHANGE_ALPHA(g_Team[g_Turf[i][turfAttacker]][teamColor]));
        }
    }
    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][0]);
    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][1]);
    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][2]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][0]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][1]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][2]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][3]);
    
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid) {
    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][0]);
    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][1]);
    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][2]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][0]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][1]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][2]);
    
PlayerTextDrawHide(playeridg_PlayerTurfNotifyTxt[playerid][3]);
    
    return 
1;
}
NotifyTeam(teamtypetext[]) {
    for (new 
iGetPlayerPoolSize(); <= ji++) {
        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"5000false"ii"teamtype);
            
            
PlayerTextDrawSetString(ig_PlayerTurfNotifyTxt[i][type], text);
            
PlayerTextDrawShow(ig_PlayerTurfNotifyTxt[i][type]);
        }
    }
}
forward OnTeamNotified(teamtype);
public  
OnTeamNotified(teamtype) {
    for (new 
iGetPlayerPoolSize(); <= ji++) {
        if (
IsPlayerConnected(i) && GetPlayerTeam(i) == team) {
            
g_PlayerTurfNotifyTimer[i][type] = -1;
            
PlayerTextDrawHide(ig_PlayerTurfNotifyTxt[i][type]);
        }
    }
}
public 
OnPlayerDeath(playeridkilleridreason) {
    if (
killerid != INVALID_PLAYER_ID) {
        if (
<= GetPlayerTeam(playerid) < sizeof(g_Team) && <= GetPlayerTeam(killerid) < sizeof(g_Team)) {
            for (new 
isizeof(g_Turf); ji++) {
                if (
IsPlayerInGangZone(playeridg_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_CAPTURETIMEfalse"i"i);
                                
                                
GangZoneFlashForAll(g_Turf[i][turfId], COLOR_CHANGE_ALPHA(g_Team[GetPlayerTeam(killerid)][teamColor]));
                                
                                for (new 
pGetPlayerPoolSize(); <= qp++) {
                                    if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                        new
                                            
szBuffer[156]
                                        ;
                                        
strcat(szBuffer"Turfwar in ~b~~h~~h~~h~");
                                        
strcat(szBufferg_Turf[i][turfName]);
                                        
PlayerTextDrawSetString(pg_PlayerTurfTxt[p][0], szBuffer);
                                        
PlayerTextDrawShow(pg_PlayerTurfTxt[p][0]);
                                        
                                        
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][1], szBuffer);
                                        
PlayerTextDrawColor(pg_PlayerTurfTxt[p][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
                                        
PlayerTextDrawShow(pg_PlayerTurfTxt[p][1]);
                                        
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][2], szBuffer);
                                        
PlayerTextDrawColor(pg_PlayerTurfTxt[p][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
                                        
PlayerTextDrawShow(pg_PlayerTurfTxt[p][2]);
                                    }
                                }
                                
                                new
                                    
szText[156]
                                ;
                                
strcat(szText"~y~We have provoked a turfwar against ~b~~h~~h~~h~");
                                
strcat(szTextg_Team[g_Turf[i][turfOwner]][teamName]);
                                
strcat(szText" ~y~in ~b~~h~~h~~h~");
                                
strcat(szTextg_Turf[i][turfName]);
                                
strcat(szText" ~y~(/findwar)");
                                
NotifyTeam(g_Turf[i][turfAttacker], 2szText);
                                
                                
szText[0] = EOS;
                                
strcat(szText"~y~We have been attacked by ~b~~h~~h~~h~");
                                
strcat(szTextg_Team[g_Turf[i][turfAttacker]][teamName]);
                                
strcat(szText" ~y~in ~b~~h~~h~~h~");
                                
strcat(szTextg_Turf[i][turfName]);
                                
strcat(szText" ~y~(/findwar)");
                                
NotifyTeam(g_Turf[i][turfOwner], 3szText);
                            }
                        }
                    }
                    else if (
g_Turf[i][turfState] == TURF_STATE_ATTACKED) {
                        if (
GetPlayerTeam(killerid) == g_Turf[i][turfOwner]) {
                            
g_Turf[i][turfOwnerKills]++;
                            for (new 
pGetPlayerPoolSize(); <= qp++) {
                                if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                    new
                                         
szBuffer[156]
                                    ;
                                    
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][1], szBuffer);
                                    
PlayerTextDrawColor(pg_PlayerTurfTxt[p][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
                                }
                            }
                        }
                        else if (
GetPlayerTeam(killerid) == g_Turf[i][turfAttacker]) {
                            
g_Turf[i][turfAttackerKills]++;
                            for (new 
pGetPlayerPoolSize(); <= qp++) {
                                if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                    new
                                         
szBuffer[156]
                                    ;
                                    
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][2], szBuffer);
                                    
PlayerTextDrawColor(pg_PlayerTurfTxt[p][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
                                }
                            }
                        }
                    }
                    return 
1;
                }
            }
        }
    }
    return 
1;
}
public 
OnPlayerEnterGangZone(playeridzone) {
    if (
<= GetPlayerTeam(playerid) < sizeof(g_Team) && GetPlayerState(playerid) != PLAYER_STATE_WASTED && ! GetPlayerInterior(playerid) && ! GetPlayerVirtualWorld(playerid)) {
        for (new 
isizeof(g_Turf); ji++) {
            if (
zone == g_Turf[i][turfId]) {
                new
                      
szTurfText[156]
                ;
                
strcat(szTurfText"~y~~h~");
                
strcat(szTurfTextg_Team[g_Turf[i][turfOwner]][teamName]);
                
strcat(szTurfText"'s ");
                
strcat(szTurfTextg_Turf[i][turfName]);
                
GameTextForPlayer(playeridszTurfText30001);
                    
                
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_PROVOKETIMEfalse"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(szBufferg_Turf[i][turfName]);
                    
PlayerTextDrawSetString(playeridg_PlayerTurfTxt[playerid][0], szBuffer);
                    
PlayerTextDrawShow(playeridg_PlayerTurfTxt[i][0]);
                    
PlayerTextDrawColor(playeridg_PlayerTurfTxt[playerid][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
                    
PlayerTextDrawShow(playeridg_PlayerTurfTxt[i][1]);
                    
PlayerTextDrawColor(playeridg_PlayerTurfTxt[playerid][2], g_Team[g_Turf[i][turfAttacker]][teamColor]);
                    
PlayerTextDrawShow(playeridg_PlayerTurfTxt[i][2]);
                    
                    if (
GetPlayerTeam(playerid) == g_Turf[i][turfOwner]) {
                        for (new 
pGetPlayerPoolSize(); <= qp++) {
                            if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][1], szBuffer);
                            }
                        }
                    }
                    else if (
GetPlayerTeam(playerid) == g_Turf[i][turfAttacker]) {
                        for (new 
pGetPlayerPoolSize(); <= qp++) {
                            if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                
format(szBuffersizeof(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(pg_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_CAPTURETIMEfalse"i"turfid);
    new
        
szText[156]
    ;
    
strcat(szText"~y~We have provoked a turfwar against ~b~~h~~h~~h~");
    
strcat(szTextg_Team[g_Turf[turfid][turfOwner]][teamName]);
    
strcat(szText" ~y~in ~b~~h~~h~~h~");
    
strcat(szTextg_Turf[turfid][turfName]);
    
strcat(szText" ~y~(/findwar)");
    
NotifyTeam(g_Turf[turfid][turfAttacker], 2szText);
    
szText[0] = EOS;
    
strcat(szText"~y~We have been attacked by ~b~~h~~h~~h~");
    
strcat(szTextg_Team[g_Turf[turfid][turfAttacker]][teamName]);
    
strcat(szText" ~y~in ~b~~h~~h~~h~");
    
strcat(szTextg_Turf[turfid][turfName]);
    
strcat(szText" ~y~(/findwar)");
    
NotifyTeam(g_Turf[turfid][turfOwner], 3szText);
    
GangZoneFlashForAll(g_Turf[turfid][turfId], COLOR_CHANGE_ALPHA(g_Team[g_Turf[turfid][turfAttacker]][teamColor]));
    
    for (new 
pGetPlayerPoolSize(); <= qp++) {
         if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[turfid][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
            new
                   
szBuffer[156]
            ;
            
strcat(szBuffer"Turfwar in ~b~~h~~h~~h~");
            
strcat(szBufferg_Turf[turfid][turfName]);
            
PlayerTextDrawSetString(pg_PlayerTurfTxt[p][0], szBuffer);
            
PlayerTextDrawShow(pg_PlayerTurfTxt[p][0]);
            
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][1], szBuffer);
            
PlayerTextDrawColor(pg_PlayerTurfTxt[p][1], g_Team[g_Turf[turfid][turfOwner]][teamColor]);
            
PlayerTextDrawShow(pg_PlayerTurfTxt[p][1]);
            
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][2], szBuffer);
               
PlayerTextDrawColor(pg_PlayerTurfTxt[p][2], g_Team[g_Turf[turfid][turfAttacker]][teamColor]);
            
PlayerTextDrawShow(pg_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(szTextg_Team[g_Turf[turfid][turfOwner]][teamName]);
        
strcat(szText" ~y~in ~b~~h~~h~~h~");
        
strcat(szTextg_Turf[turfid][turfName]);
        
strcat(szText" ~y~(/turfs)");
        
NotifyTeam(g_Turf[turfid][turfAttacker], 1szText);
        
szText[0] = EOS;
        
strcat(szText"~y~We have lost the turfwar against ~b~~h~~h~~h~");
        
strcat(szTextg_Team[g_Turf[turfid][turfAttacker]][teamName]);
        
strcat(szText" ~y~in ~b~~h~~h~~h~");
        
strcat(szTextg_Turf[turfid][turfName]);
        
strcat(szText" ~y~(/turfs)");
        
NotifyTeam(g_Turf[turfid][turfOwner], 0szText);
        
        
format(szTextsizeof(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 
isizeof(g_Team); ji++) {
            if (
GetPlayerTeam(i) == g_Turf[turfid][turfOwner]) {
                
SendClientMessage(iCOLOR_GREENszText);
            }
            else if (
GetPlayerTeam(i) == g_Turf[turfid][turfAttacker]) {
                
GivePlayerMoney(i7000);
                
SetPlayerScore(iGetPlayerScore(i) + 5);
                
                
SendClientMessage(iCOLOR_GREEN"Your team showed the opponenet team! [+$7000, +5 score]");
                
SendClientMessage(iCOLOR_GREENszText);
            }
         }
        
g_Turf[turfid][turfOwner] = g_Turf[turfid][turfAttacker];
    }
    else {
        
strcat(szText"~y~We have won the turfwar against ~b~~h~~h~~h~");
        
strcat(szTextg_Team[g_Turf[turfid][turfAttacker]][teamName]);
        
strcat(szText" ~y~in ~b~~h~~h~~h~");
        
strcat(szTextg_Turf[turfid][turfName]);
        
strcat(szText" ~y~(/turfs)");
        
NotifyTeam(g_Turf[turfid][turfOwner], 1szText);
        
szText[0] = EOS;
        
strcat(szText"~y~We have lost the turfwar against ~b~~h~~h~~h~");
        
strcat(szTextg_Team[g_Turf[turfid][turfOwner]][teamName]);
        
strcat(szText" ~y~in ~b~~h~~h~~h~");
        
strcat(szTextg_Turf[turfid][turfName]);
        
strcat(szText" ~y~(/turfs)");
        
NotifyTeam(g_Turf[turfid][turfAttacker], 0szText);
        
        
format(szTextsizeof(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 
isizeof(g_Team); ji++) {
            if (
GetPlayerTeam(i) == g_Turf[turfid][turfOwner]) {
                
GivePlayerMoney(i7000);
                
SetPlayerScore(iGetPlayerScore(i) + 5);
                
                
SendClientMessage(iCOLOR_GREEN"Your team showed the opponenet team! [+$7000, +5 score]");
                
SendClientMessage(iCOLOR_GREENszText);
            }
            else if (
GetPlayerTeam(i) == g_Turf[turfid][turfAttacker]) {
                
SendClientMessage(iCOLOR_GREENszText);
            }
         }
    }
    
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 
pGetPlayerPoolSize(); <= qp++) {
         if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[turfid][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
            
PlayerTextDrawHide(pg_PlayerTurfTxt[p][0]);
            
PlayerTextDrawHide(pg_PlayerTurfTxt[p][1]);
            
PlayerTextDrawHide(pg_PlayerTurfTxt[p][2]);
           }
    }
}
public 
OnPlayerLeaveGangZone(playeridzone) {
    if (
<= GetPlayerTeam(playerid) < sizeof(g_Team)) {
        for (new 
isizeof(g_Turf); ji++) {
            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(playeridg_PlayerTurfTxt[playerid][0]);
                    
PlayerTextDrawHide(playeridg_PlayerTurfTxt[playerid][1]);
                    
PlayerTextDrawHide(playeridg_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 
pGetPlayerPoolSize(); <= qp++) {
                            if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId])) {
                                
PlayerTextDrawHide(pg_PlayerTurfTxt[p][0]);
                                
PlayerTextDrawHide(pg_PlayerTurfTxt[p][1]);
                                
PlayerTextDrawHide(pg_PlayerTurfTxt[p][2]);
                            }
                        }
                        return 
1;
                    }
                    else {
                        if (
GetPlayerTeam(playerid) == g_Turf[i][turfOwner]) {
                            for (new 
pGetPlayerPoolSize(); <= qp++) {
                                if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                    new
                                        
szBuffer[156]
                                    ;
                                    
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][1], szBuffer);
                                       
PlayerTextDrawColor(pg_PlayerTurfTxt[p][1], g_Team[g_Turf[i][turfOwner]][teamColor]);
                                }
                            }
                        }
                        else if (
GetPlayerTeam(playerid) == g_Turf[i][turfAttacker]) {
                            for (new 
pGetPlayerPoolSize(); <= qp++) {
                                if (
IsPlayerConnected(p) && IsPlayerInGangZone(pg_Turf[i][turfId]) && GetPlayerState(p) != PLAYER_STATE_WASTED && ! GetPlayerInterior(p) && ! GetPlayerVirtualWorld(p)) {
                                    new
                                        
szBuffer[156]
                                    ;
                                    
format(szBuffersizeof(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(pg_PlayerTurfTxt[p][2], szBuffer);
                                       
PlayerTextDrawColor(pg_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.
Reply


Messages In This Thread
Turf system(REP+) - by JamalMaddox - 30.03.2016, 20:39
Re: Turf system(REP+) - by introzen - 30.03.2016, 22:17
Re: Turf system(REP+) - by Gammix - 30.03.2016, 22:19

Forum Jump:


Users browsing this thread: 2 Guest(s)