Advertisement
Guest User

ghostmode.pwn

a guest
Jan 2nd, 2022
1,336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include    <a_samp>
  4. #include    <foreach>
  5. #include    <YSF>
  6. #include    <zcmd>
  7.  
  8. public OnFilterScriptInit()
  9. {
  10.     print("\n\n-------- [ GhostMode v1 ] --------\n\n]");
  11.     // Apenas uma reprodução/copia do original
  12.     return 1;
  13. }
  14.  
  15. new Iterator:Ghost<MAX_PLAYERS>;
  16.  
  17. public OnPlayerStreamIn(playerid, forplayerid)
  18. {
  19.     if(Iter_Contains(Ghost, playerid))
  20.     {
  21.         if(!Iter_Contains(Ghost, forplayerid))
  22.             RemovePlayerForPlayer(forplayerid, playerid);
  23.     }
  24.     return 1;
  25. }
  26.  
  27. CMD:ghostmode(playerid)
  28. {
  29.     if(Iter_Contains(Ghost, playerid))
  30.     {
  31.         Iter_Remove(Ghost, playerid);
  32.         foreach(new id : Player)
  33.         {
  34.             if(Iter_Contains(Ghost, id)) RemovePlayerForPlayer(playerid, id);
  35.             else
  36.             {
  37.                 AddPlayerForPlayer(id, playerid);
  38.  
  39.                 new Float:x, Float:y, Float;z;
  40.                 GetPlayerPos(playerid, x, y, z);
  41.                 SetPlayerPosForPlayer(id, playerid, x, y, z);
  42.             }
  43.         }
  44.         SendClientMessage(playerid, -1, "| INFO | Voce esta visivel para os jogadores");
  45.     }
  46.     else
  47.     {
  48.         foreach(new id : Player)
  49.         {
  50.             Iter_Add(Ghost, playerid);
  51.             if(Iter_Contains(Ghost, id)) AddPlayerForPlayer(playerid, id);
  52.             else RemovePlayerForPlayer(id, playerid);
  53.         }
  54.         SendClientMessage(playerid, -1, "| INFO | Voce esta invisivel para os jogadores");
  55.     }
  56.     return 1;
  57. }
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement