Advertisement
Guest User

fillgas

a guest
Jul 19th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. CMD:fillgascan(playerid, params[]) {
  2. if(GetGasStationID(playerid) == -1) return SendClientMessage(playerid,COLOR_GREY,"* Nu esti la o benzinarie.");
  3. if(PlayerInfo[playerid][pFuel] != 0) return 1;
  4. if(PlayerInfo[playerid][pGasCan] == 0) return SCM(playerid, -1, "Nu ai o canistra.");
  5. new price = 20 * 50, string[64];
  6. format(string, sizeof(string), "* Ai incarcat canistra cu 20%%. Pret: $%s.",FormatNumber(price));
  7. SendClientMessage(playerid, COLOR_MONEY, string);
  8. PlayerInfo[playerid][pFuel] = 20;
  9. BizzInfo[GetGasStationID(playerid)][bBalance] += price;
  10. GivePlayerCash(playerid, - price);
  11. new str[178];
  12. format(str,sizeof(str),"UPDATE users SET `Money`='%d',`Fuel`='20' WHERE `ID`='%d'",GetPlayerCash(playerid),PlayerInfo[playerid][pSQLID]);
  13. mysql_query(SQL,str);
  14. format(str,sizeof(str),"UPDATE `bizz` SET `Till`='%d' WHERE `ID`='%d'",BizzInfo[GetGasStationID(playerid)][bBalance],GetGasStationID(playerid));
  15. mysql_query(SQL,str);
  16. return 1; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement