Invisible players.
#1

Now, before you all start with "it is impossible and cannot be done", I have seen it happen and it can be done.
I played in a server where you are a supernatural being and you can turn invisible.
When invisible you can still see other players so the virtual world was not changed.

While invisible you could still see yourself and you were not in a vehicle, so, I don't think the player was in a vehicle.
I mentioned the vehicle part because everyone who said it might be possible said you should link a vehicle to an interior and put the player in the vehicle. I have not tested it myself but I would assume that you would still seem like in a vehicle, even an invisible one. Which did not happen when I turned invisible.

Now, I can describe how it went. Becoming invisible was tied to a key press using OnPlayerKeyStateChange (that doesn't matter tho, just thought I would mention it), once you pressed that key your screen would turn purple if I remember correctly, maybe not purple but it did change color (not green like night vision, that's for sure) and that's pretty much how it was. I beat up players and whatnot, I was a regular player, could do what anyone else could, I was just invisible.

So if anyone has an idea on how it was done and how I can do it, please reply here.

Thanks in advance.
Reply
#2

It Maybe spec mod with come other callback. Or adding some custom object or removing the player data.
I am also not sure about that.
Reply
#3

Yea i would go for what SoFahim says it probably has to do something with spectating.
let me ask you some things..

1.The colour you had was purple..ish ? maybe not like nightvision but like heat-vision ?
2.could you also use your weapons ?...
3.could you walk and climb like normal?
4.is it possible to show a picture ?
5.is it possible that it said you were invisible but inreality others could just see you?
Reply
#4

Quote:
Originally Posted by AIped
Посмотреть сообщение
Yea i would go for what SoFahim says it probably has to do something with spectating.
let me ask you some things..

1.The colour you had was purple..ish ? maybe not like nightvision but like heat-vision ?
2.could you also use your weapons ?...
3.could you walk and climb like normal?
4.is it possible to show a picture ?
5.is it possible that it said you were invisible but inreality others could just see you?
1. It could be like heat-vision, I will go in game now and test it and edit this reply.
2. Yes, I used weapons.
3. Yes.
4. Nope, I don't have access to that ability anymore on that server I mentioned.
5. Nope, I was completely invisible. I hit players and they had no idea what was happening.
I was also attacked by someone invisible. Basically, I was definitely and ultimately invisible.
I was capable of seeing myself, but others were not capable of seeing me.


EDIT: No, not like Thermal Goggles, it is not that kind of purple. Sorry. I honestly don't even know what it was... ok, maybe it was Thermal Goggles? I honestly don't quite remember, it happend over a year ago. Let's assume it was and was not Thermal Goggles at the same time?

EDIT 2: Wait, I am now certain it's not like Thermal Goggles because I remember not having the object on my face.


EDIT 3:
Quote:
Originally Posted by SoFahim
Посмотреть сообщение
It Maybe spec mod with come other callback. Or adding some custom object or removing the player data.
I am also not sure about that.
Most likely not related to spectating since I was able to see myself walk around and jump. Maybe an object, can't rule that one out.
Reply
#5

Bump.
Reply
#6

Bump?
Reply
#7

Well YSF supposedly has a ShowPlayerForPlayer and a HidePlayerForPlayer function though I personally have never tested it but it seems to be there. It should work something like this:

pawn Код:
#include <a_samp>
#include <YSF>
new static bool: Visible[MAX_PLAYERS] = true;

public OnPlayerConnect(playerid)
{
    Visible[playerid] = true;
    CallLocalFunction("HOOK_OnPlayerConnect", "i", playerid);
    return 1;
}

#if defined _ALS_OnPlayerConnect
  #undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif

#define OnPlayerConnect HOOK_OnPlayerConnect

forward HOOK_OnPlayerConnect(playerid);

stock IsPlayerVisible(playerid)
{
    if(Visible[playerid] == true)
        return 1;
   
    return 0;
}

stock SetPlayerVisible(playerid, bool: visible_)
{
    if(visible_)
    {
        if(Visible[playerid])
        {
            SyncPlayerVisible(playerid); // player is already visible, so sync it just in case
            return 1;
        }
       
        else
        {
            Visible[playerid] = true;
            SyncPlayerVisible(playerid);
        }
    }
   
    else
    {
        Visible_[playerid] = false;
        SyncPlayerVisable(playerid);
        return 1;
    }
}

static stock SyncPlayerVisible(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(Visible[playerid])
        {
            for(new i; i < MAX_PLAYERS; i++)
            {
                if(!IsPlayerConnected(i)) continue;
               
                ShowPlayerForPlayer(i, playerid);
            }
        }
        else
        {
            for(new i; i < MAX_PLAYERS; i++)
            {
                if(!IsPlayerConnected(i)) continue;
                ShowPlayerForPlayer(i, playerid);
            }
        }
    }
   
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    if(Visible[playerid])
    {
        ShowPlayerForPlayer(forplayerid, playerid);
    }
    else HidePlayerForPlayer(forplayerid, playerid);
    CallLocalFunction("HOOK_OnPlayerStreamIn", "ii", playerid, forplayerid);
    return 1;
}

#if defined _ALS_OnPlayerStreamIn
  #undef OnPlayerStreamIn
#else
#define _ALS_OnPlayerStreamIn
#endif

#define OnPlayerStreamIn HOOK_OnPlayerStreamIn

forward HOOK_OnPlayerStreamIn(playerid, forplayerid);
(http://pastebin.com/R5H0bKED)

This is set up as an include, use IsPlayerVisible to check if the player is visible & SetPlayerVisible to toggle their visibility, ex:
pawn Код:
CMD:v(playerid, params[])
{
    if(IsPlayerVisible(playerid))
    {
        SetPlayerVisible(playerid, false);
    }
   
    else SetPlayerVisible(playerid, true);
    return 1;
}
Reply
#8

I think you'd mean hybrid invisiblity?

Код:
							    new Float: x, Float: y, Float: z;
								    GetPlayerPos(playerid, x, y, z);
								    SetPlayerPos(playerid,x,y,z-20);
								    SetPlayerWeather(playerid, -66);
								    SetPlayerTime(playerid,12,0);
Enjoy!
Reply
#9

Quote:
Originally Posted by faff
Посмотреть сообщение
I think you'd mean hybrid invisiblity?

Код:
							    new Float: x, Float: y, Float: z;
								    GetPlayerPos(playerid, x, y, z);
								    SetPlayerPos(playerid,x,y,z-20);
								    SetPlayerWeather(playerid, -66);
								    SetPlayerTime(playerid,12,0);
Enjoy!
I do mean Hybrid invisibility.
I have tested your code in a few different variations and not a single one works. Tried setting the position after the weather, after the time and even tried messing with the position a bit. Nothing seems to work, other players on my server claim that they can still see me.


EDIT: Testing Abagail's post
Reply
#10

Simply return false on OnPlayerUpdate. Ignore all of the said above.

That will cause the player to desync for other players, while he's fine for himself. Make sure you teleport the player somewhere, desync him then teleport him back to his original position.

pawn Код:
OnPlayerUpdate(playerid)
{
    if(IsInvisible[playerid])
    {
        return 0;
    }
}
If you still haven't got it. I'll provide you a few more examples.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)