public OnPlayerEnterCheckpoint(playerid)
{
if(Team[playerid] == TEAM_RED)
{
if(bombing == 0)
{
if(bombed == 0)
{
bombing = 1;
bombingtimer = SetTimer("Bombing",1000,1);
}
}
else
{
GameTextForPlayer(playerid,"~w~The ~r~ship ~w~is already being ~r~bombed!",3500,4);
}
}
else
{
GameTextForPlayer(playerid,"~w~Protect this ~r~area!",3500,1);
}
return 1;
}
forward Bombing(playerid);
public Bombing(playerid)
{
gameseconds--;
new name[24];
new string[128];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s is now placing explosives.~N~It will take %d seconds.",name,gameseconds);
TextDrawSetString(bombingtxt,string);
new explosion = 31;
if(gameseconds <= -1)
{
explosion--;
new string2[128];
format(string2,sizeof(string2),"The ship will explode~N~in %d seconds.",explosion);
TextDrawSetString(bombingtxt,string2);
KillTimer(countdown);
bombing = 0;
bombed = 1;
DisablePlayerCheckpoint(playerid);
}
if(explosion <= -1)
{
CreateExplosion(-2370,1552,3,0,80);
CreateExplosion(-2371,1553,4,0,80);
CreateExplosion(-2369,1551,2,0,80);
TextDrawSetString(bombingtxt,"The ship is being exploded!");
SetTimer("RedsWin",8000,0);
KillTimer(bombingtimer);
SetTimer("HideBomber",5500,0);
}
TextDrawShowForAll(bombingtxt);
}
forward RedsWin();
public RedsWin()
{
for(new i; i < MAX_PLAYERS; i++)
if(Team[i] == TEAM_RED)
{
GameTextForPlayer(i,"Mission Passed! ~N~~g~$7500",0,4500);
GivePlayerMoney(i,7500);
}
else
{
GameTextForPlayer(i,"~r~Mission Failed!",0,4500);
}
SetTimer("OnGameModeExit",4500,0);
}
public OnPlayerLeaveCheckpoint(playerid)
{
if(Team[playerid] == TEAM_RED)
{
if(bombed == 0)
{
new name[24];
new string[128];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string), "%s has stopped placing explosives",name);
TextDrawSetString(bombingtxt,string);
bombing = 0;
KillTimer(bombingtimer);
TextDrawShowForAll(bombingtxt);
SetTimer("HideBomber",4500,0);
gameseconds = 9;
}
}
return 1;
}
forward HideBomber();
public HideBomber()
{
TextDrawHideForAll(bombingtxt);
}
new explosion = 31;
|
Put
pawn Code:
(set the variable explosion to 31 on init count down) |
forward RedsWin();
public RedsWin()
{
for(new i; i < MAX_PLAYERS; i++)
if(Team[i] == TEAM_RED && IsPlayerConnected(i))
{
GameTextForPlayer(i,"Mission Passed! ~N~~g~$7500",0,4500);
GivePlayerMoney(i,7500);
}
else
{
GameTextForPlayer(i,"~r~Mission Failed!",0,4500);
}
SetTimer("OnGameModeExit",4500,0);
}
GameTextForPlayer(i,"Mission Passed! ~n~ ~g~$7500", 1, 4500);