Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. function LoadStuffs() {
  2. if(cache_num_rows() > 0) {
  3. cache_get_field_content_int(0, "Tax", Tax);
  4. cache_get_field_content_int(0, "TaxValue", TaxValue);
  5. cache_get_field_content_int(0, "MaxPlayers", MaxPlayers);
  6. cache_get_field_content(0, "MaxPlayersDate", MaxPlayersDate, 32);
  7. cache_get_field_content(0, "StaffMotd", StaffMotd, 64);
  8. cache_get_field_content_int(0, "goal", ServerGoal);
  9.  
  10. cache_get_field_content_int(0, "GiftMoney", GiftMoney);
  11. cache_get_field_content_int(0, "GiftRP", GiftRP);
  12. cache_get_field_content_int(0, "GiftGold", GiftGold);
  13. cache_get_field_content_int(0, "GiftVehicle", GiftVehicle);
  14. new stocks[30];
  15. cache_get_field_content(0, "ServerStock", stocks);
  16. sscanf(stocks, "p<|>iiiii", ServerStock[0], ServerStock[1], ServerStock[2], ServerStock[3], ServerStock[4]);
  17. if(ServerGoal >= MAXGOAL) TerminatJobGoal = 1;
  18. gString[0] = EOS;
  19. format(gString, sizeof(gString), "{597F9C}(Stock: %d)\n{20F5F1}Vehicle Crate{FFFFFF}\nUse {20F5F1}/buycrate{FFFFFF} to buy crate\n{FFFFFF}Crate Price: {20F5F1}7000 RPoints {FFFFFF} / {20F5F1}700 Premium Points", ServerStock[1]);
  20. LabelCrates = CreateDynamic3DTextLabel(gString, 0xFFFFFFFF, 144.2511,-1945.6802,3.7734, 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  21. UpdateGift();
  22. printf("Stuff Loaded");
  23. }
  24. }
  25.  
  26. function UpdateGift() {
  27. if(SpecialWeek == 0) return 1;
  28. new string[500];
  29. format(string, sizeof(string), "DarkNight RPG Giftbox (/getgift)\nBani castigati: {FC6A6A}$%s{FFFFFF}\nRP-uri castigate: {FC6A6A}%s{FFFFFF}\nPuncte premium castigate: {FC6A6A}%s{FFFFFF}\nVehicule castigate: {FC6A6A}%s{FFFFFF}", FormatNumber(GiftMoney), FormatNumber(GiftRP), FormatNumber(GiftGold), FormatNumber(GiftVehicle));
  30. UpdateDynamic3DTextLabelText(GiftText, -1, string);
  31. new query[256];
  32. format(query, sizeof(query), "UPDATE `stuff` SET `GiftMoney`='%d', `GiftRP`='%d', `GiftGold`='%d', `GiftLevel`='%d', `GiftFP`='%d', `GiftVehicle`='%d'", GiftMoney, GiftRP, GiftGold, GiftLevel, GiftFP, GiftVehicle);
  33. mysql_tquery(SQL, query, "", "");
  34. return true;
  35. }
  36.  
  37.  
  38. public OnGameModeExit() {
  39. DestroyActor(SpawnActor);
  40. DestroyActor(ActorJail);
  41. DestroyActor(ActorJail2);
  42. DestroyActor(ActorJail3);
  43. DestroyActor(ActorJail4);
  44. DestroyActor(ActorJail5);
  45. DestroyActor(ActorGun);
  46. DestroyActor(ActorLicente);
  47. DestroyActor(ActorMagazin);
  48. DestroyActor(ActorSexShop);
  49. gQuery[0] = EOS;
  50. mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `stuff` SET `goal`='%d'", ServerGoal);
  51. mysql_tquery(SQL, gQuery, "", "");
  52. save_stock();
  53. return true;
  54. }
  55.  
  56. save_stock() {
  57. gQuery[0] = EOS;
  58. mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `stuff` SET `ServerStock`='%d|%d|%d|%d|%d' WHERE `ID`='1'", ServerStock[0], ServerStock[1], ServerStock[2], ServerStock[3], ServerStock[4]);
  59. mysql_tquery(SQL, gQuery, "", "");
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement