22.01.2014, 16:00
Hey guys.... I need your help.
I am busy making a gang gamemode with capture zones but I have a problem with 2 of the capture zones.
When the player connects it displays the hospital and idlewood gas station as red because its not owned by a gang.
Like in this picture:

If I capture the stadium it goes green like it is suppose to...
Like in this picture:

If the stadium and ammunation has not been captured they should display in red like the idlewood and hospital... But they only display when someone captures it and it changes to their team's color.
Here is the code:
OnGameModeInit:
OnPlayerConnect:
+Rep to people that help solve this
I am busy making a gang gamemode with capture zones but I have a problem with 2 of the capture zones.
When the player connects it displays the hospital and idlewood gas station as red because its not owned by a gang.
Like in this picture:

If I capture the stadium it goes green like it is suppose to...
Like in this picture:

If the stadium and ammunation has not been captured they should display in red like the idlewood and hospital... But they only display when someone captures it and it changes to their team's color.
Here is the code:
OnGameModeInit:
Код:
//Capture Zones //Idlewood CP[Idlewood] = CreateDynamicCP(1925.3003, -1791.3341, 13.3828, 5, -1, -1, -1, 100); Zone[Idlewood] = GangZoneCreate(1839.726, -1930.57, 1950.008, -1772.66); UnderAttack[Idlewood] = 0; Captured[Idlewood] = -1; tCP[Idlewood] = TEAM_NONE; //Hospital CP[Hospital] = CreateDynamicCP(2034.5825, -1404.9686, 17.2459, 5, -1, -1, -1, 100); Zone[Hospital] = GangZoneCreate(1991.839, -1460.788, 2098.319, -1342.356); UnderAttack[Hospital] = -1; Captured[Hospital] = -1; tCP2[Hospital] = TEAM_NONE; //Ammunation CP[Ammunation] = CreateDynamicCP(1365.6359,-1281.1489,13.5469, 5, -1, -1, -1, 100); Zone[Ammunation] = GangZoneCreate(1371.977, -1401.572, 1467.048, -1243.663); UnderAttack[Ammunation] = -1; Captured[Ammunation] = -1; tCP[Ammunation] = TEAM_NONE; //Stadium CP[Stadium] = CreateDynamicCP(2695.7649,-1704.8549,11.8438, 5, -1, -1, -1, 100); Zone[Stadium] = GangZoneCreate(2623.11, -1895.04, 2801.844, -1662.123); UnderAttack[Stadium] = -1; Captured[Stadium] = -1; tCP[Stadium] = TEAM_NONE;
Код:
//Capture Zones //Idlewood iCP[playerid] = -1; InCP[playerid][1] = 0; if(tCP[Idlewood] == TEAM_GROVE) return GangZoneShowForPlayer(playerid, Zone[Idlewood], CGrove); else if(tCP[Idlewood] == TEAM_BALLAS) return GangZoneShowForPlayer(playerid, Zone[Idlewood], CBallas); else if(tCP[Idlewood] == TEAM_VARIOS) return GangZoneShowForPlayer(playerid, Zone[Idlewood], CVarios); else if(tCP[Idlewood] == TEAM_VAGOS) return GangZoneShowForPlayer(playerid, Zone[Idlewood], CVagos); else if(tCP[Idlewood] == TEAM_NONE) return GangZoneShowForPlayer(playerid, Zone[Idlewood], COLOR_RED); //Hospital iCP[playerid] = -1; InCP[playerid][1] = 0; if(tCP[Hospital] == TEAM_GROVE) return GangZoneShowForPlayer(playerid, Zone[Hospital], CGrove); else if(tCP[Hospital] == TEAM_BALLAS) return GangZoneShowForPlayer(playerid, Zone[Hospital], CBallas); else if(tCP[Hospital] == TEAM_VARIOS) return GangZoneShowForPlayer(playerid, Zone[Hospital], CVarios); else if(tCP[Hospital] == TEAM_VAGOS) return GangZoneShowForPlayer(playerid, Zone[Hospital], CVagos); else if(tCP2[Hospital] == TEAM_NONE) return GangZoneShowForPlayer(playerid, Zone[Hospital], COLOR_RED); //Ammunation iCP[playerid] = -1; InCP[playerid][1] = 0; if(tCP[Ammunation] == TEAM_GROVE) return GangZoneShowForPlayer(playerid, Zone[Ammunation], CGrove); else if(tCP[Ammunation] == TEAM_BALLAS) return GangZoneShowForPlayer(playerid, Zone[Ammunation], CBallas); else if(tCP[Ammunation] == TEAM_VARIOS) return GangZoneShowForPlayer(playerid, Zone[Ammunation], CVarios); else if(tCP[Ammunation] == TEAM_VAGOS) return GangZoneShowForPlayer(playerid, Zone[Ammunation], CVagos); else if(tCP[Ammunation] == TEAM_NONE) return GangZoneShowForPlayer(playerid, Zone[Ammunation], COLOR_RED); //Stadium iCP[playerid] = -1; InCP[playerid][1] = 0; if(tCP[Stadium] == TEAM_NONE) return GangZoneShowForPlayer(playerid, Zone[Stadium], COLOR_RED); else if(tCP[Stadium] == TEAM_GROVE) return GangZoneShowForPlayer(playerid, Zone[Stadium], CGrove); else if(tCP[Stadium] == TEAM_BALLAS) return GangZoneShowForPlayer(playerid, Zone[Stadium], CBallas); else if(tCP[Stadium] == TEAM_VARIOS) return GangZoneShowForPlayer(playerid, Zone[Stadium], CVarios); else if(tCP[Stadium] == TEAM_VAGOS) return GangZoneShowForPlayer(playerid, Zone[Stadium], CVagos); else if(tCP[Stadium] == TEAM_NONE) return GangZoneShowForPlayer(playerid, Zone[Stadium], COLOR_RED);
