pawn Код:
CMD:pcb(playerid, params[])
{
if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
if (PlayerInfo[playerid][pC4] == 0)
{
if (PlayerInfo[playerid][pBombs] != 0)
{
new carid = GetPlayerVehicleID(playerid);
new closestcar = GetClosestCar(playerid, carid);
if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0))
{
if(VehicleBomb[closestcar] == 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "There is already a C4 on the vehicle engine!");
return 1;
}
VehicleBomb[closestcar] = 1;
PlacedVehicleBomb[playerid] = closestcar;
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
SendClientMessageEx(playerid, COLOR_GREEN, "You have placed C4 on the vehicle engine, /pickupbomb to remove it.");
//PlayerInfo[playerid][pC4] = 1;
PlayerInfo[playerid][pBombs]--;
PlayerInfo[playerid][pC4Used] = 2;
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not close enough to any vehicle!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have C4!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You can only deploy 1 C4 at a time ! ");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a member of the Hitman Agency ! ");
}
return 1;
}