When playing some co-op map in CS other day , those people who died had to walk all the way back because the spawn points remain the same.
I cant add custom spawn points as they would spawn in other parts like middle of map without even going through it , so I tried making a plugin to work with the custom spawn points.
This plugin is supposed to ONLY ALLOW players to RESPAWN if they are near their teammates , if they spawn elsewhere the plugin will respawn the player near his teammates.
Minimum distance is 1000.
Maximum distance is 1500.
I know it sounds crazy with a lot of bugs if I use this they might spawn even further into the map dont worry about that part yet. Because right now this isnt even working.
Sry my knowledge of <engine> is bad.
PHP Code:
//RegisterHam(Ham_Spawn,"player","spawned")
public spawned(id)
{
new players[32], count
get_players(players, count, "fh")
for(new i = 0; i < count; i++) //getting all alive players
{
new Float:pos[3]
entity_get_vector(players[i], EV_VEC_origin, pos)
static className[64];
if(equali(className, "info_player_start"))
if (vector_distance(pos, equali(className, "info_player_start")) > 1000 && vector_distance(pos, equali(className, "info_player_start")) < 1500)
{
return PLUGIN_HANDLED
}
else
{
ExecuteHam(Ham_CS_RoundRespawn,id)
}
}
}
Not completed yet someone pls help I dont know how to allow them to respawn only if they are near teammates. Right now it will continuously respawn players until they are near teammates , thats bad =/