Turfwars - annoying problem!
#1

Hi all!

I've scripted a turf system so far, which shall provoke and end turfwars! Everything works perfect, a turfwar will start between 2 teams after 5 kills...well, the teams are messed up! I don't know why it's like this, but when a turfwar is going on, the server shows me wrong teams with wrong names! At the end, the zone is captured by a completely other team! Example:

Ballas are attacking a turf from the Aztecas!
The server is suddenly writing: The Los Santos Vagos have attacked our turf!

And at the end, the zone will get captured in another color from another team, even though the Ballas for example attacked! This is for every team the same...First of all, I've created this array, plus, that I've had all the team defines before:

PHP код:
    #define GROVE 1
    #define BALLA 2
    #define VAGOS 3
    #define AZTECAS 4
    #define POLICE 5
    #define RIFAS 6
    #define LOCO 7
    #define BRIGHT_GREEN 0x00FF00AA
    #define TEAM_GROVE_COLOR  0x00FF007A  // Bright Green (in RGBA format)
    #define TEAM_BALLA_COLOR 0x800080AA //0xFF00FFAA Bright Purple
    #define TEAM_VAGOS_COLOR 0xFFFF00AA // Yellow
    #define TEAM_AZTECAS_COLOR 0x00FFFFAA //Cyan
    #define TEAM_POLICE_COLOR 0x0000BBAA //Blue
    #define TEAM_RIFAS_COLOR 0xFFFFFFAA //WHITE
    #define TEAM_LOCO_COLOR 0x000000AA //black 
PHP код:
//turfwar stuff
    #define SLOTS            32    // how many slots the server got.
    #define ATTACK_TIME      180000 // Three minutes.
    #define ATTACK_KILLS     5      // Kills needed to start a turfwar.
    #define TEAMSCORE        500    // Teamscore to take over all the opponends turf.
    #define DROP_WEAPONS     1
    #define DROP_LENGTH      10000  // 10 SECONDS
    #define MAX_TEAMS        11
    #define MAX_TURFS        21
    
    
enum teaminfo
    
{
      
TeamName32 ],
     
TeamColor,
     
TurfWarsWon,
     
TurfWarsLost,
     
RivalsKilled,
     
HomiesDied,
     
TeamScore
    
}
new 
TeamInfo[  ][ teaminfo ]= {
"Grove Street Families",  TEAM_GROVE_COLOR,  00000},
"Ballas",    TEAM_BALLA_COLOR,    00000},
"Los Santos Vagos",   TEAM_VAGOS_COLOR,   00000},
"Los Varrios Aztecas",   TEAM_AZTECAS_COLOR,    00000},
"Police & Regime",  TEAM_POLICE_COLOR,  00000},
"San Fierro Rifas",     TEAM_RIFAS_COLOR,     00000},
"Loco Syndicato",   TEAM_LOCO_COLOR,   00000}
};
enum tinfo
{
     
turfID,
      
turfName40 ],
     
Float:zMinX,
     
Float:zMinY,
     
Float:zMaxX,
     
Float:zMaxY,
     
TurfColor,
     
TurfOwner,
     
TurfAttacker,
     
TurfKills,
     
TurfAttackKills,
     
TurfWarStarted
}
new 
turfsMAX_TURFS ][ tinfo ] = {
{  
0"Ganton",            2083.306884, -1757.8403322643.306884, -1573.840332TEAM_GROVE_COLOR,    GROVE,    -1000},
{  
1"Idlewood",            2380.865966, -2001.5545652644.865966, -1737.554565TEAM_GROVE_COLOR,    GROVE,    -1000},
{  
2"Ganton",          2145.166259, -1995.3448482385.166259, -1755.344848TEAM_GROVE_COLOR,    GROVE,     -1000},
{  
3"Glenpark",          1783.376220, -1398.9637452327.376220, -1030.963745TEAM_BALLA_COLOR,     BALLA,     -1000},
{  
4"Jefferson",          1564.102172, -1224.4212641892.102172, -1032.421264TEAM_BALLA_COLOR,     BALLA,     -1000},
{  
5"Glenpark",          1556.644531, -1398.0701901788.644531, -1222.070190TEAM_BALLA_COLOR,    BALLA,    -1000},
{  
6"East Los Santos",          2389.563720, -1238.9085692893.563720, -1046.908569TEAM_VAGOS_COLOR,    VAGOS,    -1000},
{  
7"Los Flores",          2327.079345, -1324.8597412391.079345, -1044.859741TEAM_VAGOS_COLOR,     VAGOS,     -1000},
{  
8"East Los Santos",      2369.286132, -1432.1903072705.286132, -1208.190307TEAM_VAGOS_COLOR,  VAGOS,  -1000},
{  
9"Willowfield",      1636.727661, -2174.6828612148.727539, -1950.682861TEAM_AZTECAS_COLOR,  AZTECAS,  -1000},
10"El Corona",      1801.938842, -1965.2816162089.938964, -1741.281616TEAM_AZTECAS_COLOR,  AZTECAS,  -1000},
11"Willowfield",      2073.393798, -2143.4470212409.393798, -1991.447021TEAM_AZTECAS_COLOR,    AZTECAS,    -1000},
12"Commerce",         1279.003295, -1740.6058341831.003295, -1588.605834TEAM_POLICE_COLOR,   POLICE,   -1000},
13"Idlewood",         1355.672607, -1599.5373531563.672607, -1007.537353TEAM_POLICE_COLOR,   POLICE,   -1000},
14"Commerce",         1563.951049, -1595.3974601931.951049, -1499.397460TEAM_POLICE_COLOR,   POLICE,   -1000},
15"Los Santos International",   1354.048217, -2387.1762691666.048217, -2179.176269TEAM_RIFAS_COLOR,    RIFAS,    -1000},
16"Los Santos International",   1648.131103, -2333.5400391888.131103, -2245.540039TEAM_RIFAS_COLOR,    RIFAS,    -1000},
17"Los Santos International",   1368.555419, -2624.9438472256.555419, -2376.943847TEAM_RIFAS_COLOR,   RIFAS,   -1000},
18"Market",   1029.579833, -1608.9549561357.579833, -1136.954956TEAM_LOCO_COLOR,   LOCO,   -1000},
19"Verona Beach",   992.831542, -1859.5430901288.831542, -1603.543090TEAM_LOCO_COLOR,   LOCO,   -1000},
20"Market",   1286.829345, -1878.9775391806.829345, -1726.977539TEAM_LOCO_COLOR,   LOCO,   -1000}
};
new 
TurfInfoMAX_TURFS ][ MAX_TEAMS ][ tinfo ]; 
Whoever will find this creepy, small solution will get a well deserved reputation point!
Reply
#2

Can we see the code that "provokes" the turf war?
Reply
#3

EDIT: EVERYTHING is working now...I've fixed it by myself, I've just put all teams into an enum! Thank you anyways!
Reply
#4

Well, I have no idea, what is causing this my only suggestion is trying to make it so onplayerdeath it does the below. It is not the most efficient way to do this but it is the most simple way, and will be easier to see what the problem is.
PHP код:
if(gTeam[playerid] == TEAM_GROVE)
{
     
//check if the killer id and the person killed was at a turf
     // add one kill to the variable if it less then five
    // code to start the war  if there is 5 kills
}
else if 
gTeam[playerid] == TEAM_VAGOS)
{
      
// and so on

Reply
#5

EDIT: See my post above, already fixed it...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)