14.09.2015, 11:11
Is there a way to make a team assist system when you're capturing a zone and there's someone else came to the checkpoint which is capturing the zone and you're already capturing and he's in the same team , Is there a way to increase the team by two seconds instead of one and the both who were capturing the zone get score/cash ? thanks
But note: do not give me the tutorials links becasue I'll not use another code Because I've scripted 17 zones with this one already so tell me how to make it with this code , thanks in advance
PHP код:
//Zone1
new basecapturer1 = -1;
new zone1time;
new zone1timer=0;
new zonecp1;
new zonecapturing1;
new zone1capturedby;
new Text:capzone1;
stock CreateZone1Text()
{
capzone1 = TextDrawCreate(240.0, 240.0, " ");
TextDrawLetterSize(capzone1, 0.25, 1.4);
TextDrawSetProportional(capzone1, 1);
TextDrawSetShadow(capzone1, 1);
TextDrawAlignment(capzone1, 1);
}
public OnGameModeInit()
{
CreateZone1Text();
zonecp1 = CreateDynamicCP(170.8172,1985.8171,20.0259,4.0,-1,-1,-1,20.0);
return 1;
}
zonetext = TextDrawCreate(320.0, 420.0, "~G~Zone has been captured!");
TextDrawLetterSize(zonetext, 0.25, 1.4);
TextDrawSetProportional(zonetext, 1);
TextDrawSetShadow(zonetext, 1);
TextDrawAlignment(zonetext, 2);
zonetext2 = TextDrawCreate(320.0, 420.0, "~r~You have failed to capture this zone!");
TextDrawLetterSize(zonetext2, 0.25, 1.4);
TextDrawSetProportional(zonetext2, 1);
TextDrawSetShadow(zonetext2, 1);
TextDrawAlignment(zonetext2, 2);
forward zonecapture1(playerid);
public zonecapture1(playerid)
{
new string[120];
if(Team[playerid] == 1)
{
GangZoneFlashForAll(gang[2],COLOR_TERRORIST);
}
else
{
GangZoneFlashForAll(gang[2],COLOR_ARMY);
}
zone1timer++;
format(string, sizeof(string), "~P~You've started a zone war ~B~%d~w~/~R~30", zone1timer);
TextDrawSetString(capzone1, string);
TextDrawShowForPlayer(playerid, capzone1);
if(zone1timer == 30)
{
KillTimer(zone1time);
GangZoneStopFlashForAll(gang[2]);
GangZoneShowForAll(gang[2],GetPlayerColor(playerid));
TextDrawDestroy(capzone1);
xps[playerid] = xps[playerid]+500;
GivePlayerScore(playerid,3);
GivePlayerMoney(playerid, 500);
zonecapturing1 = 0;
zone1timer=0;
basecapturer1 = -1;
if(Team[playerid] == 1)
{
if(zone1capturedby == 2)
{
format(string, sizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}We lost the Old Office!");
SendMessageToTerriost(COLOR_TERRORIST, string);
}
format(string, sizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}We took over the Old Office!");
SendMessageToArmy(COLOR_ARMY, string);
zone1capturedby = 1;
armykills = armykills+3;
}
else if(Team1[playerid] == 2)
{
if(zone1capturedby == 1)
{
format(string, sizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}We lost the Old Office!");
SendMessageToArmy(COLOR_ARMY, string);
}
format(string, sizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}We took over the Old Office!");
SendMessageToTerriost(COLOR_TERRORIST, string);
terrkills = terrkills+3;
zone1capturedby = 2;
}
SendClientMessage(playerid, COLOR_SILVER, "You have captured this base and earned 500 cash, 500xp and 3 score.");
TextDrawShowForPlayer(playerid, zonetext);
SetTextDrawTimer(playerid, zonetext, 4000);
CreateZone1Text();
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
new string[200];
if(checkpointid == zonecp1)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You cannot capture the bases on vehicles!");
if(zonecapturing1 == 1) return SendClientMessage(playerid, COLOR_RED, "The base already getting captured!");
if(Team[playerid] == 1)
{
if(zone1capturedby == 1) return SendClientMessage(playerid, COLOR_RED, "Your team already captured this base!");
}
else if(Team1[playerid] == 2)
{
if(zone1capturedby == 2) return SendClientMessage(playerid, COLOR_RED, "Your team already captured this base!");
}
GangZoneShowForAll(gang[2],GetPlayerColor(playerid));
zone1time = SetTimerEx("zonecapture1", 1000, 1, "i", playerid);
if(Team[playerid] == 1)
{
format(string, sizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}We are currently attacking the Old Office!");
SendMessageToArmy(COLOR_ARMY, string);
format(string, sizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}The S.W.A.T is currently attacking the Old Office!");
SendMessageToTerriost(COLOR_TERRORIST, string);
}
else if(Team1[playerid] == 2)
{
format(string, sizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}We are currently attacking the Old Office!");
SendMessageToTerriost(COLOR_TERRORIST, string);
format(string, sizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}The Terrorists Are currently attacking the Old Office!");
SendMessageToArmy(COLOR_ARMY, string);
}
basecapturer1 = playerid;
zonecapturing1 = 1;
}
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == zonecp1)
{
if(playerid == basecapturer1)
{
if(zonecapturing1 == 1)
{
KillTimer(zone1time);
TextDrawDestroy(capzone1);
CreateZone1Text();
if(zone1capturedby == 0)
{
GangZoneHideForAll(gang[2]);
}
else if(zone1capturedby == 1)
{
GangZoneStopFlashForAll(gang[2]);
GangZoneShowForAll(gang[2],COLOR_ARMY);
}
else if(zone1capturedby == 2)
{
GangZoneStopFlashForAll(gang[2]);
GangZoneShowForAll(gang[2],COLOR_TERRORIST);
}
zonecapturing1 = 0;
zone1timer=0;
basecapturer1 = -1;
SendClientMessage(playerid, COLOR_RED, "You have failed to capture this base!");
TextDrawShowForPlayer(playerid, zonetext2);
SetTextDrawTimer(playerid, zonetext2, 4000);
}
}
}
return 1;
}