31.08.2009, 14:21
pawn Код:
if(strcmp(cmd, "/tplant", true) == 0)
{
if(gTeam[playerid] == TEAM_USA)
{
new tanker = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
{
if(gTeam[tanker] == TEAM_USA)
{
SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
return 1;
}
new tank = GetPlayerVehicleID(playerid);
if(GetVehicleModel(tank) == 432)
{
SetVehicleHealth(tank, 100.0);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
return 1;
}
}
else if(gTeam[playerid] == TEAM_GERMANY)
{
new tanker = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
{
if(gTeam[tanker] == TEAM_GERMANY)
{
SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
return 1;
}
new tank = GetPlayerVehicleID(playerid);
if(GetVehicleModel(tank) == 432)
{
SetVehicleHealth(tank, 0.0);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
return 1;
}
}
return 1;
}
return 1;
}