Guest User

dfhggfjhghjkhg

a guest
Sep 26th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.19 KB | None | 0 0
  1.                 if(strcmp(x_nr,"drugs",true) == 0)
  2.                 {
  3.                     drugsam = val;
  4.                     if(drugsam <= DynamicFactions[x][fDrugs])
  5.                     {
  6.                         if(drugsam >= 1 && drugsam <= 10)
  7.                         {
  8.                             new price;
  9.                             price = drugsam * 500;
  10.                             if(GetPlayerCash(playerid) >= price)
  11.                             {
  12.                                 //new price;
  13.                                 //price = drugsam * 500;
  14.                                 //if(PlayerInfo[playerid][pCash] < price) return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough money to extract grams of drugs.");
  15.                                 //PlayerInfo[playerid][pCash] -= price;
  16.                                 //GivePlayerMoney(playerid, -price);
  17.                                 GivePlayerCash(playerid, -price);
  18.                                 PlayerInfo[playerid][pDrugs] += drugsam;
  19.                                 DynamicFactions[x][fDrugs]=DynamicFactions[x][fDrugs]-drugsam;
  20.                                 format(string, sizeof(string), "You have withdrawn %d drugs from your group's safe at a price of $%d.", drugsam, price);
  21.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  22.                                 new str[256];
  23.                                 mysql_format(SQL,str,sizeof(str),"UPDATE `factions` SET `Drugs`='%d' WHERE `ID`='%d'",DynamicFactions[x][fDrugs],x);
  24.                                 mysql_tquery(SQL,str,"","");
  25.                                 mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Money`='%d',`Drugs`='%d' WHERE `name`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pNormalName]);
  26.                                 mysql_tquery(SQL,str,"","");
  27.                                 return 1;
  28.                             }
  29.                             else return SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to extract that amount of drugs.");
  30.                         }
  31.                         else return SendClientMessage(playerid, COLOR_WHITE, "You can extract only between (1-10) an amount of drugs!");
  32.                     }
  33.                     else return SendClientMessage(playerid, COLOR_WHITE, "There isn't that much drugs in your group safe.");
  34.                 }
Add Comment
Please, Sign In to add comment