14.11.2009, 17:01
Ok maybe this will make it more clear. Where it says MAX_PLAYERS in this I want the condition to apply to all of the players and not just a playerid. How do I define and use this?
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == bomba)
{
if(BombArmed[MAX_PLAYERS] == false && DM21[playerid] == true)
{
GetPlayerPos(playerid, BombX[playerid], BombY[playerid], BombZ[playerid]);
GetXYInFrontOfPlayer(playerid, BombX[playerid], BombY[playerid], 0.7);
SendClientMessage(playerid, 0x0066FFAA, "Bomb Planted (exploding in 10 seconds).");
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
BombObject1[playerid] = CreateObject(1252, BombX[playerid], BombY[playerid], BombZ[playerid] - 0.8,270,0,0);
BombTime = SetTimerEx("BombTimer",30000,0, "d", playerid);
BombArmed[MAX_PLAYERS] = true;
}
else if(BombArmed[MAX_PLAYERS] == true && DM21[playerid] == true)
{
SendClientMessage(playerid, 0x0066FFAA, "The bomb is armed (30 Seconds) Do not let it become diffused!");
}
else if(BombArmed[MAX_PLAYERS] == true && DM20[playerid] == true)
{
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
Difusing = SetTimerEx("Difusingbomba",5000,0, "d", playerid);
BombArmed[MAX_PLAYERS] = false;
}
else if(BombArmed[MAX_PLAYERS] == false && DM20[playerid] == true)
{
SendClientMessage(playerid, 0x0066FFAA, "This is bombsite A. You must not let the terrorists arm it");
}
return 1;
}
if (pickupid == bombb)
{
if(BombArmed2[MAX_PLAYERS] == false && DM21[playerid] == true)
{
GetPlayerPos(playerid, BombX[playerid], BombY[playerid], BombZ[playerid]);
GetXYInFrontOfPlayer(playerid, BombX[playerid], BombY[playerid], 0.7);
SendClientMessage(playerid, 0x0066FFAA, "Bomb Planted (exploding in 10 seconds).");
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
BombObject2[playerid] = CreateObject(1252, BombX[playerid], BombY[playerid], BombZ[playerid] - 0.8,270,0,0);
BombTime2 = SetTimerEx("BombTimer2",30000,0, "d", playerid);
BombArmed2[MAX_PLAYERS] = true;
}
else if(BombArmed2[MAX_PLAYERS] == true && DM21[playerid] == true)
{
SendClientMessage(playerid, 0x0066FFAA, "The bomb is armed (30 Seconds) Do not let it become diffused!");
}
else if(BombArmed2[MAX_PLAYERS] == true && DM20[playerid] == true)
{
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
BombSiteB = SetTimerEx("BombSiteBdiffuse",30000,0, "d", playerid);
SendClientMessage(playerid, 0x0066FFAA, "Bomb B Diffused");
BombArmed2[MAX_PLAYERS] = false;
}
else if(BombArmed2[MAX_PLAYERS] == false && DM20[playerid] == true)
{
SendClientMessage(playerid, 0x0066FFAA, "This is bombsite B. You must not let the terrorists arm it");
}
return 1;
}