27.11.2010, 20:38
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?
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;
}