Player Invisibility Script
#1

I was just wondering, Could a PAWN Scripter be able to possible help me with giving me a code to let a 1337 Admin ingame be able to make themself Invisible to other players, But still see other players!

I heard on other topics that it was Impossible, But It isnt, Nothing is Impossible, Theres always a way.

Just giving Ideas, Just wondering, Maybe you could like do /invisible, And then your character goes into another virtual world, And it Spectates your player, That your controlling, And you can see Virtual World 0 and Virtual world 50 for example, Your Player - Virtual World 50, Everyone and all objects/vehicles - Virtual World 0.

If this is Possible, Please help, And if you would like to help Script for my Roleplay Server, We will make you a Permanent Admin and you will be accompanied by Two Other Scripters who will be at your side helping you script!
If you would like to, Private Message me on the forums and let me know.
You may be rewarded for your efforts, And our server is 24/7!
Reply
#2

If you make a RemovePlayerMapIcon or something you could...
Reply
#3

Untested, but it should work

pawn Code:
public OnPlayerCommadText(playerid, cmdtext[])
{
  if(!strcmp("/makemeinvisible", cmdtext))
  {
   
    new a = GetMaxPlayers();
    for(new id = 0; id > a; id++)
    {
      if(!IsPlayerConnected) continue;
      ShowPlayerNameTagForPlayer( id, playerid, false );
      SetPlayerMarkerForPlayer( id, playerid, 0xFFFFFF00 );
    }
    SendClientMessage(playerid, color, "You are invisible to other players");
    return 1;
  }

  if(!strcmp("/makemevisible", cmdtext))
  {
   
    new a = GetMaxPlayers();
    for(new id = 0; id > a; id++)
    {
      if(!IsPlayerConnected) continue;
      ShowPlayerNameTagForPlayer( id, playerid, true );
      SetPlayerMarkerForPlayer( id, playerid, COLOR );
    }
    SendClientMessage(playerid, color, "You are visible to other players");
    return 1;
  }
  return 0;
}
Reply
#4

He means make his player invisible. Your right though, Jbosh123. It isnt impossible.

The only problem is you would have to create your own multiplayer modification to do so. Best of luck :P
Reply
#5

Since pawno is single threaded it should be possible in theory to force desync with timers to make the player invisible, but I have no clue how to start
Reply
#6

In the LAdmin admin script,there is a command,but it spawns a car and puts you in it and that car is invisible :P
Reply
#7

Damn, thats genious. Thank you !
pawn Code:
public OnPlayerCommadText(playerid, cmdtext[])
{
  if(!strcmp("/makemeinvisible", cmdtext))
  {
   
    new a = GetMaxPlayers();
    for(new id = 0; id > a; id++)
    {
      if(!IsPlayerConnected(id)) continue;
      ShowPlayerNameTagForPlayer( id, playerid, false );
      SetPlayerMarkerForPlayer( id, playerid, 0xFFFFFF00 );
    }
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    nrg = CreateVehicle(522, x, y, z, a, -1, -1, -1);
    LinkVehicleToInterior(nrg, 16);
    PutPlayerInVehicle(playerid, nrg, 0);
    SendClientMessage(playerid, color, "You are invisible to other players. Just don't leave your vehicle");
    SendClientMessage(playerid, color, "To become visible again, just press ENTER");
    return 1;
  }
  return 0;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
  if(vehicleid == nrg)
  {
    DestroyVehicle(nrg);
    new a = GetMaxPlayers();
    for(new id = 0; id > a; id++)
    {
      if(!IsPlayerConnected) continue;
      ShowPlayerNameTagForPlayer( id, playerid, true );
      SetPlayerMarkerForPlayer( id, playerid, COLOR );
    }
    SendClientMessage(playerid, color, "You are now visible to other players");
  }
  return 1;
}
Reply
#8

return 0 in OnPlayerUpdate and other players won't get any packages from you, so they will just see you standing where your last position was with 0 health. You will be able to move around and you will get packages form other players, so they will be synced for you.
Reply
#9

Quote:
Originally Posted by $ЂЯĢ
return 0 in OnPlayerUpdate and other players won't get any packages from you, so they will just see you standing where your last position was with 0 health. You will be able to move around and you will get packages form other players, so they will be synced for you.
That's how I did it.

pawn Code:
public OnPlayerUpdate(playerid)
{
  if(PInvisible[playerid])return 0;
  return 1;
}
Reply
#10

Nice ideas, im gonna be using this, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)