Grenade teamswitch removal

Topic created · 10 Posts · 84 Views
  • Hello,

    I've got a grenade script from mw2 that I want to implement for T6. Now the compiler compiles the script just fine, but if I open my server, it says failed to load mod without any fault code.

    Can someone help me with this issue?

    Init()
    {
    	thread onPlayerConnect();
    }
    onPlayerConnect()
    {
        while(true)
        {
            level waittill("connected", player);
            player thread onSemtex();
        }
    }
    onSemtex()
    {
        self endon("disconnect");
        self waittill("spawned_player");
        self.oldTeam = self.team;
        while(true)
        {
            self waittill("grenade_fire",grenade,weaponname);
            self thread checkGrenade(grenade, weaponname);    
        }
    }
    checkGrenade(grenade, weaponname)
    {
        self endon("disconnect");
        self endon("fixSemtex");
        grenade endon("death");
        self.oldTeam = self.team;
        while(true)
        {
            wait 0.05();
            if(self.team != self.oldTeam)
            {
                iPrintln("^7How sad..^3 " + self.name + "^7 tried to teamkill with a explosive! He failed miserably.");
                grenade delete();
                self notify("fixSemtex");
    			wait 5;
            }
        }
    }
    
  • @Cisco Make sure you are actually loading the compiled script. If you already are upload a screenshot of your console.

  • @JezuzLizard Here you go.
    alt text

  • @Cisco I've only ever seen that error occur in the case where the file isn't compiled so I wouldn't know what else could cause it.

  • @Cisco What is this script for bro .. I have a server .. I might be interested but I don't understand what it is for ..

  • @Ghost420_ Might be a grenade removal script

  • @Ghost420_ I believe its intended to patch an exploit relating to throwing a grenade at your teammates and quickly switching teams so it kills them.

  • @JezuzLizard The file is compiled using the gsc-tool. Even if I open the file, the code inside the .gsc is obfuscated. The script is indeed intended to fix the teamswitch grenade exploit.

  • @JezuzLizard Do you have any update for me regarding this issue?

  • what do you do if someone just throws a grenade and then switches teams without having the intend to kill their teammates it would still display the text

    also this works for me you can try it out and see if it works as you intended it

    init()
    {
    	level thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
        while(true)
        {
            level waittill("connected", player);
            player thread onSemtex();
        }
    }
    
    onSemtex()
    {
        self endon("disconnect");
        self waittill("spawned_player");
        while(true)
        {
            self waittill("grenade_fire",grenade,weaponname);
            self thread checkGrenade(grenade, weaponname);    
        }
    }
    
    checkGrenade(grenade, weaponname)
    {
        self endon("disconnect");
        self endon("fixSemtex");
        grenade endon("death");
        oldTeam = self.team;
        while(true)
        {
            wait 0.05;
            if(self.team != oldTeam)
            {
                iPrintln("^7How sad..^3 " + self.name + "^7 tried to teamkill with a explosive! He failed miserably.");
                grenade delete();
                self notify("fixSemtex");
            }
        }
    }
    
Log in to reply