SA-MP Forums Archive
Fire Mission Is this Right? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fire Mission Is this Right? (/showthread.php?tid=193880)



Fire Mission Is this Right? - Buzzbomb - 27.11.2010

I set a timer to check if player is Inrange of this fire if they are to start a killtimer on the fire and the explosion ..
or is gonna continious Looop?

pawn Код:
new KillFire1;
new Firetimer1;
new Fire1;
new StartFireCheck;

forward KillFire(playerid);
forward FireMissionExp(playerid);
forward MEXP1(playerid);
forward FireMissions(playerid);


public OnGameModeInit()
{
    SetTimer("FireMissions", 60000, 1);
      return 1;
}
public FireMissions(playerid)
{
    if(PlayerInfo[playerid][pJob] >= 1)
    {
        SendClientMessage(playerid, RED, "Calling All Emergency Vehicles");
        //PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    }
    Fire1 = CreateDynamicObject(3461,1682.5397,-2289.2920,11.5124,0,0,0); //object(tikitorch01_lvs) (1)
    Firetimer1 = SetTimer("MEXP1",5000,true);
    if(IsPlayerInRangeOfPoint(playerid,5.0 ,1682.5397,-2289.2920,10.5124))
    {
        SendClientMessage(playerid, BLUE, "Keep Spraying you're Killing the source");
        StartFireCheck = SetTimer("FireMissionExp", false);
    }
    return 1;
}
public MEXP1(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0 ,1682.5397,-2289.2920,11.5124))
    {
    //do nothing
    }
    else
    {
        CreateExplosion(1682.5397,-2289.2920,11.5124,2,10.0);
    }
    return 1;
}
public FireMissionExp(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0 ,1682.5397,-2289.2920,11.5124))
    {
        SendClientMessage(playerid, BLUE, "Keep Spraying you're Killing the source");
        KillFire1 = SetTimer("KillFire", 10000, 1);
        KillTimer(StartFireCheck);
    }
    else
    {
        KillTimer(KillFire1);
        Firetimer1 = SetTimer("MEXP1",5000,true);
       
    }
    return 1;
}
public KillFire(playerid)
{
    SendClientMessage(playerid, BLUE, "Good Job you killed the source");
    DestroyDynamicObject(Fire1);
    KillTimer(Firetimer1);
    return 1;
}



Re: Fire Mission Is this Right? - Buzzbomb - 27.11.2010

Holy shit it did Lagged the crap out of me


Re: Fire Mission Is this Right? - WillyP - 27.11.2010

Why doesn't your timer return true?


Re: Fire Mission Is this Right? - Buzzbomb - 27.11.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Why doesn't your timer return true?
Witch one?


Re: Fire Mission Is this Right? - Buzzbomb - 27.11.2010

NeverMind i got it had the timer in another timr recalling hehe made the explosions double there number hahah

Код:
public FireMissions(playerid)
{
	if(PlayerInfo[playerid][pJob] >= 1)
	{
		SendClientMessage(playerid, RED, "Calling All Emergency Vehicles");
        //PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	}
	Fire1 = CreateDynamicObject(3461,1682.5397,-2289.2920,11.5124,0,0,0); //object(tikitorch01_lvs) (1)
	Firetimer1 = SetTimer("MEXP1",5000,true);
    return 1;
}
public MEXP1(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0 ,1682.5397,-2289.2920,11.5124))
    {
	//do nothing
    }
    else
    {
        CreateExplosion(1682.5397,-2289.2920,11.5124,2,10.0);
        StartFireCheck = SetTimer("FireMissionExp", 5000, true);
    }
    return 1;
}
public FireMissionExp(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0 ,1682.5397,-2289.2920,11.5124))
    {
	    SendClientMessage(playerid, BLUE, "Keep Spraying you're Killing the source");
	    KillFire1 = SetTimer("KillFire", 30000, false);
	    KillTimer(StartFireCheck);
    }
	else
	{
		KillTimer(KillFire1);
	}
	return 1;
}
public KillFire(playerid)
{
    SendClientMessage(playerid, BLUE, "Good Job you killed the source");
	DestroyDynamicObject(Fire1);
	KillTimer(Firetimer1);
	return 1;
}
So you know if anyone uses this this fire located by Los santos enterance in the middle cant miss it.. its in the middle walk way and i upped the time on the Firemission to 1000000 = 10mins i think and made a command to start it.. but works good but to kill the fire just stand there lol


But .. Does anyone have and ideal how i can go about making a few more fire and explosions god i hate to do more timers and other things never done this before so my first firemission yay me..