Problem with map changing system
#1

Hi,
There are two team attackers and defenders. attackers have to steal the vehicle from defenders. i have a problem: when attackers can't steal the vehicle and mission timer got over so attackers team get mission failed gametext and defending team get mission passed gametext but after 5-6 seconds again a Gametext appears for attackers and defenders in which attackers get mission passed and defenders get mission failed and the gamemode also don't change to get forward on next mission.

Codes:
Код:
forward NoExplode(playerid);
public NoExplode(playerid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
    			PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
    			SetTimer("Finshed",6000,false);
        	    if(gTeam[i] == TEAM_ATTACKERS)
        	    {
        	        GameTextForPlayer(i, "~g~ ~n~Mission Passed", 6000, 4);
        	        PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
        	        GivePlayerMoney(i, 10000);
   	        	    SetPlayerScore(i,GetPlayerScore(i)+5);
   	        	    SendClientMessage(playerid,yellow,"{7C7C7C}» You've Recieved 5 Points and $10,000 for Completing the mission Objective.");
					SetPlayerCameraPos(i, 1930.1677,-571.0945,23.8120);
					SetPlayerCameraLookAt(i, 1911.5667,-563.5245,25.0610);
        	    }
        	    else if(gTeam[i] == TEAM_DEFENDERS)
        	    {
        	        GameTextForPlayer(i, "~r~ ~n~Mission Failed", 6000, 4);
        	        PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
        	        SendClientMessage(playerid,yellow,"{FF0000}» You've Lost -$2000 Money for Not completing the Mission Objective.");
					SetPlayerCameraPos(i, 1930.1677,-571.0945,23.8120);
					GivePlayerMoney(i,-2000);
					SetPlayerCameraLookAt(i, 1911.5667,-563.5245,25.0610);
        	    }
    SetTimer("Finshed",2000,false);
}
}
	return 1;
}

forward NoExplode2(playerid);
public NoExplode2(playerid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
    PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
        	    if(gTeam[i] == TEAM_DEFENDERS)
        	    {
        	        GameTextForPlayer(i, "~g~ ~n~Mission Passed", 6000, 4);
        	        SendClientMessage(playerid,yellow,"{7C7C7C}» You've Recieved 5 Points and $10,000 for Completing the mission Objective.");
        	        GivePlayerMoney(i, 10000);
   	        	    SetPlayerScore(i,GetPlayerScore(i)+5);
       	    	    SetTimer("Finshed", 6000, 0);
   	    	        PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
					SetPlayerCameraPos(i, 1276.0552,-788.1879,96.9662);
					SetPlayerCameraLookAt(i, 1288.8605,-788.3223,96.4609);
        	    }
        	    else if(gTeam[i] == TEAM_ATTACKERS)
        	    {
        	        GameTextForPlayer(i, "~r~ ~n~Mission Failed", 6000, 4);
       	            SendClientMessage(playerid,yellow,"{FF0000}» You've Lost -$2000 Money for Not completing the Mission Objective.");
					SetPlayerCameraPos(i, 1276.0552,-788.1879,96.9662);
					SetPlayerCameraLookAt(i, 1288.8605,-788.3223,96.4609);
	                PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
					GivePlayerMoney(i, -2000);
	    			SetTimer("Finshed",6000,false);
        	    }
    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
    SendClientMessage(playerid,0xFF00FFFFF,"{55FF00}» Success : {FFFFFF}Your Stats have been Successfully Saved.");
    SetTimer("Finshed",2000,false);
    }
}
	return 1;
}

public Finshed(playerid)
{
   	SendRconCommand("changemode next-mission-name-here");
    return 1;
}

public Finshed2(playerid)
{
	for(new i = 0; playerid < MAX_PLAYERS; playerid++)
    {
        if(IsPlayerConnected(i))
        {
            if(gTeam[i] == TEAM_DEFENDERS)
            {
			GameTextForPlayer(i, "~r~ Mission Failed", 6000, 4);
			SendClientMessageToAll(COLOR_RED, "{E4E05D}» The Security Guards have Successfully defend the Helicopter from the Thieves.");
				SetTimer("Finshed", 2000, 0);
            }
            else if(gTeam[i] == TEAM_ATTACKERS)
            {
        	        GameTextForPlayer(i, "~g~ Mission Passed", 6000, 4);
        	        GivePlayerMoney(i, 10000);
        	        SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
            }
        }
    }
	SetTimer("Finshed", 2000, 0);
    return 1;
}

forward Load(playerid);
public Load(playerid)
{
	SetTimerEx("NoExplode2",290000,false,"i", playerid);
}
Reply


Messages In This Thread
Problem with map changing system - by SpikY_ - 13.06.2015, 11:06
Re: Problem with map changing system - by MohammedZ - 13.06.2015, 11:20
Re: Problem with map changing system - by SpikY_ - 13.06.2015, 11:24
Re: Problem with map changing system - by SpaceX - 13.06.2015, 11:34
Re: Problem with map changing system - by SpaceX - 13.06.2015, 11:37
Re: Problem with map changing system - by SpikY_ - 13.06.2015, 11:50
Re: Problem with map changing system - by SpaceX - 13.06.2015, 13:19
Re: Problem with map changing system - by SpikY_ - 15.06.2015, 07:47
Re: Problem with map changing system - by SpikY_ - 15.06.2015, 07:55
Re: Problem with map changing system - by SpaceX - 15.06.2015, 11:05

Forum Jump:


Users browsing this thread: 1 Guest(s)