Skip to content

Commit

Permalink
make lr take away knife
Browse files Browse the repository at this point in the history
  • Loading branch information
destoer committed Nov 24, 2023
1 parent aad4ce2 commit 61d350c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
6 changes: 6 additions & 0 deletions src/Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public static void test_laser(CCSPlayerController? invoke, CommandInfo command)
Lib.draw_laser(invoke);
}

[RequiresPermissions("@jail/debug")]
public static void test_strip_cmd(CCSPlayerController? invoke, CommandInfo command)
{
invoke.strip_weapons(true);
}

// are these commands allowed or not?
public static readonly bool enable = true;

Expand Down
1 change: 1 addition & 0 deletions src/Jail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void register_commands()
AddCommand("lr_debug","debug : start an lr without restriction",lr.lr_debug_cmd);
AddCommand("is_blocked","debug : print block state",warden.block.is_blocked);
AddCommand("test_laser","test laser",Debug.test_laser);
AddCommand("test_strip","test weapon strip",Debug.test_strip_cmd);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/LastRequest/LRKnife.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public LRKnife(LastRequest manager,int lr_slot, int player_slot, String choice)
public override void init_player(CCSPlayerController player)
{
// give player a knife and restrict them to it
player.GiveNamedItem("weapon_knife");
weapon_restrict = "knife";

// Handle options
Expand Down
2 changes: 1 addition & 1 deletion src/LastRequest/LastRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void init_player_common(CCSPlayerController? player)
// strip weapons restore hp
player.set_health(100);
player.set_armour(100);
player.strip_weapons();
player.strip_weapons(true);
player.GiveNamedItem("item_assaultsuit");
}

Expand Down
3 changes: 2 additions & 1 deletion src/LastRequest/ScoutKnife.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public LRScoutKnife(LastRequest manager,int lr_slot, int player_slot, String cho
}

public override void init_player(CCSPlayerController player)
{
{
player.GiveNamedItem("weapon_knife");
player.GiveNamedItem("weapon_ssg08");
player.set_gravity(0.1f);
}
Expand Down
12 changes: 5 additions & 7 deletions src/Lib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,10 @@ static public bool is_generic_admin(this CCSPlayerController? player)

static public void draw_laser(CCSPlayerController? player)
{
/*
CEnvLaser? laser = Utilities.CreateEntityByName<CEnvLaser>("env_laser");
CEnvBeam? laser = Utilities.CreateEntityByName<CEnvBeam>("env_beam");
CEnvBeam? end = Utilities.CreateEntityByName<CEnvBeam>("env_beam");

end.Globalname = "boop!";
if(laser == null)
if(laser == null || end == null)
{
return;
}
Expand All @@ -171,17 +168,18 @@ static public void draw_laser(CCSPlayerController? player)
laser.Width = 2.0f;
//laser.Life = 1.0f;

end.Globalname = "boop!";

Vector player_vec = player.PlayerPawn.Value.AbsOrigin;
Vector end_pos = new Vector(player_vec.X + 100.0f,player_vec.Y + 100.0f, player_vec.Z + 100.0f);

end.Teleport(end_pos, player.PlayerPawn.Value.AbsRotation, player.PlayerPawn.Value.AbsVelocity);
end.DispatchSpawn();

laser.LaserTarget = "boop!";
laser.EndEntity = "boop!";

laser.Teleport(player.PlayerPawn.Value.AbsOrigin, player.PlayerPawn.Value.AbsRotation, player.PlayerPawn.Value.AbsVelocity);
laser.DispatchSpawn();
*/
}

static public void mute(this CCSPlayerController? player)
Expand Down

0 comments on commit 61d350c

Please sign in to comment.