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

The Dark Side

Former Staff Member
Messages
1,004
Reaction score
770
Points
993
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
My aim wasnt to have it use god mode, that was an example. :smile: Much love man. Good work. Thank you. :smile:
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
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
ah you did it with the angle, good idea. I tried it with the tracebullet function. Do you know the key for players with the tracebullet function? :grinning:
 

Liam

BU4
Messages
185
Reaction score
171
Points
818
ah you did it with the angle, good idea. I tried it with the tracebullet function. Do you know the key for players with the tracebullet function? :grinning:
If you want tracebullet to work with players Here;

Code:
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self)["entity"];
if(isPlayer(trace)) //check if the entity is actually a player
{
//CODE Here
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,121
Reaction score
2,886
Points
1,103
If you want tracebullet to work with players Here;

Code:
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self)["entity"];
if(isPlayer(trace)) //check if the entity is actually a player
{
//CODE Here
}
Ah you did it like this, thank you a good idea yeah :smile:
 
Top