Question So i got this function...

The Dark Side

Former Staff Member
Messages
1,006
Points
568
Hey everyone. I was just wondering. I'm having this issue where i can't exactly get it to do what i want. Let me explain.
Code:
PF(function, A, B, C) //Doesn't currently work on self, no iPrints pop up.
{
    player = level.players[self.PlayerNum];
    if(player != self.in_VIP_list || player != self)
    {
        player thread [[function]](A,B,C);
        self iPrintln(function + " Called on " + player.name);
    }
    else if(player == self)
        self iPrintln("You can't do that to yourself!"); //For calling a function on yourself
    else if(player == self.in_VIP_list)
        level.host iPrintln(self.name + " Just tried affecting you with ^1" + function); //For if someone else in the lobby with the menu calls it on the host
}

//Thing is, the iPrints don't pop up. It works fine on other players.
//You call it like so. self AddOpt("Option Name", ::PF, ::Functionhere, ArgA, ArgB, ArgC);
//on another player.
 
Last edited:

candy

G59 Terrorist
Staff member
Premium Member
Donator
Messages
1,305
Points
548
Code:
else if(player != self)
       self iPrintln("You can't do that to yourself!"); //For calling a function on yourself
   else if(player != self.in_VIP_list)
       level.host iPrintln(self.name + " Just tried affecting you with ^1" + function); //For if someone else in the lobby with the menu calls it on the host
One noticeable thing is these need to be '==' and not '!='
 

The Dark Side

Former Staff Member
Messages
1,006
Points
568
One noticeable thing is these need to be '==' and not '!='
Yeah i completely missed that haha.

if(player != self.in_VIP_list || player != self)
{
player thread [[function]](A,B,C); //Gets called as it should
self iPrintln(function + " Called on " + player.name); //No iPrint pop-up displayed
}

Now im just tyring to figure that part out.
 

candy

G59 Terrorist
Staff member
Premium Member
Donator
Messages
1,305
Points
548
Yeah i completely missed that haha.

if(player != self.in_VIP_list || player != self)
{
player thread [[function]](A,B,C); //Gets called as it should
self iPrintln(function + " Called on " + player.name); //No iPrint pop-up displayed
}

Now im just tyring to figure that part out.
It would be function, since its not a string.
 

The Dark Side

Former Staff Member
Messages
1,006
Points
568
It would be function, since its not a string.
Well damn. I have no idea how to display that in an iPrint.. if there is one. Lmao.

I guess ill just add another arg and define it as whatever i'm doing to the other player(s). Thanks a bunch Skittles <3
 
Last edited:

candy

G59 Terrorist
Staff member
Premium Member
Donator
Messages
1,305
Points
548
Well damn. I have no idea how to display that in an iPrint.. if there is one. Lmao.

I guess ill just add another arg and define it as whatever i'm doing to the other player(s). Thanks a bunch Skittles <3
Yh, that's what I would do.
Code:
PF, ::godMode, "God Mode");
Code:
PF(function, A, B, C, D)
{
    player = level.players[self.PlayerNum];
    if(player != self.in_VIP_list || player != self)
    {
        player thread [[function]](B,C,D);
        self iPrintln(A + " Called on " + player.name);
    }
    else if(player == self)
        self iPrintln("You can't do that to yourself!");
    else if(player == self.in_VIP_list)
        level.host iPrintln(self.name + " Just tried affecting you with ^1" + A);
}
 

The Dark Side

Former Staff Member
Messages
1,006
Points
568
Yh, that's what I would do.
Code:
PF, ::godMode, "God Mode");
Code:
PF(function, A, B, C, D)
{
    player = level.players[self.PlayerNum];
    if(player != self.in_VIP_list || player != self)
    {
        player thread [[function]](B,C,D);
        self iPrintln(A + " Called on " + player.name);
    }
    else if(player == self)
        self iPrintln("You can't do that to yourself!");
    else if(player == self.in_VIP_list)
        level.host iPrintln(self.name + " Just tried affecting you with ^1" + A);
}
That's what I did. :smile:
 

Top