Answered Player Option

SwitchBaseCFW

New Member
Messages
6
Reaction score
2
Points
3
hi,

i make a menu and i want to give god mode,unlimited ammo or aimbot to a guy.
What is the code for this ?

Thanks you,

SwitchBaseCFW

(Sorry,i'm not english i'm french)
 

The Dark Side

Former Staff Member
Messages
1,007
Reaction score
784
Points
993
hi,

i make a menu and i want to give god mode,unlimited ammo or aimbot to a guy.
What is the code for this ?

Thanks you,

SwitchBaseCFW

(Sorry,i'm not english i'm french)
Lets take God mode for example.

Code:
godMode()
{
    if(!isDefined(self.godMode))
    {
        self enableInvulnerability();
        self.godMode = true;
    }
    else
    {
        self disableInvulnerability();
        self.godMode = undefined;
    }
}

^ This code. See how it all says "self"? Its called on yourSELF. To call it on a PLAYER, simply switch all the "self"'s to "player". Like so.

Code:
godMode(player)
{
    if(!isDefined(player.godMode))
    {
        player enableInvulnerability();
        player.godMode = true;
    }
    else
    {
        player disableInvulnerability();
        player.godMode = undefined;
    }
}

Also don't forget to call it with "player", and don't forget a "player" in the parenthesis function call.
The other codes, aimbot, whatever. Can be called in such a way that you dont need a whole function as well. Like this.

Code:
Aimbotgiveplayernowlol(player)
{
    player thread aimbotcodehere();
}

Pretty simple. Get the just of it?
 

VerTical

CEO
Donator
Messages
0
Reaction score
-82
Points
664
Lets take God mode for example.

Code:
godMode()
{
    if(!isDefined(self.godMode))
    {
        self enableInvulnerability();
        self.godMode = true;
    }
    else
    {
        self disableInvulnerability();
        self.godMode = undefined;
    }
}

^ This code. See how it all says "self"? Its called on yourSELF. To call it on a PLAYER, simply switch all the "self"'s to "player". Like so.

Code:
godMode(player)
{
    if(!isDefined(player.godMode))
    {
        player enableInvulnerability();
        player.godMode = true;
    }
    else
    {
        player disableInvulnerability();
        player.godMode = undefined;
    }
}

Also don't forget to call it with "player", and don't forget a "player" in the parenthesis function call.

better you use only the player function You can do Player = self
A_Option( 9, "Main", "Option10", ::godMode, self );
 

The Dark Side

Former Staff Member
Messages
1,007
Reaction score
784
Points
993
better you use only the player function You can do Player = self
A_Option( 9, "Main", "Option10", ::godMode, self );
You could also have a player option like:

Code:
playercallafunction(function, in1, in2)
{
    player = self;
    self thread [[function]](in1,in2);
}

and call it like
self addOption("submenu","function name here",::tongueclosed:layercallafunction,::godmode,"","");

There are alot of ways. Lmao. Havent tested this though. ^
 

VerTical

CEO
Donator
Messages
0
Reaction score
-82
Points
664
You could also have a player option like:

Code:
playercallafunction(function, in1, in2)
{
    player = self;
    self thread [[function]](in1,in2);
}

and call it like
self addOption("submenu","function name here",::tongueclosed:layercallafunction,::godmode,"","");

There are alot of ways. Lmao. Havent tested this though. ^
Yep this will too work! :smile:
 

SwitchBaseCFW

New Member
Messages
6
Reaction score
2
Points
3
like this ?
help1.png
 
Top