This script will basically turn-off friendly fire.
So watch out for each others thrown grenades and spraying bullets.
&&
A player will be selected at random who will have a "cure" so to speak. Zombies will ignore that player for X amount of time. This time can be adjust by yourself.
( this is ideally for those who want to have a little fun by avoiding zombies & your buddies. )
*** untested but should work ok, ill test tomorrow... or when i get an actual decent nights sleep.***
Simply add-
thread free_for_all_main();
under-
maps\_zombiemode::main();
Then add this to the bottom of your mapname gsc file.
// This function handles player friendly fire.
free_for_all_main()
{
players = [];
players = get_players();
p1 = players[0];
p2 = players[1];
p3 = players[2];
p4 = players[3];
p1.team = "allies";
p2.team = "tom";
p3.team = "dick";
p4.team = "harry";
for(i=0; i<players.size; i++)
{
players[i] thread rand_zombie_friendly();
}
}
// This function handles which player gets temporarily "cured" for X amount of time. It cycles throughout the whole game so don't worry, everyone will get a turn!
rand_zombie_friendly(players, p1, p2, p3, p4)
{
// Duration that no one is cured.
// 1-5mins. adjust as you wish.
time = [];
time[0] = 60;
time[1] = 120;
time[2] = 180;
time[3] = 240;
time[4] = 300;
// How long a player is cured for.
// 1-5mins. adjust as you wish.
is_cured_time = [];
is_cured_time[0] = 60;
is_cured_time[1] = 120;
is_cured_time[2] = 180;
is_cured_time[3] = 240;
is_cured_time[4] = 300;
while(1)
{
wait(time[randomInt(time.size)]);
player = randomInt(players.size);
player.ignoreme = true; //means they wont attack you
player.is_zombie = true; //means they stop following you
player.team = "axis"; //axis is zombies
wait(is_cured_time[randomInt(is_cured_time.size)]);
player.ignoreme = false;
player.is_zombie = false;
if(player == p1)
player.team = "allies";
else if(player == p2)
player.team = "tom";
else if(player == p3)
player.team = "dick";
else if(player == p4)
player.team = "harry";
}
}
Have fun.
Credits:
TheRevenantSkull - for pointing out teams to me.