20.11.2013, 11:21
Hello,
How do i make it so when 2 or more players enter a capture zone it captures it for both so they both get money/score
My OnPlayerEnterDynamicCP:
How do i make it so when 2 or more players enter a capture zone it captures it for both so they both get money/score
My OnPlayerEnterDynamicCP:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[OliFactory]) {
if(tCP[OliFactory] == gTeam[playerid]) {
if(gTeam[playerid] == TEAM_GERMANY && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_GERMANY);
} else if(gTeam[playerid] == TEAM_IRAQ && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_IRAQ);
} else if(gTeam[playerid] == TEAM_ENGLAND && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_ENGLAND);
} else if(gTeam[playerid] == TEAM_USA && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_USA);
} else if(gTeam[playerid] == TEAM_NETHERLANDS && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_NL);
}
return SendClientMessage(playerid, COLOR_RED,"This zone is already captured by your team");
}
if(UnderAttack[OliFactory] == 1) {
if(gTeam[playerid] == TEAM_GERMANY && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_GERMANY);
} else if(gTeam[playerid] == TEAM_IRAQ && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_IRAQ);
} else if(gTeam[playerid] == TEAM_ENGLAND && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_ENGLAND);
} else if(gTeam[playerid] == TEAM_USA && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_USA);
} else if(gTeam[playerid] == TEAM_NETHERLANDS && CP[OliFactory]) {
GangZoneShowForAll(Zone[OliFactory], COLOR_NL);
}
return SendClientMessage(playerid, COLOR_RED,"This zone is already being taken over!");
}
UnderAttack[OliFactory] = 1;
GangZoneFlashForAll(Zone[OliFactory], gTeam[playerid]);
if(gTeam[playerid] == TEAM_GERMANY && CP[OliFactory]) {
GangZoneFlashForAll(Zone[OliFactory], COLOR_GERMANY);
} else if(gTeam[playerid] == TEAM_IRAQ && CP[OliFactory]) {
GangZoneFlashForAll(Zone[OliFactory], COLOR_IRAQ);
} else if(gTeam[playerid] == TEAM_ENGLAND && CP[OliFactory]) {
GangZoneFlashForAll(Zone[OliFactory], COLOR_ENGLAND);
} else if(gTeam[playerid] == TEAM_USA && CP[OliFactory]) {
GangZoneFlashForAll(Zone[OliFactory], COLOR_USA);
} else if(gTeam[playerid] == TEAM_NETHERLANDS && CP[OliFactory]) {
GangZoneFlashForAll(Zone[OliFactory], COLOR_NL);
}
timer[playerid][OliFactory] = SetTimerEx("SetZone",30000, false, "i", playerid);
SendClientMessage(playerid, yellow,"You're Capturing this zone! Wait here for 30 Seconds!");
new string[128];
format(string, sizeof(string),"[ATTENTION]: OliFactory is being taken over!");
SendClientMessageToAll(blue,string);
iCP[playerid] = OliFactory;
}
return 1;
}

