Guest User

Untitled

a guest
Apr 1st, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.99 KB | None | 0 0
  1. CMD:safe(playerid, params[])
  2. {
  3.     if(IsPlayerConnected(playerid))
  4.     {
  5.         if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pLeader] == 15 ||
  6.         PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pMember] == 15)
  7.         {
  8.             new x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
  9.             new string[128];
  10.             if(sscanf(params,"s[128]",params))
  11.             {
  12.                 if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
  13.                 {
  14.                     format(string, sizeof(string), "Faction materials: "WHITE"%d", DynamicFactions[x][fMats]);
  15.                     SendClientMessage(playerid, COLOR_YELLOW, string);
  16.                 }
  17.                 SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe [withdraw, deposit] [amount]");
  18.                 return 1;
  19.             }
  20.             GetPlayerName(playerid, sendername, sizeof(sendername));
  21.             if(strcmp(params, "withdraw"))
  22.             {
  23.                 new materialswithdraw = strval(tmp);
  24.                 if(sscanf(params, "i", materialswithdraw))
  25.                 {
  26.                     SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe withdraw [amount]");
  27.                     return 1;
  28.                 }
  29.                 if(PlayerToPoint(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
  30.                 {
  31.                     if(materialswithdraw <= DynamicFactions[x][fMats])
  32.                     {
  33.                         PlayerInfo[playerid][pMats] += materialswithdraw;
  34.                         DynamicFactions[x][fMats] = DynamicFactions[x][fMats] - materialswithdraw;
  35.                         format(string, sizeof(string), "{CCFF33}* %s has withdrew %d materials from %s Seif. Total Drugs: %d", sendername, materialswithdraw, DynamicFactions[x][fName], DynamicFactions[x][fMats]);
  36.                         SendFamilyMessage(x, -1, string);
  37.                         SaveDynamicFactions();
  38.                         return 1;
  39.                     } else return SendClientMessage(playerid, COLOR_GREY, "There isn't that much mats in storage.");
  40.                 } else return SendClientMessage(playerid, COLOR_GREY, "You are not at the faction storage facility.");
  41.             }
  42.             else if(strcmp(params, "deposit"))
  43.             {
  44.                 new materialsdeposit = strval(tmp);
  45.                 if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
  46.                 {
  47.                     format(string, sizeof(string), "Faction materials: "WHITE"%d", DynamicFactions[x][fMats]);
  48.                     SendClientMessage(playerid, COLOR_YELLOW, string);
  49.                 }
  50.                 if(sscanf(params, "i", materialsdeposit))
  51.                 {
  52.                     if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
  53.                     {
  54.                         format(string, sizeof(string), "Faction materials: "WHITE"%d", DynamicFactions[x][fMats]);
  55.                         SendClientMessage(playerid, COLOR_YELLOW, string);
  56.                     }
  57.                     SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe deposit [amount]");
  58.                     return 1;
  59.                 }
  60.                 if(PlayerToPoint(2.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
  61.                 {
  62.                     if(materialsdeposit <= PlayerInfo[playerid][pMats])
  63.                     {
  64.                         PlayerInfo[playerid][pMats] = PlayerInfo[playerid][pMats] - materialsdeposit;
  65.                         DynamicFactions[x][fMats] += materialsdeposit;
  66.                         format(string, sizeof(string), "{CCFF33}* %s has deposit %d materials in %s Seif. Total Drugs: %d", sendername, materialsdeposit, DynamicFactions[x][fName], DynamicFactions[x][fMats]);
  67.                         SendFamilyMessage(x, -1, string);
  68.                         SaveDynamicFactions();
  69.                         return 1;
  70.                     } else return SendClientMessage(playerid, COLOR_GREY, "You don't have that much mats on you.");
  71.                 } else return SendClientMessage(playerid, COLOR_GREY, "You are not at the faction storage facility.");
  72.             } else return SendClientMessage(playerid, -1, ""BLU"USAGE:"WHITE" /safe [withdraw, deposit] [amount]");
  73.         } else return SendClientMessage(playerid, COLOR_GREY, "You are not a gang member.");
  74.     }
  75.     return 1;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment