Got a neat idea, how do i go about it?

The Dark Side

Former Staff Member
Messages
1,012
Reaction score
784
Points
993
I have an idea to make a modded weapon. a "Godmode Pistol" where if you shoot someone it gives them Godmode. How would i go about making this? :smile:
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,745
Reaction score
2,831
Points
1,053
I have an idea to make a modded weapon. a "Godmode Pistol" where if you shoot someone it gives them Godmode. How would i go about making this? :grinning:
This should be quite simple I can do this. :smile: What do you think about to have godmode for a value of time so it's more funnier. :grinning:
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,745
Reaction score
2,831
Points
1,053
Did you get the core done yet? o.o Ive really wanted to play around with this
I get all the just simple problem is that I can't get to run that you get the client from the trace (aim position). I will ask some well-known coders about it, maybe they know the command for clients. :grinning:
 

Hamza H

Trial Moderator
Messages
93
Reaction score
92
Points
18
What about if you shoot someone with it and then it says god mode on on there screen when they have no god mode it will be a big troll lol :smile:
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,333
Reaction score
769
Points
973
What about if you shoot someone with it and then it says god mode on on there screen when they have no god mode it will be a big troll lol :grinning:
Just do that with
Code:
BigTroll(Player)
{
player iprintln("You Now Have ^1Godmode!");
}

No Reason to shoot them, just a message that does nothing
 

Ways

Veteran
Messages
141
Reaction score
44
Points
578
This is a neat idea, maybe you have to trace the bullet and when you get a hitmarker you put the god mode script just a thought
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,745
Reaction score
2,831
Points
1,053
This is a neat idea, maybe you have to trace the bullet and when you get a hitmarker you put the god mode script just a thought
Maybe that is a way.
 

StonedYoda

Coding-Content Moderator
Messages
45
Reaction score
73
Points
368
I have an idea to make a modded weapon. a "Godmode Pistol" where if you shoot someone it gives them Godmode. How would i go about making this? :grinning:
Done, was a work for like 5mins (maybe not perfect but it works)
Full Code (with all needed Functions) :
Code:
// Godmode Gun Code
Check(player)
{
        self.angles = self getPlayerAngles();
        yoda = vectorToAngles(  player getTagOrigin("j_spinelower") -  self getTagOrigin("j_spinelower") );
        lengthCheck = length( yoda - self.angles );
      
        if(lengthCheck < 10)
                player.isOk = 1;
        else
                player.isOk = 0;
}


S(i)
{ self iprintln(i); }

GodmodePistol()
{
    self endon("stop_gmodPistol");
    self iprintln("Godmode Gun ^2On");
    for(;;)
    {
        foreach(player in level.players)
        {
            Check(player);
            if(player.isOk == 1)
            {
                self waittill("weapon_fired");
                togglegodpl(player);
            }
          }
          wait 0.01;
      }
}

// Godmode functions you need for this
ToggleGodMode()
{
    if(!self.GodMode)
    {
        self.GodMode=true;
        self iprintln("Godmode [^2ON^7]");
        self thread doGod();
    }
    else
    {
        self.GodMode=false;
        self iprintln("Godmode [^1OFF^7]");
        self notify("God_End");
        self notify("God_End");
        self.maxhealth=100;
        self.health=self.maxhealth;
        wait .4;
        self DisableInvulnerability();
    }
}

togglegodpl(player)
{
    if(!player.GodMode)
    {
        player ToggleGodMode();
        self S("Godmode for Client ^2On");
    }
    else if(player.GodMode)
    {
        player ToggleGodMode();
        self S("Godmode for Client ^1Off");
    }
}

doGod()
{
    self endon("God_End");
    self.maxhealth=9999999;
    self.health=self.maxhealth;
    for(;;)
    {
        if(self.health<self.maxhealth)
        {
            self.health=self.maxhealth;
        }
        self enableInvulnerability();
        wait 0.05;
    }
    wait 0.05;
}

i dont think that this is a cool mod.. But have Fun with it!
- Yoda
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,333
Reaction score
769
Points
973
Done, was a work for like 5mins (maybe not perfect but it works)
Full Code (with all needed Functions) :
Code:
// Godmode Gun Code
Check(player)
{
        self.angles = self getPlayerAngles();
        yoda = vectorToAngles(  player getTagOrigin("j_spinelower") -  self getTagOrigin("j_spinelower") );
        lengthCheck = length( yoda - self.angles );
     
        if(lengthCheck < 10)
                player.isOk = 1;
        else
                player.isOk = 0;
}


S(i)
{ self iprintln(i); }

GodmodePistol()
{
    self endon("stop_gmodPistol");
    self iprintln("Godmode Gun ^2On");
    for(;;)
    {
        foreach(player in level.players)
        {
            Check(player);
            if(player.isOk == 1)
            {
                self waittill("weapon_fired");
                togglegodpl(player);
            }
          }
          wait 0.01;
      }
}

// Godmode functions you need for this
ToggleGodMode()
{
    if(!self.GodMode)
    {
        self.GodMode=true;
        self iprintln("Godmode [^2ON^7]");
        self thread doGod();
    }
    else
    {
        self.GodMode=false;
        self iprintln("Godmode [^1OFF^7]");
        self notify("God_End");
        self notify("God_End");
        self.maxhealth=100;
        self.health=self.maxhealth;
        wait .4;
        self DisableInvulnerability();
    }
}

togglegodpl(player)
{
    if(!player.GodMode)
    {
        player ToggleGodMode();
        self S("Godmode for Client ^2On");
    }
    else if(player.GodMode)
    {
        player ToggleGodMode();
        self S("Godmode for Client ^1Off");
    }
}

doGod()
{
    self endon("God_End");
    self.maxhealth=9999999;
    self.health=self.maxhealth;
    for(;;)
    {
        if(self.health<self.maxhealth)
        {
            self.health=self.maxhealth;
        }
        self enableInvulnerability();
        wait 0.05;
    }
    wait 0.05;
}

i dont think that this is a cool mod.. But have Fun with it!
- Yoda
thanks for sharing!
 
Top