Help with Spawn Killing.
#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


Messages In This Thread
Help with Spawn Killing. - by D1am0nd - 18.10.2018, 21:23
Re: Help with Spawn Killing. - by Calisthenics - 18.10.2018, 21:35
Re: Help with Spawn Killing. - by D1am0nd - 18.10.2018, 21:52
Re: Help with Spawn Killing. - by Calisthenics - 19.10.2018, 09:42

Forum Jump:


Users browsing this thread: 2 Guest(s)