Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

[REQUEST] No Throwing (script)

Custom scripts
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Mighty Spirit the 2
Superfighter
Superfighter
Posts: 174
Joined: Mon Jun 25, 2018 5:02 pm
Title: Wasted potential
SFD Account: ake004
SFD Alias: Retired SFD player
Started SFD: When melee was good
Location: SFD Veteran trauma hospital
Gender:
Age: 21

[REQUEST] No Throwing (script)

Post by Mighty Spirit the 2 » Thu Apr 01, 2021 6:40 pm

This is another script that is seemingly impossible to find. Like the title suggest its a script where when you throw your weapon it will leave your hand for just a few ms and then disappear. You will automatically regain the weapon you tried to throw. I saw it used in one or two severs a while ago. Still for some reason it doesn't exist on Workshop. This is a script that can be useful for a number of reasons. If someone has it please send it to me or better post it on Workshop.
0 x
🎶I will tell your story if you die
I will tell your story and keep you alive the best i can
...
But I've always had the feeling we would die young
Some die young
🎵

User avatar
Mighty Spirit the 2
Superfighter
Superfighter
Posts: 174
Joined: Mon Jun 25, 2018 5:02 pm
Title: Wasted potential
SFD Account: ake004
SFD Alias: Retired SFD player
Started SFD: When melee was good
Location: SFD Veteran trauma hospital
Gender:
Age: 21

Post by Mighty Spirit the 2 » Sat Aug 20, 2022 10:01 pm

Yeah, so i decided to just post this on here anyway, in-case someone ever comes looking for this (whatever reason may be).
Script was originally made for me by Sree in 2021.
If you know what your doing you could replace timer trigger with Events.UpdateCallback.Start(). I'm just posting the original file.

Code: Select all

/*
* author: Mighty Spirit the 2.
* description: Script that removes Throwing, except throwable.
*/

public void OnStartup()
{
    IObjectTimerTrigger Timer0 = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
    Timer0.SetIntervalTime(1);
    Timer0.SetRepeatCount (0);
    Timer0.SetScriptMethod("NoThrow");
    Timer0.Trigger();
    Game.RunCommand("/MSG No Throwing");
}

public void NoThrow(TriggerArgs args)
{
    foreach(IPlayer ply in Game.GetPlayers())
    {
        if(ply.IsThrowing && ply.CurrentWeaponDrawn != WeaponItemType.Thrown)
        {
                ply.RemoveWeaponItemType(ply.CurrentWeaponDrawn);
        }
    }
}


1 x
🎶I will tell your story if you die
I will tell your story and keep you alive the best i can
...
But I've always had the feeling we would die young
Some die young
🎵

phantom
Fighter
Fighter
Posts: 12
Joined: Sat Oct 22, 2022 2:36 pm
SFD Account: Phantom
Gender:
Age: 22
Contact:

Post by phantom » Sat Oct 22, 2022 6:06 pm

So, do you want a custom script or not?
And also that script you posted seems that it would only remove the thrown weapon but not give it back.

EDIT: I modified your script and it works like a charm :)

Code: Select all

// No Throwing
// By Phantom :)

public void AfterStartup()
{
    Game.ShowChatMessage("No Throwing", Color.Red);
    Events.UpdateCallback.Start(OnUpdate, 10);
}

public void OnUpdate(float elapsed)
{
    foreach (IPlayer ply in Game.GetPlayers())
    {
        if (ply.InThrowingMode)
        {
            var temp = ply.Disarm(ply.CurrentWeaponDrawn);
            temp.Remove();
            ply.GiveWeaponItem(temp.WeaponItem);
        }
    }
}
Last edited by KliPeH on Sun Oct 23, 2022 6:28 pm, edited 1 time in total.
Reason: Merged double-post.
0 x

User avatar
Mighty Spirit the 2
Superfighter
Superfighter
Posts: 174
Joined: Mon Jun 25, 2018 5:02 pm
Title: Wasted potential
SFD Account: ake004
SFD Alias: Retired SFD player
Started SFD: When melee was good
Location: SFD Veteran trauma hospital
Gender:
Age: 21

Post by Mighty Spirit the 2 » Sat Nov 05, 2022 2:39 am

phantom wrote:
Sat Oct 22, 2022 6:06 pm
So, do you want a custom script or not?
I posted my script because i don't have any interest in the game anymore (or anything else in my life for that matter), and just wanted others to be able to enjoy it if they wished.

I haven't tried your script, but the removal of the weapon was kind off the entire point. Back then i was in a totally different state of mind going for the extreme level of competitive that was unheard of at the time and will never be matched again by any sane player, the concept was: You throw your weapon = you loose it. That's it, no spam, no mercy. And also i noticed how your script doesn't return previous gun ammo or melee wpn durability in the coding. This means you can just enter throw mode anytime and get back a brand new weapon, no need to ever drop bazooka or GL again i'm guessing?
0 x
🎶I will tell your story if you die
I will tell your story and keep you alive the best i can
...
But I've always had the feeling we would die young
Some die young
🎵

phantom
Fighter
Fighter
Posts: 12
Joined: Sat Oct 22, 2022 2:36 pm
SFD Account: Phantom
Gender:
Age: 22
Contact:

Post by phantom » Sun Nov 06, 2022 2:46 pm

Mighty Spirit the 2 wrote:
Sat Nov 05, 2022 2:39 am
I noticed how your script doesn't return previous gun ammo or melee wpn durability in the coding. This means you can just enter throw mode anytime and get back a brand new weapon, no need to ever drop bazooka or GL again i'm guessing?
Sorry, I didn't thought that I just tested it with all weapons in map editor.
0 x

User avatar
Mighty Spirit the 2
Superfighter
Superfighter
Posts: 174
Joined: Mon Jun 25, 2018 5:02 pm
Title: Wasted potential
SFD Account: ake004
SFD Alias: Retired SFD player
Started SFD: When melee was good
Location: SFD Veteran trauma hospital
Gender:
Age: 21

Post by Mighty Spirit the 2 » Sun Nov 06, 2022 10:01 pm

phantom wrote:
Sun Nov 06, 2022 2:46 pm
Sorry, I didn't thought that I just tested it with all weapons in map editor.
That's not your fault, that's mine. I changed my mind later without updating what i wrote originally.
For my Original post, what you coded was pretty much what i asked for. 👍
0 x
🎶I will tell your story if you die
I will tell your story and keep you alive the best i can
...
But I've always had the feeling we would die young
Some die young
🎵

Post Reply