Guest User

Untitled

a guest
Jan 24th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.68 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnFilterScriptInit()
  4. {
  5.     for(new i;i<MAX_PLAYERS;i++) {
  6.         if(IsPlayerConnected(i))
  7.         {
  8.             new string[12];
  9.             format(string, sizeof(string), "%d_%d", (random(89)+10), (random(98999)+1000));
  10.             SetPVarString(i, "MaskID", string);
  11.         }
  12.     }
  13.     return 1;
  14. }
  15.  
  16. public OnPlayerConnect(playerid)
  17. {
  18.     new string[12];
  19.     format(string, sizeof(string), "%d_%d", (random(89)+10), (random(98999)+1000));
  20.     SetPVarString(playerid, "MaskID", string);
  21.     for(new i=0;i<MAX_PLAYERS;i++)
  22.         if(IsPlayerConnected(i))
  23.             if(GetPVarInt(i, "Masked") == 1)
  24.                 ShowPlayerNameTagForPlayer(playerid, i, 0);
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerText(playerid, text[])
  29. {
  30.     if(GetPVarInt(playerid, "Masked") == 1)
  31.     {
  32.         new string[172];
  33.         GetPVarString(playerid, "MaskID", string, sizeof(string));
  34.         format(string, sizeof(string), "[Mask %s]: %s", string, text);
  35.         SendClientMessageToAll(0xFFFFFFAA, string);
  36.         return 0;
  37.     }
  38.     else return 1;
  39. }
  40.  
  41. public OnPlayerCommandText(playerid, cmdtext[])
  42. {
  43.     if(strcmp("/mask", cmdtext, true, 10) == 0)
  44.     {
  45.         if(GetPVarInt(playerid, "Masked") == 0)
  46.         {
  47.             SetPVarInt(playerid, "Masked", true);
  48.             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~You've put a mask on.", 3500, 3);
  49.             for(new i=0;i<MAX_PLAYERS;i++)
  50.                 if(IsPlayerConnected(i))
  51.                     ShowPlayerNameTagForPlayer(i, playerid, 0);
  52.         }
  53.         else
  54.         {
  55.             SetPVarInt(playerid, "Masked", false);
  56.             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~r~You've put a mask off.", 3500, 3);
  57.             for(new i=0;i<MAX_PLAYERS;i++)
  58.                 if(IsPlayerConnected(i))
  59.                     ShowPlayerNameTagForPlayer(i, playerid, 1);
  60.         }
  61.         return 1;
  62.     }
  63.     return 0;
  64. }
Add Comment
Please, Sign In to add comment