Help with Spawn Killing.
#1

Hello. I want to create an anti Spawn Killing system where if Team 1 player kills Team 2 player on spawn, the Team 1 player gets auto-killed by the system for Spawn Killing. Also there is a mapchange system, where maps change every specific amount of time. So I'm just wondering, how to create that? I just saw that one server has that future.

Does that mean I have to add something in IsPlayerInRangeOfPoint?
Reply
#2

Collect all spawn-points for each map and assign to them for which team is (you need to know to which team it belongs so the system will not punish the player for dying on the spawn-point of the opponent team). When a player dies check if there is a killer and if the team of the killer is different. If the team differs, check if playerid is in range of any spawn-point that belongs to their team.
Reply
#3

Quote:
Originally Posted by Calisthenics
View Post
Collect all spawn-points for each map and assign to them for which team is (you need to know to which team it belongs so the system will not punish the player for dying on the spawn-point of the opponent team). When a player dies check if there is a killer and if the team of the killer is different. If the team differs, check if playerid is in range of any spawn-point that belongs to their team.
Something like this?

PHP Code:
if(team[issuerid] == TEAM_SWAT)
    {
        if(
team[playerid] == TEAM_TERRORIST)
        {
            if (
IsPlayerInRangeOfPoint(playerid1.0286.20001220705178.100006103521007.5999755859)) // TERRORIST SPAWN
            
{
                if(
weaponid == 25)
                {
                 
GetPlayerHealth(issuerid,hp);
                 
SetPlayerHealth(issueridhp -0);
                }
            }
        }
    } 
Reply
#4

Sort of. Checking for the swat team and all the rest of the maps will be too long. Store them in an array.
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);
    }
}
and you can use it as:
pawn Code:
if (issuerid != INVALID_PLAYER_ID && team[issuerid] != team[playerid])
{
    PunishSpawnkiller(gCurrentMap, playerid, issuerid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)