19.10.2018, 09:42
Sort of. Checking for the swat team and all the rest of the maps will be too long. Store them in an array.
and you can use it as:
pawn Code:
PunishSpawnkiller(map_id, playerid, issuerid)
{
// sizeof spawnpoints / 2 = total number of maps
// the first half are spawnpoints of terrorists
// the other half are spawnpoints of swat
static const Float: spawnpoints[][] =
{
{286.20001220705, 178.10000610352, 1007.5999755859}, // MAP 1 - TEAM_TERRORIST
{x, y, z}, // MAP 2 - TEAM_TERRORIST
{x, y, z}, // MAP 3 - TEAM_TERRORIST
{x, y, z}, // MAP 1 - TEAM_SWAT
{x, y, z}, // MAP 2 - TEAM_SWAT
{x, y, z} // MAP 3 - TEAM_SWAT
};
new index = map_id + (team[playerid] == TEAM_SWAT ? sizeof spawnpoints / 2 : 0);
if (IsPlayerInRangeOfPoint(playerid, 1.0, spawnpoints[index][0], spawnpoints[index][1], spawnpoints[index][2]))
{
SetPlayerHealth(issuerid, 0.0);
}
}
pawn Code:
if (issuerid != INVALID_PLAYER_ID && team[issuerid] != team[playerid])
{
PunishSpawnkiller(gCurrentMap, playerid, issuerid);
}