ACS Team Player Problems
Posted: Tue Jan 06, 2015 6:33 pm
I'm trying to setup a new gamemode that works with TLMS.
The gist of it is, every 10 seconds one team is given a weapon and the other is disarmed. This alternates till everyone on one team is dead.
Problem is my script is giving both teams the weapon at the same time, and then disarming both teams at the same time. I'm stumped, any ideas?
Attempt 1:
Attempt 2:
The gist of it is, every 10 seconds one team is given a weapon and the other is disarmed. This alternates till everyone on one team is dead.
Problem is my script is giving both teams the weapon at the same time, and then disarming both teams at the same time. I'm stumped, any ideas?
Attempt 1:
Code: Select all
#include "zcommon.acs"
// assign players a TID
Script 749 ENTER
{
Thing_ChangeTID(0, 1000 + PlayerNumber()); // This assigns the TID
}
// Set player health to 1 and remove all weapons
script 751 ENTER
{
int playerTID = ActivatorTID();
SetActorProperty (playerTID, APROP_Health, 1);
ClearInventory();
}
// Set player health to 1 and remove all weapons
script 750 RESPAWN
{
int playerTID = ActivatorTID();
SetActorProperty (playerTID, APROP_Health, 1);
ClearInventory();
}
// choose starting team
script 754 OPEN
{
ACS_Execute(random(752, 753), 0, 0, 0, 0);
}
// red team then blue team
script 752 (void)
{
ACS_Execute (755, 0, 0, 0, 0);
Delay (350); // 10 seconds
ACS_Execute (756, 0, 0, 0, 0);
Delay (350);
Restart;
}
// blue team then red team
script 753 (void)
{
ACS_Execute (756, 0, 0, 0, 0);
Delay (350); // 10 seconds
ACS_Execute (755, 0, 0, 0, 0);
Delay (350);
Restart;
}
// give red team chainsaws
script 755 (void)
{
int playerTID = ActivatorTID();
int teamNumber = GetPlayerInfo(playerTID, PLAYERINFO_TEAM);
if (teamNumber == 1)
{
Print (s:"Give RED TEAM chainsaws");
GiveInventory("Chainsaw", 1);
}
else
{
ClearInventory();
}
}
// give blue team chainsaws
script 756 (void)
{
int playerTID = ActivatorTID();
int teamNumber = GetPlayerInfo(playerTID, PLAYERINFO_TEAM);
if (teamNumber == 0)
{
Print (s:"Give BLUE TEAM chainsaws");
GiveInventory("Chainsaw", 1);
}
else
{
ClearInventory();
}
}Code: Select all
Script 1 OPEN
{
ACS_ExecuteAlways(2, 0, 0, 0);
Delay(350);
ACS_ExecuteAlways(3, 0, 0, 0);
Delay(350);
Restart;
}
Script 2 (void)
{
int teamNumber = GetPlayerInfo(0, PLAYERINFO_TEAM);
if (teamNumber == 0)
{
GiveInventory("Chainsaw", 1);
}
else
{
ClearInventory();
}
}
Script 3 (void)
{
int teamNumber = GetPlayerInfo(0, PLAYERINFO_TEAM);
if (teamNumber == 1)
{
GiveInventory("Chainsaw", 1);
}
else
{
ClearInventory();
}
}
Script 4 ENTER
{
//SetActorProperty (0, APROP_Health, 1);
ClearInventory();
}
Script 5 RESPAWN
{
//SetActorProperty (0, APROP_Health, 1);
ClearInventory();
}