forward OnBurgerExplosion(); public OnBurgerExplosion(playerid) { static explode2; // Defining the explode if(explode2 == 0) { // If explode2 is just going to start, get prepared and alert! if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) { new string[300]; new turnmes[128]; format(cbjstore, sizeof(turnmes), "HQ: All Units APB, Reporter: {FFFFFF} Un Incediu a fost depistat! Mergeti pentru a-l stinge.",PlayerInfo[playerid],playerid); SendClientMessage(playerid, COLOR_DBLUE, cbjstore); } } // Add your Dispatch message here! } explode2++; // Every explosion, this will go up if(explode2 < 6) // once it explodes 100 times, it will disable itself SetTimer("OnBurgerExplosion", 3000, false); // This makes it disable itself else explode2 = 0; // If this is 0, it will start exploding, because fo the timer CreateExplosion(2438.04688, -1271.21838, 23.22764,2,100); SetPlayerCheckpoint(playerid,2438.04688, -1271.21838, 23.22764,1.0); //CreateExplosion(432.4224, -1297.9946, 25.0137,1,100); //CreateExplosion(2427.9363, -1288.8926, 30.2144,1,100); // X, Y, Z == X = X Coordinates, Y = Y Coordinates, Z = Z Coordinates return 1; }
CreateExplosion(2438.04688, -1271.21838, 23.22764,2,100);
new ExplosionCount; // This will keep count of how many explosions have occured
new ExplosionTimer; // This will be used to kill the timer after the count has reached its limit
ExplosionTimer = SetTimer("BurgerShotExplosion", 1000, true); // This starts the timer, place this whereever you want
forward BurgerShotExplosion();
public BurgerShotExplosion()
{
if(ExplosionCount == 0) // If the Timer is set on 0, this is where it will start! I also suggest adding a smoking object on the building!
{
if(IsPlayerConnected(playerid)) // This will check if the player is connected
{
new string[300];
format(string, sizeof(string), "HQ: All Units APB, Reporter: {FFFFFF} Un Incediu a fost depistat! Mergeti pentru a-l stinge.");
SendMedicMessage(COLOR_DBLUE, string); // This will only send to the medics and not to the player who started the fire!
SetMedicCheckPoint(2438.04688, -1271.21838, 23.22764,1.0); // This will only set a checkpoint on the medics radar and not the civilians
}
}
else if(ExplosionCount < 100) // This checks to see if the explosions are under 100, if it is, it will carry on!
{
switch(random(3)) // This will randomly select one explosion, then change to another explosion.
{
case 0:
{
CreateExplosion(2438.04688, -1271.21838, 23.22764,2,100);
}
case 1:
{
CreateExplosion(432.4224, -1297.9946, 25.0137,1,100);
}
case 2:
{
CreateExplosion(2427.9363, -1288.8926, 30.2144,1,100);
}
}
ExplosionCount++; // Adds 1 explosion count to the variable
}
else if(ExplosionCount == 100) // Once the explosion count hits 100, it will stop the timer
{
ExplosionCount = 0; // Resets the count for the next time it happens
KillTimer(ExplosionTimer); // This will kill the timer and end the explosions
// You can also add a dispatch message saying the fire is out and units can return to base! :D
}
return 1;
}
stock SendMedicMessage(colour, string[]) // This will send a mass message to the Medic Faction only!
{
for(new i = 0; i < MAX_PLAYERS; i++) // This will go through each player ID
{
if(PlayerInfo[i][pMember] == 14 || PlayerInfo[i][pLeader] == 14) // This will check if that player ID is in the medic faction
{
SendClientMessage(i, colour, string); // This will send the message to the medics in that faction
}
}
return 1;
}
stock SetMedicCheckPoint(Float: x, Float: y, Float: z, Float: size) // This will send a mass checkpoint to the Medic Faction only!
{
for(new i = 0; i < MAX_PLAYERS; i++) // This will go through each player ID
{
if(PlayerInfo[i][pMember] == 14 || PlayerInfo[i][pLeader] == 14) // This will check if that player ID is in the medic faction
{
SetPlayerCheckpoint(i, x, y, z, size); // This will set a checkpoint for the medics in that faction
}
}
return 1;
}
You could make both MedicMessage and MedicCheckpoint into one, and simply use one function to do that.
It's not clarifying the issue though. |
error 017: undefined symbol "playerid" |
if(IsPlayerConnected(playerid))
forward OnBurgerExplosion();
forward OnBurgerExplosion(playerid);
I added those two things in to make it easier on my eyes and to help me track where everything is, this is an example of how he can lay out the system, where it will send a mass message to the medics only, then create the things needed, as for the explosions, I have mentioned the things into it below the code itself where he can see how to do it in one way.
|