06.04.2011, 06:22
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.
-Determins when the players capturing the turf.
-Checking the turfs, this is the part im stuck on, For now, i got it checking if a variable is 2.
--Now, how would i keep track of the zones? See'ing if the team owns all of them, instead of just by two captures?
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(germany, TEAM_USA_COLOR);
SendClientMessage(playerid, COLOR_GREEN, "Hold this base yo1");
nig = SetTimer("killcap",3000, 1);
}
else if(IsValidDynamicCP(usacp))
{
GangZoneFlashForAll(usa, TEAM_GERMAN_COLOR);
SendClientMessage(playerid, COLOR_GREEN, "Hold this base yo2");
nig = SetTimer("killcap",3000, 1);
}
}
return 1;
}
PHP код:
public killcap(playerid)
{
if(gTeam[playerid] == TEAM_USA)
{
SendClientMessage(playerid, COLOR_GREEN, "Turf up!");
TurfData[TEAM_USA][teamwins]++;
KillTimer(nig);
}
else if(gTeam[playerid] == TEAM_GERMAN)
{
SendClientMessage(playerid, COLOR_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(playerid, COLOR_GREEN, "USA Wins");
}
else if(TurfData[TEAM_GERMAN][teamwins] == 2)
{
SendClientMessage(playerid, COLOR_RED, "GERMANY wins!");
}
}