Checking if all turfs are owned by a team?
#1

Ok, So i figured out most of it, Capturing them, flashing ect.
Now, im losst on how to keep track of them, Witch team has all the zones?
I'm new to scripting Turfs, So give me a break :P

Here's what i got so far.


-Checkpoint.
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
IsValidDynamicCP(germancp))
    {
        if(
gTeam[playerid] == TEAM_USA)
        {
            
GangZoneFlashForAll(germanyTEAM_USA_COLOR);
            
SendClientMessage(playeridCOLOR_GREEN"Hold this base yo1");
            
nig SetTimer("killcap",30001);
        }
        else if(
IsValidDynamicCP(usacp))
        {
            
GangZoneFlashForAll(usaTEAM_GERMAN_COLOR);
            
SendClientMessage(playeridCOLOR_GREEN"Hold this base yo2");
            
nig SetTimer("killcap",30001);
        }
    }
    return 
1;

-Determins when the players capturing the turf.
PHP код:
public killcap(playerid)
{
    if(
gTeam[playerid] == TEAM_USA)
    {
        
SendClientMessage(playeridCOLOR_GREEN"Turf up!");
        
TurfData[TEAM_USA][teamwins]++;
        
KillTimer(nig);
    }
    else if(
gTeam[playerid] == TEAM_GERMAN)
    {
        
SendClientMessage(playeridCOLOR_RED"Turf up!");
        
TurfData[TEAM_GERMAN][teamwins]++;
        
KillTimer(nig);
    }



-Checking the turfs, this is the part im stuck on, For now, i got it checking if a variable is 2.
PHP код:
public scorecheck(playerid)
{
    if(
TurfData[TEAM_USA][teamwins] == 2)
    {
        
SendClientMessage(playeridCOLOR_GREEN"USA Wins");
    }
    else if(
TurfData[TEAM_GERMAN][teamwins] == 2)
    {
        
SendClientMessage(playeridCOLOR_RED"GERMANY wins!");
    }

--Now, how would i keep track of the zones? See'ing if the team owns all of them, instead of just by two captures?
Reply


Messages In This Thread
Checking if all turfs are owned by a team? - by -Rebel Son- - 06.04.2011, 06:22
Re: Checking if all turfs are owned by a team? - by -Rebel Son- - 06.04.2011, 14:49

Forum Jump:


Users browsing this thread: 1 Guest(s)