if(strcmp(cmdtext, "/war", true) == 0)
{ InWar[playerid] = 1;
SetPlayerWorldBounds(playerid, 443.7593, -93.423, 2160.407, 1599.869);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "DM: %s has joined The WAR! (/war) to join aswell!", pName);
SendClientMessageToAll(COLOR_GREEN, string);
SetPlayerPos(playerid,239.5148, 1813.7039, 500.6836);
GivePlayerWeapon(playerid, 46, 1);
GivePlayerWeapon(playerid,29,50000);
GivePlayerWeapon(playerid,16,50000);
GivePlayerWeapon(playerid,31,25);
GivePlayerWeapon(playerid,16,50000);
GivePlayerWeapon(playerid,34,50);
return 1;
}
if (strcmp(cmdtext, "/plant", true)==0)
{
if(BombArmed[playerid] == false)
{
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);
BombObject[playerid] = CreateObject(1252, BombX[playerid], BombY[playerid], BombZ[playerid] - 0.8,270,0,0);
SetTimerEx("BombTimer",10000,0, "d", playerid);
BombArmed[playerid] = true;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You can only place a single bomb at a time!");
}
return 1;
}
if(InWar[playerid] != 0) return SendClientMessage(playerid, COLOR_RED, "You can't use commands in war use /leave to leave.");
return 0;
}
You have to check if the persons in war BEFORE the commands, assuming you want them to have to be in war to use plant.
|