23.05.2011, 21:08
(
Последний раз редактировалось Unknown_Killer; 28.05.2011 в 04:57.
Причина: i added more information about the problem
)
I`m trying to create a take over and some message around it everything works fine but some message didn`t appear & also this works only on 1 team i dunno how to fix it.
here the codes :
this is the script now my problem is the text of this wont show if player failed to take over the area
Also if the enemy teams attempt to take over the area the zone flash but it wont let the player to take over it.
can anyone tell me what should i do? thanks
here the codes :
pawn Код:
#define IRAQ_TAKEOVER 0
new Text:alreadytakeover;
new EnteredArea[MAX_PLAYERS];
new CapturedBy;
new IRAQ;
new IRAQ1;
new IRAQ2;
new T1[MAX_PLAYERS];
new team1;
new team2;
public OnGameModeInit()
{
alreadytakeover = TextDrawCreate(300.000000,427.000000, "Your Alliance Already take over this area");
GangZoneShowForAll(IRAQ, 0xB0000096);
if(dini_Exists("/TakeOver/TakeOver.ini")) {
dini_IntSet("/TakeOver/TakeOver.ini", "CapturedBy", 0);
print("/TakeOver/TakeOver.ini was found in the scriptfiles folder!");
}
else {
dini_Create("/TakeOver/TakeOver.ini");
dini_IntSet("/TakeOver/TakeOver.ini", "CapturedBy", 0);
print("/TakeOver/TakeOver.ini wasnt found in the scriptfiles folder!");
}
//GANGZONE----------------------------------------------------------------------------------
IRAQ = GangZoneCreate(-478.7929, 2464.032, -58.38938, 2896.113);
IRAQ1 = GangZoneCreate(-478.7929, 2464.032, -58.38938, 2896.113);
IRAQ2 = GangZoneCreate(-478.7929, 2464.032, -58.38938, 2896.113);
GangZoneShowForAll(IRAQ, 0xB0000096);
//GANGZONE----------------------------------------------------------------------------------
return 1;
}
public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, IRAQ, 0xB0000096);
return 1;
}
public AreaCheck()
{
//****************************************[Iraq Area start]********************************************************
new newtext[100];
//========================================[Iraq Take over]===================================================
foreach(Player, i)
{
if(PlayerToPoint(1, i, -242.6534,2811.0254,62.1717))
{
if(EnteredArea[i] == 0)
{
if(gTeam[i] == TEAM_IRAQ && CapturedBy == 1 || gTeam[i] == TEAM_SYRIA && CapturedBy == 1 || gTeam[i] == TEAM_IRAN && CapturedBy == 1 || gTeam[i] == TEAM_LEBANON && CapturedBy == 1 || gTeam[i] == TEAM_ISRAEL && CapturedBy == 2 || gTeam[i] == TEAM_ENGLAND && CapturedBy == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy == 2 || gTeam[i] == TEAM_USA && CapturedBy == 2 )
{
format(newtext, sizeof(newtext), "Your team already take over this area");
TextDrawSetString(alreadytakeover, newtext);
TextDrawShowForPlayer(i, alreadytakeover);
EnteredArea[i] = 1;
}
else
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "%s is taking over Iraq Land", name);
SendClientMessageToAll(RED,str);
EnteredArea[i] = 1; // He has entered
SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 25 seconds to take over the area!");
GangZoneFlashForAll(IRAQ,COLOR_WHITE);
T1[i] = SetTimer("TakeOver",10000,0);
}
}
if(EnteredArea[i] == 1)
{
if(gTeam[i] == TEAM_IRAQ && CapturedBy == 1 || gTeam[i] == TEAM_SYRIA && CapturedBy == 1 || gTeam[i] == TEAM_IRAN && CapturedBy == 1 || gTeam[i] == TEAM_LEBANON && CapturedBy == 1 || gTeam[i] == TEAM_ISRAEL && CapturedBy == 2 || gTeam[i] == TEAM_ENGLAND && CapturedBy == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy == 2 || gTeam[i] == TEAM_USA && CapturedBy == 2)
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "%s failed to take over Iraq Land", name);
SendClientMessageToAll(RED,str);
EnteredArea[i] = 0;
KillTimer(T1[i]);
GangZoneStopFlashForAll(IRAQ);
}
else if(gTeam[i] == TEAM_ISRAEL && CapturedBy == 2 || gTeam[i] == TEAM_ENGLAND && CapturedBy == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy == 2 || gTeam[i] == TEAM_USA && CapturedBy == 2)
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "%s failed to take over Iraq Land", name);
SendClientMessageToAll(RED,str);
EnteredArea[i] = 0;
KillTimer(T1[i]);
GangZoneStopFlashForAll(IRAQ);
}
}
}
}
//*****************************************************************************************************
//****************************************[Iraq Area]********************************************************
//==============================================================================================================================
return 1;
}
public TakeOver()
{
foreach(Player, i) {
if(PlayerToPoint(1, i, -242.6534,2811.0254,62.1717))
{
if(gTeam[i] == TEAM_IRAQ || gTeam[i] == TEAM_IRAN || gTeam[i] == TEAM_SYRIA || gTeam[i] == TEAM_LEBANON)
{
if(CapturedBy != 1)
{
if( IfCapture[0] == 1 ) return 1;
IfCapture[0] = 0;
dini_IntSet("/TakeOver/TakeOver.ini", "CapturedBy", 1);
team1++;
SetPlayerScore(i, GetPlayerScore(i) + 2);
CapturedBy = 1;
if(CapturedBy == 1) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Gold eye Alliance have captured the Big Ear!");
GangZoneHideForAll(IRAQ);
GangZoneShowForAll(IRAQ1, COLOR_BLUE);
GangZoneHideForAll(IRAQ2);
GangZoneStopFlashForAll(IRAQ);
dini_IntSet("/TakeOver/TakeOver.ini", "team1", team1);
CheckForLevelUpdate(i);
}
}
}
else if(PlayerToPoint(1, i, -242.6534,2811.0254,62.1717))
{
if(gTeam[i] == TEAM_ISRAEL || gTeam[i] == TEAM_ENGLAND || gTeam[i] == TEAM_GERMANY || gTeam[i] == TEAM_USA)
{
if(CapturedBy != 2) {
IfCapture[0] = 0;
dini_IntSet("/TakeOver/TakeOver.ini", "CapturedBy", 2);
team2++;
SetPlayerScore(i, GetPlayerScore(i) + 2);
CapturedBy = 2;
if(CapturedBy == 2) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Black eye Alliance have captured Iraq Country");
GangZoneHideForAll(IRAQ);
GangZoneShowForAll(IRAQ2, COLOR_ORANGE);
GangZoneHideForAll(IRAQ1);
GangZoneStopFlashForAll(IRAQ);
dini_IntSet("/TakeOver/TakeOver.ini", "team2", team2);
CheckForLevelUpdate(i);
}
}
}
}
return 1;
}
pawn Код:
if(EnteredArea[i] == 1 && CapturedBy != 1)
{
if(gTeam[i] == TEAM_IRAQ && CapturedBy == 1 || gTeam[i] == TEAM_SYRIA && CapturedBy == 1 || gTeam[i] == TEAM_IRAN && CapturedBy == 1 || gTeam[i] == TEAM_LEBANON && CapturedBy == 1)
{
SendClientMessageToAll(COLOR_RED, "Gold eye Alliance Failed to take over Iraq land");
EnteredArea[i] = 0;
KillTimer(T1[i]);
GangZoneStopFlashForAll(IRAQ);
}
}
else if(EnteredArea[i] == 1 && CapturedBy != 2) {
if(gTeam[i] == TEAM_ISRAEL && CapturedBy == 2 || gTeam[i] == TEAM_ENGLAND && CapturedBy == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy == 2 || gTeam[i] == TEAM_USA && CapturedBy == 2)
{
SendClientMessageToAll(COLOR_RED, "Black eye Alliance Failed to take over Iraq land");
EnteredArea[i] = 0;
KillTimer(T1[i]);
GangZoneStopFlashForAll(IRAQ);
}
}
}
}
can anyone tell me what should i do? thanks
