Quote:
Originally Posted by the_chaoz
Can you send me the code please as I didn't have problems with this, in old versions areas Y axis was wrong but i never had crashes.
|
Heres a few codes i am using:
For the zone:
pawn Код:
new Z_DOCK;
Z_DOCK = GangZoneCreate(2228.381375, -2228.381375, 2866.962306, -2813.747228);
GangZoneShowForAll(Z_DOCK, 0x0098007C);
(I did put those in different spots)
I also have a capture system.
For AreaCheck:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
gTeam = GetPlayerTeam(i);
if(IsPlayerConnected(i))
{
if(IsPlayerInArea(i, 2228.381375, -2228.381375, 2866.962306, -2813.747228))
{
if(EnteredArea3[i] == 0)
{
if(gTeam == TEAM_DELTA && CapturedBy3 == 1 || gTeam == TEAM_SPETSNAZ && CapturedBy3 == 2 || gTeam == TEAM_GIGN && CapturedBy3 == 3 || gTeam == TEAM_IA && CapturedBy3 == 4 || gTeam == TEAM_JSDF && CapturedBy3 == 5)
{
SendClientMessage(i, COLOR_RED, "This area is already controlled by your team!");
EnteredArea3[i] = 1;
return 0;
}
else
{
SendClientMessage(i, COLOR_GREEN, "Stay in the zone for 20 seconds to capture it.");
GangZoneFlashForAll(Z_DOCK, TeamColor(i));
EnteredArea3[i] = 1;
SendClientMessageToAll(COLOR_RED, "Ocean Docks is being taken over!");
T3[i] = SetTimer("TakeOver", 20000, 0);
return 0;
}
}
}
else
{
KillTimer(T3[i]);
EnteredArea3[i] = 0;
}
}
}
For TakeOver:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
new gTeam;
gTeam = GetPlayerTeam(i);
if(IsPlayerConnected(i))
{
if(IsPlayerInArea(i, 2228.381375, -2228.381375, 2866.962306, -2813.747228))
{
GangZoneStopFlashForAll(Z_DOCK);
SetPlayerScore(i, GetPlayerScore(i) + 15);
GangZoneHideForAll(Z_DOCK);
PlayerInfo[i][Xp] += 15;
GivePlayerMoney(i, 3500);
SendClientMessage(i, COLOR_GREEN, "You have recieved 15 XP and $3500 from the captured zone.");
if(gTeam == TEAM_DELTA)
{
GangZoneShowForAll(Z_DOCK, 0x0000FF7D);
SendClientMessageToAll(-1, "Delta Force has captured Ocean Docks!");
CapturedBy3 = 1;
return 0;
}
else if(gTeam == TEAM_SPETSNAZ)
{
GangZoneShowForAll(Z_DOCK, 0xFF00008E);
SendClientMessageToAll(-1, "Spetsnaz has captured Ocean Docks!");
CapturedBy3 = 2;
return 0;
}
else if(gTeam == TEAM_GIGN)
{
GangZoneShowForAll(Z_DOCK, 0x00FF007D);
SendClientMessageToAll(-1, "GIGN has captured Ocean Docks!");
CapturedBy3 = 3;
return 0;
}
else if(gTeam == TEAM_IA)
{
GangZoneShowForAll(Z_DOCK, 0x00FFFF55);
SendClientMessageToAll(-1, "Italian Army has captured Ocean Docks!");
CapturedBy3 = 4;
return 0;
}
else if(gTeam == TEAM_JSDF)
{
GangZoneShowForAll(Z_DOCK, 0xFF840055);
SendClientMessageToAll(-1, "Japan Self Defense Forces has captured Ocean Docks!");
CapturedBy3 = 5;
}
}
}
}