SetTimer Problem
#1

Hi, I have a Problem with SetTimer.

This Timer is of 5 minute, When this timer gets over. a New Timer gets set "NexMode" which is set to 14 seconds. but its getting load before 14 seconds.
Код:
public OnGameModeInit()
{
        Timer2 = SetTimer("NoExplode",300000,false);
	return 1;
}
Код:
forward NoExplode(playerid);
public NoExplode(playerid)
{
    SetTimer("NexMode", 14000, false);
    SendClientMessageToAll(-1, "{E1CC2B}» Employers have successfully defended their Ship from being attacked by terrorist.");
   	for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
	        if(gTeam[i] == TEAM_ARMY)
	        {
			    MissionPassed(i);
			    GivePlayerMoney(i, 4000);
			    SetPlayerScore(i,GetPlayerScore(i)+3);
			    SendClientMessage(i,-1,"{7C7C7C}» You've Recieved 3 Points and $4,000 for Completing the mission Objective.");
			    PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
	        }
	        else if(gTeam[i] == TEAM_TERRIOST)
	        {
			    MissionFailed(i);
			    PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
			    GivePlayerMoney(i, -2000);
			    SendClientMessage(i,-1,"{FF0000}» You've Lost -$2000 Money for not completing the Mission Objective.");
	        }
	    }
	}
	return 1;
}
its like when 5 minutes passed, The Nexmode loads suddenly instead of waiting 14 seconds.
Reply
#2

Show us your MissionPassed and MissionFailed functions please.
Reply
#3

Код:
MissionPassed(playerid)
{
	TextDrawShowForPlayer(playerid, Textdraw50);
	TextDrawShowForPlayer(playerid, Textdraw51);
	TextDrawShowForPlayer(playerid, Textdraw52);
	TextDrawShowForPlayer(playerid, Textdraw53);
	TextDrawShowForPlayer(playerid, Textdraw54);
	TextDrawShowForPlayer(playerid, Textdraw55);
	TextDrawShowForPlayer(playerid, Textdraw58);
}

MissionFailed(playerid)
{
	TextDrawShowForPlayer(playerid, Textdraw60);
	TextDrawShowForPlayer(playerid, Textdraw61);
	TextDrawShowForPlayer(playerid, Textdraw62);
	TextDrawShowForPlayer(playerid, Textdraw63);
	TextDrawShowForPlayer(playerid, Textdraw64);
	TextDrawShowForPlayer(playerid, Textdraw65);
	TextDrawShowForPlayer(playerid, Textdraw68);
}
now? -.-
Reply
#4

erm, try it after other things
PHP код:
public NoExplode(playerid)
{
    
SendClientMessageToAll(-1"{E1CC2B}» Employers have successfully defended their Ship from being attacked by terrorist.");
       for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
gTeam[i] == TEAM_ARMY)
            {
                
MissionPassed(i);
                
GivePlayerMoney(i4000);
                
SetPlayerScore(i,GetPlayerScore(i)+3);
                
SendClientMessage(i,-1,"{7C7C7C}» You've Recieved 3 Points and $4,000 for Completing the mission Objective.");
                
PlayerPlaySound(i10850.00.00.0);
            }
            else if(
gTeam[i] == TEAM_TERRIOST)
            {
                
MissionFailed(i);
                
PlayerPlaySound(i10850.00.00.0);
                
GivePlayerMoney(i, -2000);
                
SendClientMessage(i,-1,"{FF0000}» You've Lost -$2000 Money for not completing the Mission Objective.");
            }
        }
    }
 
SetTimer("NexMode"14000false);
    return 
1;

Reply
#5

Still same.
Reply
#6

Try to kill the timer

Код:
KillTimer(Timer2);
It will may not help since Timers are bugged from samp, what you can do is like creating a variable and set it to 14 then after 1 sec passes decrease 1 from the variable, so when it is 0 means that 14 seconds passed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)