Guest User

Untitled

a guest
Aug 11th, 2015
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.89 KB | None | 0 0
  1. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  3. ////////////////////////////////////////////////////////////////////////////Credits to John Ledingham! Please do not change the credits./////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  5. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  6. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  7.  
  8. CMD:buymask
  9.     if (!IsAt247(playerid)) {
  10.     SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not in a 24/7!");
  11.     return 1;
  12. {
  13.     //Put here your thing to check if he is logged in,i will use PlayerLogged as an example:
  14.     if(PlayerLogged[playerid] != 1) return SendClientMessage(playerid, -1, "You must be logged in to use this command.");
  15.     if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, -1, "You dont have enough cash to buy a mask."); //you can change the price later
  16.     if(IsPlayerInRangeOfPoint(playerid, range, posx, posy, posz))
  17.     {
  18.         GivePlayerMoney(playerid, -20000);
  19.         pInfo[playerid][pMask] = 1;
  20.         pInfo[playerid][pMasked] = 0;
  21.         SendClientMessage(playerid, -1, "You have successfully bought a mask for 20000 San Andreas Dollars.");
  22.     }
  23.     return 1;
  24. }
  25.  
  26.  
  27. CMD:mask(playerid)
  28. {
  29.     if(PlayerLogged[playerid] != 1) return SendClientMessage(playerid, -1, "You must be logged in to use this command.");
  30.     if(pInfo[playerid][pMask] == 0) return SendClientMessage(playerid, -1, "You do not have a mask.");
  31.     if(pInfo[playerid][pMasked] == 0)
  32.     {
  33.         pInfo[playerid][pMasked] = 1;
  34.         SendClientMessage(playerid, -1, "You have put on your mask.");
  35.         for(new i = 0; i < MAX_PLAYERS; i++)
  36.         {
  37.             ShowPlayerNameTagForPlayer(i, playerid, false);
  38.         }
  39.     }
  40.     else
  41.     {
  42.         pInfo[playerid][pMasked] = 0;
  43.         SendClientMessage(playerid, -1, "You have removed your mask.");
  44.         for(new i = 0; i < MAX_PLAYERS; i++)
  45.         {
  46.             ShowPlayerNameTagForPlayer(i, playerid, true);
  47.         }
  48.     }
  49.     return 1;
  50. }
  51.  
  52.  
  53. //Put this under OnPlayerText in the part of using normal IC chat
  54.  
  55. if(pInfo[playerid][pMasked] == 0)
  56. {
  57.     //normal chat IC,in your script
  58. }
  59. else
  60. {
  61.     new string[128];
  62.     format(string, sizeof(string), "Stranger says: %s, put chat here);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment