shopcore.pwn 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Shop Core
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. CreateHouseSaleSign(houseid)
  34. {
  35. if(!HouseInfo[houseid][hSign][0]) return 1;
  36. if(IsValidDynamicObject(HouseInfo[houseid][hSignObj])) DestroyDynamicObject(HouseInfo[houseid][hSignObj]);
  37. if(IsValidDynamic3DTextLabel(HouseInfo[houseid][hSignText])) DestroyDynamic3DTextLabel(HouseInfo[houseid][hSignText]);
  38. new string[64];
  39. HouseInfo[houseid][hSignObj] = CreateDynamicObject(19471, HouseInfo[houseid][hSign][0], HouseInfo[houseid][hSign][1], HouseInfo[houseid][hSign][2], 0, 0, HouseInfo[houseid][hSign][3], HouseInfo[houseid][hExtVW], HouseInfo[houseid][hExtIW]);
  40. format(string,sizeof(string),"ID: %d\nType /readsign to read the Owners Message.", houseid);
  41. HouseInfo[houseid][hSignText] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, HouseInfo[houseid][hSign][0], HouseInfo[houseid][hSign][1], HouseInfo[houseid][hSign][2] + 0.5, 10.0, .worldid = HouseInfo[houseid][hExtVW], .streamdistance = 25.0);
  42. return 1;
  43. }
  44. DeleteHouseSaleSign(houseid)
  45. {
  46. format(HouseInfo[houseid][hSignDesc], 64, "None");
  47. HouseInfo[houseid][hSign][0] = 0.0;
  48. HouseInfo[houseid][hSign][1] = 0.0;
  49. HouseInfo[houseid][hSign][2] = 0.0;
  50. HouseInfo[houseid][hSign][3] = 0.0;
  51. HouseInfo[houseid][hSignExpire] = 0;
  52. if(IsValidDynamicObject(HouseInfo[houseid][hSignObj])) DestroyDynamicObject(HouseInfo[houseid][hSignObj]);
  53. if(IsValidDynamic3DTextLabel(HouseInfo[houseid][hSignText])) DestroyDynamic3DTextLabel(HouseInfo[houseid][hSignText]);
  54. SaveHouse(houseid);
  55. return 1;
  56. }
  57. forward FuelCan(playerid, vehicleid, amount);
  58. public FuelCan(playerid, vehicleid, amount)
  59. {
  60. new string[128];
  61. if(GetPVarInt(playerid, "fuelcan") == 1)
  62. {
  63. PlayerInfo[playerid][mInventory][7]--;
  64. format(string, sizeof(string), "[FUELCAN] %s(%d) used a fuel can. Left: %d", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), PlayerInfo[playerid][mInventory][7]);
  65. Log("logs/micro.log", string);
  66. }
  67. if(GetPVarInt(playerid, "fuelcan") == 2)
  68. {
  69. format(string, sizeof(string), "[ZFUELCAN] %s(%d) used a fuel can with %d%% fuel.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), PlayerInfo[playerid][zFuelCan]);
  70. Log("logs/micro.log", string);
  71. PlayerInfo[playerid][zFuelCan] = 0;
  72. }
  73. VehicleFuel[vehicleid] += float(amount);
  74. if(VehicleFuel[vehicleid] > 100) VehicleFuel[vehicleid] = 100.0;
  75. format(string, sizeof(string), "%s has used a fuel can to refill their vehicle.", GetPlayerNameEx(playerid));
  76. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  77. SendClientMessageEx(playerid, COLOR_WHITE, "You have used a fuel can to refill your vehicle.");
  78. PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
  79. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
  80. DeletePVar(playerid, "fuelcan");
  81. return 1;
  82. }
  83. forward JumpStart(playerid, vehicleid);
  84. public JumpStart(playerid, vehicleid)
  85. {
  86. PlayerInfo[playerid][mInventory][8]--;
  87. RepairVehicle(vehicleid);
  88. Vehicle_Armor(vehicleid);
  89. if(IsTrailerAttachedToVehicle(vehicleid))
  90. {
  91. RepairVehicle(GetVehicleTrailer(vehicleid));
  92. Vehicle_Armor(GetVehicleTrailer(vehicleid));
  93. }
  94. new engine,lights,alarm,doors,bonnet,boot,objective;
  95. GetVehicleParamsEx(vehicleid, engine,lights,alarm,doors,bonnet,boot,objective);
  96. SetVehicleParamsEx(vehicleid, engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
  97. new string[128];
  98. format(string, sizeof(string), "%s has jump started their vehicle.", GetPlayerNameEx(playerid));
  99. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  100. SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been Jump Started!");
  101. PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
  102. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
  103. format(string, sizeof(string), "[JUMPSTART] %s(%d) used a jump start. Left: %d", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), PlayerInfo[playerid][mInventory][8]);
  104. Log("logs/micro.log", string);
  105. DeletePVar(playerid, "jumpstarting");
  106. return 1;
  107. }
  108. forward EatBar(playerid);
  109. public EatBar(playerid)
  110. {
  111. PlayerInfo[playerid][mInventory][4]--;
  112. PlayerInfo[playerid][mCooldown][4] = 60;
  113. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
  114. SendClientMessageEx(playerid, -1, "You have consumed a energy bar, effects will last for 1 hour.");
  115. SendClientMessageEx(playerid, -1, "Your health will decrease slower when in a injured state.");
  116. new string[128];
  117. format(string, sizeof(string), "[ENERGYBAR] %s(%d) used a energy bar. Left: %d", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), PlayerInfo[playerid][mInventory][4]);
  118. Log("logs/micro.log", string);
  119. DeletePVar(playerid, "eatingbar");
  120. return 1;
  121. }
  122. stock HireCost(carid)
  123. {
  124. switch (carid)
  125. {
  126. case 69:
  127. {
  128. return 90000; //bullit
  129. }
  130. case 70:
  131. {
  132. return 130000; //infurnus
  133. }
  134. case 71:
  135. {
  136. return 100000; //turismo
  137. }
  138. case 72:
  139. {
  140. return 80000;
  141. }
  142. case 73:
  143. {
  144. return 70000;
  145. }
  146. case 74:
  147. {
  148. return 60000;
  149. }
  150. }
  151. return 0;
  152. }
  153. forward TeleportToShop(playerid);
  154. public TeleportToShop(playerid)
  155. {
  156. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen") || PlayerInfo[playerid][pHospital] || PlayerInfo[playerid][pJailTime] > 0 || GetPVarInt(playerid, "EventToken") == 1 || GetPVarInt(playerid, "IsInArena") || !GetPVarInt(playerid, "ShopTP"))
  157. return DeletePVar(playerid, "ShopTP"), SendClientMessage(playerid, COLOR_GRAD2, "SERVER: Shop Teleportation has been cancelled.");
  158. if(gettime() - LastShot[playerid] < 30) {
  159. TogglePlayerControllable(playerid, 1);
  160. DeletePVar(playerid, "ShopTP");
  161. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have been injured within the last 30 seconds, you will not be teleported to the shop.");
  162. }
  163. if(GetPVarInt(playerid, "ShopTP") == 1)
  164. {
  165. SetPlayerPos(playerid, 2957.9670, -1459.4045, 10.8092);
  166. SetPlayerInterior(playerid, 0);
  167. SetPlayerVirtualWorld(playerid, 1);
  168. TogglePlayerControllable(playerid, 1);
  169. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "If you wish to leave the shop, type /leaveshop to return to your previous location.");
  170. SendClientMessageEx(playerid, COLOR_ORANGE, "Note{ffffff}: You will {ff0000}not{ffffff} be able to return to your previous location upon purchasing a vehicle.");
  171. }
  172. return 1;
  173. }
  174. CMD:shopplate(playerid, params[])
  175. {
  176. if(PlayerInfo[playerid][pShopTech] >= 1 || PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  177. {
  178. new iVehType, iVehIndex, iTargetOwner, carid, orderid, plate[32];
  179. if(sscanf(params, "dds[32]", carid, orderid, plate))
  180. {
  181. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopplate [carid] [orderid] [plate/remove]");
  182. SendClientMessageEx(playerid, COLOR_GREY, "COLORS: (black/white/blue/red/green/purple/yellow/lightblue/navy/beige/darkgreen/darkblue/darkgrey/gold/brown/darkbrown/darkred");
  183. SendClientMessageEx(playerid, COLOR_GREY, "/pink) USAGE: (red)Hi(white)how are you? NOTE: Each color counts for 8 characters");
  184. return 1;
  185. }
  186. foreach(new i: Player)
  187. {
  188. iVehIndex = GetPlayerVehicle(i, carid);
  189. if(iVehIndex != -1)
  190. {
  191. iVehType = 1;
  192. iTargetOwner = i;
  193. break;
  194. }
  195. }
  196. if(iVehType == 1)
  197. {
  198. format(plate, sizeof(plate), "%s", str_replace("(black)", "{000000}", plate));
  199. format(plate, sizeof(plate), "%s", str_replace("(white)", "{FFFFFF}", plate));
  200. format(plate, sizeof(plate), "%s", str_replace("(blue)", "{0000FF}", plate));
  201. format(plate, sizeof(plate), "%s", str_replace("(red)", "{FF0000}", plate));
  202. format(plate, sizeof(plate), "%s", str_replace("(green)", "{008000}", plate));
  203. format(plate, sizeof(plate), "%s", str_replace("(purple)", "{800080}", plate));
  204. format(plate, sizeof(plate), "%s", str_replace("(yellow)", "{FFFF00}", plate));
  205. format(plate, sizeof(plate), "%s", str_replace("(lightblue)", "{ADD8E6}", plate));
  206. format(plate, sizeof(plate), "%s", str_replace("(navy)", "{000080}", plate));
  207. format(plate, sizeof(plate), "%s", str_replace("(beige)", "{F5F5DC}", plate));
  208. format(plate, sizeof(plate), "%s", str_replace("(darkgreen)", "{006400}", plate));
  209. format(plate, sizeof(plate), "%s", str_replace("(darkblue)", "{00008B}", plate));
  210. format(plate, sizeof(plate), "%s", str_replace("(darkgrey)", "{A9A9A9}", plate));
  211. format(plate, sizeof(plate), "%s", str_replace("(gold)", "{FFD700}", plate));
  212. format(plate, sizeof(plate), "%s", str_replace("(brown)", "{A52A2A}", plate));
  213. format(plate, sizeof(plate), "%s", str_replace("(darkbrown)", "{5C4033}", plate));
  214. format(plate, sizeof(plate), "%s", str_replace("(darkred)", "{8B0000}", plate));
  215. format(plate, sizeof(plate), "%s", str_replace("(pink)", "{FF5B77}", plate));
  216. new string[128], Float:X, Float:Y, Float:Z;
  217. GetVehiclePos(carid, X, Y, Z);
  218. if(strcmp(plate, "remove", true) == 0)
  219. {
  220. PlayerVehicleInfo[iTargetOwner][iVehIndex][pvPlate] = 0;
  221. }
  222. else
  223. {
  224. format(PlayerVehicleInfo[iTargetOwner][iVehIndex][pvPlate], 32, "%s", plate);
  225. }
  226. SetVehicleToRespawn(carid);
  227. SetVehiclePos(carid, X, Y, Z);
  228. g_mysql_SaveVehicle(iTargetOwner, iVehIndex);
  229. format(string, sizeof(string), "Plate set on %s (ID: %d) %s (ID: %d)", GetPlayerNameEx(iTargetOwner), iTargetOwner, GetVehicleName(carid), carid);
  230. SendClientMessage(playerid, COLOR_WHITE, string);
  231. format(string, sizeof(string), "(OrderID: %d) Plate: %s", orderid, plate);
  232. SendClientMessage(playerid, COLOR_WHITE, string);
  233. format(string, sizeof(string), "%s set %s(%d) %s (Slot %d) plate to %s (order %d)", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetOwner), GetPlayerSQLId(iTargetOwner), GetVehicleName(carid), iVehIndex, plate, orderid);
  234. Log("logs/shoplog.log", string);
  235. }
  236. else
  237. {
  238. SendClientMessageEx(playerid, COLOR_GRAD1, "This is not a person owned vehicle, you cannot give it a custom plate.");
  239. }
  240. }
  241. else
  242. {
  243. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  244. }
  245. return 1;
  246. }
  247. CMD:shopcredits(playerid, params[])
  248. {
  249. if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pShopTech] >= 2)
  250. {
  251. new szMessage[128], player, amount, invid;
  252. if(sscanf(params, "udd", player, amount, invid))
  253. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givecredits [player] [amount] [invoiceid]");
  254. if(!IsPlayerConnected(player))
  255. return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  256. if(!(1 < amount < 2401)) return SendClientMessageEx(playerid, COLOR_GREY, "You can only go low as 1 and maximum is 2400 credits!");
  257. if(PlayerInfo[player][pAdmin] > 2) return SendClientMessageEx(playerid, COLOR_GREY, "You can only issue Credits onto roleplay accounts only!");
  258. if(amount > 999)
  259. {
  260. format(szMessage, sizeof(szMessage), "{AA3333}AdmWarning{FFFF00}: %s issued %s %s credits. (Invoice ID: %d)", GetPlayerNameEx(playerid), GetPlayerNameEx(player), invid);
  261. ABroadCast(COLOR_YELLOW, szMessage, 2);
  262. }
  263. PlayerInfo[player][pCredits] += amount;
  264. mysql_format(MainPipeline, szMessage, sizeof(szMessage), "UPDATE `accounts` SET `Credits` = %d WHERE `id` = %d", PlayerInfo[player][pCredits], GetPlayerSQLId(player));
  265. mysql_tquery(MainPipeline, szMessage, "OnQueryFinish", "ii", SENDDATA_THREAD, player);
  266. print(szMessage);
  267. SendClientMessageEx(player, COLOR_LIGHTBLUE, "* %s has given you %s credits (New total: %s)", GetPlayerNameEx(playerid), number_format(amount), number_format(PlayerInfo[player][pCredits]));
  268. format(szMessage, sizeof(szMessage), "%s has given %s %s credits. [TC: %s] (Invoice ID: %d)", GetPlayerNameEx(playerid), GetPlayerNameEx(player), number_format(amount), number_format(PlayerInfo[player][pCredits]), invid);
  269. Log("logs/shoplog.log", szMessage), print(szMessage);
  270. SendClientMessageEx(playerid, COLOR_CYAN, "You have given %s %s credits. (Invoice ID: %d)", GetPlayerNameEx(player), number_format(amount), invid);
  271. }
  272. else SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  273. return 1;
  274. }
  275. CMD:shopcar(playerid, params[]) {
  276. if(PlayerInfo[playerid][pShopTech] >= 1) {
  277. new
  278. szInvoice[32],
  279. iColors[2],
  280. iTargetID,
  281. iModelID;
  282. if(sscanf(params, "uiiis[32]", iTargetID, iModelID, iColors[0], iColors[1], szInvoice)) {
  283. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopcar [player] [model] [color 1] [color 2] [invoice #]");
  284. }
  285. else if(!(400 <= iModelID <= 611)) {
  286. SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
  287. }
  288. else if(IsATrain(iModelID)) {
  289. SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime.");
  290. }
  291. else if(IsRestrictedVehicle(iModelID)) {
  292. SendClientMessageEx(playerid, COLOR_GREY, "You cannot issue restricted vehicles!");
  293. }
  294. else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
  295. SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255).");
  296. }
  297. else if(!vehicleCountCheck(iTargetID)) {
  298. SendClientMessageEx(playerid, COLOR_GREY, "That person can't have more vehicles - they own too many.");
  299. }
  300. else if(!vehicleSpawnCountCheck(iTargetID)) {
  301. SendClientMessageEx(playerid, COLOR_GREY, "That person has too many vehicles spawned - they must store one first.");
  302. }
  303. else {
  304. new
  305. Float: arr_fPlayerPos[4],
  306. szMessage[84];
  307. GetPlayerPos(iTargetID, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  308. GetPlayerFacingAngle(iTargetID, arr_fPlayerPos[3]);
  309. CreatePlayerVehicle(iTargetID, GetPlayerFreeVehicleId(iTargetID), iModelID, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2], arr_fPlayerPos[3], iColors[0], iColors[1], 2000000, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
  310. format(szMessage, sizeof(szMessage), "You have successfully created a %s for %s (invoice %s).", VehicleName[iModelID - 400], GetPlayerNameEx(iTargetID), szInvoice);
  311. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  312. format(szMessage, sizeof(szMessage), "%s created a %s (%i) for %s(%d) (invoice %s).", GetPlayerNameEx(playerid), VehicleName[iModelID - 400], iModelID, GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID), szInvoice);
  313. Log("logs/shoplog.log", szMessage);
  314. }
  315. }
  316. else SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  317. return 1;
  318. }
  319. CMD:shopcardel(playerid, params[])
  320. {
  321. if(PlayerInfo[playerid][pShopTech] >= 1)
  322. {
  323. new string[128], invoicenum[32], giveplayerid, vehicleid;
  324. if(sscanf(params, "uds[32]", giveplayerid, vehicleid, invoicenum)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopcardel [player] [vehicleid] [invoice #]");
  325. new playervehicleid = GetPlayerVehicle(giveplayerid, vehicleid);
  326. if(playervehicleid == -1) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That person doesn't own that vehicle.");
  327. format(string, sizeof(string), "You have deleted %s's %s (vehicle ID %d).", GetPlayerNameEx(giveplayerid), GetVehicleName(vehicleid), vehicleid);
  328. SendClientMessageEx(playerid, COLOR_WHITE, string);
  329. format(string, sizeof(string), "An Administrator has deleted your %s.", GetVehicleName(vehicleid));
  330. SendClientMessageEx(giveplayerid, COLOR_GREY, string);
  331. format(string, sizeof(string), "[SHOPCARDEL] %s deleted vehicle ID %d - Invoice %s for %s(%d)", GetPlayerNameEx(playerid), playervehicleid, invoicenum, GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  332. Log("logs/shoplog.log", string);
  333. DestroyPlayerVehicle(giveplayerid, playervehicleid);
  334. }
  335. else SendClientMessageEx(playerid, COLOR_GREY, "You are not allowed to use this command.");
  336. return 1;
  337. }
  338. CMD:setstpay(playerid, params[])
  339. {
  340. if(PlayerInfo[playerid][pAdmin] == 99999)
  341. {
  342. new string[128];
  343. if(sscanf(params, "f", ShopTechPay))
  344. {
  345. SendClientMessageEx(playerid, COLOR_GREY, "Usage: /setstpay [value]");
  346. format(string, sizeof(string), "Current Pay: $%.2f", ShopTechPay);
  347. SendClientMessageEx(playerid, COLOR_WHITE, string);
  348. return 1;
  349. }
  350. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `misc` SET `ShopTechPay` = '%.2f'", ShopTechPay);
  351. mysql_tquery(MainPipeline, string, "OnQueryFinish", "i", SENDDATA_THREAD);
  352. format(string, sizeof(string), "Shop Tech Pay set to $%.2f", ShopTechPay);
  353. SendClientMessageEx(playerid, COLOR_WHITE, string);
  354. }
  355. return 1;
  356. }
  357. CMD:resetstpay(playerid, params[])
  358. {
  359. if(PlayerInfo[playerid][pAdmin] == 99999)
  360. {
  361. if(GetPVarInt(playerid, "resetstpay"))
  362. {
  363. mysql_tquery(MainPipeline, "UPDATE `shoptech` SET `total` = 0, dtotal = 0", "OnQueryFinish", "i", SENDDATA_THREAD);
  364. SendClientMessage(playerid, COLOR_WHITE, "Shop Tech Payments Reset");
  365. DeletePVar(playerid, "resetstpay");
  366. }
  367. else
  368. {
  369. SendClientMessage(playerid, COLOR_WHITE, "WARNING: This command will reset the shop tech payment counters");
  370. SendClientMessage(playerid, COLOR_WHITE, "This action cannot be undone, ARE YOU SURE YOU WISH TO CONTINUE?");
  371. SendClientMessage(playerid, COLOR_WHITE, "Type this command again to proceed");
  372. SetPVarInt(playerid, "resetstpay", 1);
  373. }
  374. }
  375. return 1;
  376. }
  377. CMD:changeuserpin(playerid, params[])
  378. {
  379. if(PlayerInfo[playerid][pAdmin] < 1337 && PlayerInfo[playerid][pShopTech] < 2)
  380. {
  381. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  382. return 1;
  383. }
  384. new string[128], accountName[20], password[64], query[512];
  385. if(sscanf(params, "s[20]s[64]", accountName, password))
  386. return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /changeuserpin [player name] [new pin]");
  387. if(strlen(password) > 4 || !IsNumeric(password))
  388. return SendClientMessageEx(playerid, COLOR_GREY, "The pin must be numbers, and must have 4 digits.");
  389. new passbuffer[129];
  390. WP_Hash(passbuffer, sizeof(passbuffer), password);
  391. format(string, sizeof(string), "Attempting to change %s's pin...", accountName);
  392. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  393. format(string, sizeof(string), "AdmCmd: %s's pin was changed by %s.", accountName, GetPlayerNameEx(playerid));
  394. Log("logs/pin.log", string);
  395. SetPVarInt(playerid, "ChangePin", 1);
  396. new tmpName[24];
  397. mysql_escape_string(accountName, tmpName);
  398. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `Pin`='%s' WHERE `Username`='%s' AND `AdminLevel` < 2", passbuffer, tmpName);
  399. mysql_tquery(MainPipeline, query, "OnChangeUserPassword", "i", playerid);
  400. SetPVarString(playerid, "OnChangeUserPassword", tmpName);
  401. return 1;
  402. }
  403. CMD:changeuserpassword(playerid, params[])
  404. {
  405. if(PlayerInfo[playerid][pAdmin] < 1337)
  406. {
  407. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  408. return 1;
  409. }
  410. new string[128], accountName[20], password[64], query[512];
  411. if(sscanf(params, "s[20]s[64]", accountName, password)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /changeuserpassword [player name] [new password]");
  412. new passbuffer[129], salt[11];
  413. randomString(salt);
  414. format(string, sizeof(string), "%s%s", password, salt);
  415. WP_Hash(passbuffer, sizeof(passbuffer), string);
  416. format(string, sizeof(string), "Attempting to change %s's password...", accountName);
  417. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  418. format(string, sizeof(string), "AdmCmd: %s's password was changed by %s.", accountName, GetPlayerNameEx(playerid));
  419. Log("logs/password.log", string);
  420. new tmpName[24];
  421. mysql_escape_string(accountName, tmpName);
  422. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `Key`='%s', `Salt`='%s' WHERE `Username`='%s' AND `AdminLevel` < 2", passbuffer, salt, tmpName);
  423. mysql_tquery(MainPipeline, query, "OnChangeUserPassword", "i", playerid);
  424. SetPVarString(playerid, "OnChangeUserPassword", tmpName);
  425. return 1;
  426. }
  427. CMD:orders(playerid, params[])
  428. {
  429. if(PlayerInfo[playerid][pShopTech] > 0 || PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  430. {
  431. new string[128];
  432. SendClientMessageEx(playerid, COLOR_GREEN, "____________________ SHOP ORDERS _____________________");
  433. foreach(new i: Player)
  434. {
  435. if(PlayerInfo[i][pOrder] > 0 && OrderAssignedTo[i] == INVALID_PLAYER_ID)
  436. {
  437. new playerip[32];
  438. GetPlayerIp(i, playerip, sizeof(playerip));
  439. new orderid = PlayerInfo[i][pOrder];
  440. if(PlayerInfo[i][pOrderConfirmed]) {
  441. format(string, sizeof(string), "%s(%d) | Order ID: %d (Confirmed) | IP: %s | Assigned to: Nobody", GetPlayerNameEx(i), i, orderid, playerip);
  442. } else {
  443. format(string, sizeof(string), "%s(%d) | Order ID: %d (Invalid) | IP: %s | Assigned to: Nobody", GetPlayerNameEx(i), i, orderid, playerip);
  444. }
  445. SendClientMessageEx(playerid, COLOR_SHOP, string);
  446. }
  447. else if(PlayerInfo[i][pOrder] > 0 && OrderAssignedTo[i] != INVALID_PLAYER_ID)
  448. {
  449. new playerip[32];
  450. GetPlayerIp(i, playerip, sizeof(playerip));
  451. new orderid = PlayerInfo[i][pOrder];
  452. if(PlayerInfo[i][pOrderConfirmed]) {
  453. format(string, sizeof(string), "%s(%d) | Order ID: %d (Confirmed) | IP: %s | Assigned to: %s", GetPlayerNameEx(i), i, orderid, playerip, GetPlayerNameEx(OrderAssignedTo[i]));
  454. } else {
  455. format(string, sizeof(string), "%s(%d) | Order ID: %d (Invalid) | IP: %s | Assigned to: %s", GetPlayerNameEx(i), i, orderid, playerip, GetPlayerNameEx(OrderAssignedTo[i]));
  456. }
  457. SendClientMessageEx(playerid, COLOR_SHOP, string);
  458. }
  459. }
  460. SendClientMessageEx(playerid, COLOR_WHITE, "Use /givemeorder /processorder /denyorder");
  461. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________________");
  462. }
  463. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  464. return 1;
  465. }
  466. CMD:givemeorder(playerid, params[])
  467. {
  468. if(PlayerInfo[playerid][pShopTech] > 0 || PlayerInfo[playerid][pAdmin] >= 1337)
  469. {
  470. new giveplayerid;
  471. if(sscanf(params, "u", giveplayerid))
  472. {
  473. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givemeorder [player]");
  474. return 1;
  475. }
  476. if(IsPlayerConnected(giveplayerid))
  477. {
  478. if(PlayerInfo[giveplayerid][pOrder] > 0)
  479. {
  480. if(IsPlayerConnected(OrderAssignedTo[giveplayerid]))
  481. {
  482. if(GetPVarInt(playerid, "OrderAssignedTo") == giveplayerid)
  483. {
  484. DeletePVar(playerid, "OrderAssignedTo");
  485. }
  486. else
  487. {
  488. SendClientMessageEx(playerid, COLOR_WHITE, "That order ID has already been assigned to another admin!");
  489. SendClientMessageEx(playerid, COLOR_WHITE, "If you are sure you wish to take the order anyway, type this command again.");
  490. SetPVarInt(playerid, "OrderAssignedTo", giveplayerid);
  491. return 1;
  492. }
  493. }
  494. new string[128];
  495. new orderid = PlayerInfo[giveplayerid][pOrder];
  496. format(string, sizeof(string), "AdmCmd: %s assigned himself to shop order ID %d from %s (ID: %d).", GetPlayerNameEx(playerid), orderid, GetPlayerNameEx(giveplayerid), giveplayerid);
  497. ShopTechBroadCast(COLOR_ORANGE, string);
  498. format(string, sizeof(string), "%s is now reviewing your shop order ID %d.", GetPlayerNameEx(playerid), orderid);
  499. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  500. OrderAssignedTo[giveplayerid] = playerid;
  501. }
  502. else SendClientMessageEx(playerid, COLOR_GREY, "That person does not have any shop orders pending!");
  503. }
  504. else SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  505. }
  506. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  507. return 1;
  508. }
  509. /*CMD:adjustoid(playerid, params[])
  510. {
  511. if(PlayerInfo[playerid][pShopTech] > 0 || PlayerInfo[playerid][pAdmin] >= 1337)
  512. {
  513. new giveplayerid, orderid, string[128];
  514. if(sscanf(params, "ui", giveplayerid, orderid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /adjustoid [player] [new orderid]");
  515. SendClientMessageEx(playerid, COLOR_WHITE, "Processing..");
  516. PlayerInfo[giveplayerid][pOrder] = orderid;
  517. format(string, sizeof(string), "shop.ng-gaming.net/idcheck.php?id=%d", orderid);
  518. HTTP(giveplayerid, HTTP_GET, string, "", "HttpCallback_ShopIDCheck");
  519. format(string, sizeof(string), "%s has edited %s's Order ID to %d", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), orderid);
  520. Log("logs/shoporders.log", string);
  521. }
  522. return 1;
  523. }*/
  524. CMD:processorder(playerid, params[])
  525. {
  526. if(PlayerInfo[playerid][pShopTech] > 0 || PlayerInfo[playerid][pAdmin] >= 1337)
  527. {
  528. new giveplayerid;
  529. if(sscanf(params, "u", giveplayerid))
  530. {
  531. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /processorder [player]");
  532. return 1;
  533. }
  534. if(IsPlayerConnected(giveplayerid))
  535. {
  536. if(OrderAssignedTo[giveplayerid] != playerid)
  537. {
  538. SendClientMessageEx(playerid, COLOR_WHITE, "You must be assigned to that order ID to process it, use /givemeorder");
  539. return 1;
  540. }
  541. if(PlayerInfo[giveplayerid][pOrder] > 0)
  542. {
  543. new string[128];
  544. new orderid = PlayerInfo[giveplayerid][pOrder];
  545. format(string, sizeof(string), "AdmCmd: %s has processed shop order ID %d from %s (ID: %d).", GetPlayerNameEx(playerid), orderid, GetPlayerNameEx(giveplayerid), giveplayerid);
  546. ShopTechBroadCast(COLOR_ORANGE, string);
  547. format(string, sizeof(string), "%s has processed your shop order ID %d.", GetPlayerNameEx(playerid), orderid);
  548. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  549. new playerip[32], giveplayerip[32];
  550. GetPlayerIp(playerid, playerip, sizeof(playerip));
  551. GetPlayerIp(giveplayerid, giveplayerip, sizeof(giveplayerip));
  552. if(PlayerInfo[giveplayerid][pOrderConfirmed])
  553. {
  554. mysql_format(MainPipeline, string, sizeof(string), "SELECT `id` FROM `orders` WHERE `id` = '%d'", PlayerInfo[giveplayerid][pOrder]);
  555. mysql_tquery(MainPipeline, string, "OnProcessOrderCheck", "ii", playerid, giveplayerid);
  556. SetPVarInt(playerid, "processorder", orderid);
  557. }
  558. else
  559. {
  560. format(string, sizeof(string), "%s(IP: %s) has processed shop order ID %d from %s(%d) (IP: %s).", GetPlayerNameEx(playerid), playerip, orderid, GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), giveplayerip);
  561. Log("logs/shoporders.log", string);
  562. }
  563. PlayerInfo[giveplayerid][pOrder] = 0;
  564. PlayerInfo[giveplayerid][pOrderConfirmed] = 0;
  565. OrderAssignedTo[giveplayerid] = INVALID_PLAYER_ID;
  566. }
  567. else SendClientMessageEx(playerid, COLOR_GREY, "That person does not have any shop orders pending!");
  568. }
  569. else SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  570. }
  571. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  572. return 1;
  573. }
  574. CMD:denyorder(playerid, params[])
  575. {
  576. if(PlayerInfo[playerid][pShopTech] > 0 || PlayerInfo[playerid][pAdmin] >= 1337)
  577. {
  578. new giveplayerid, reason[64];
  579. if(sscanf(params, "us[64]", giveplayerid, reason))
  580. {
  581. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /denyorder [player] [reason]");
  582. return 1;
  583. }
  584. if(IsPlayerConnected(giveplayerid))
  585. {
  586. if(OrderAssignedTo[giveplayerid] != playerid)
  587. {
  588. SendClientMessageEx(playerid, COLOR_WHITE, "You must be assigned to that order ID to deny it, use /givemeorder");
  589. return 1;
  590. }
  591. if(PlayerInfo[giveplayerid][pOrder] > 0)
  592. {
  593. new string[128];
  594. new orderid = PlayerInfo[giveplayerid][pOrder];
  595. format(string, sizeof(string), "AdmCmd: %s has denied shop order ID %d from %s (ID: %d), reason: %s", GetPlayerNameEx(playerid), orderid, GetPlayerNameEx(giveplayerid), giveplayerid, reason);
  596. ShopTechBroadCast(COLOR_ORANGE, string);
  597. format(string, sizeof(string), "%s has denied your shop order ID %d, reason: %s", GetPlayerNameEx(playerid), orderid, reason);
  598. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  599. new playerip[32], giveplayerip[32];
  600. GetPlayerIp(playerid, playerip, sizeof(playerip));
  601. GetPlayerIp(giveplayerid, giveplayerip, sizeof(giveplayerip));
  602. format(string, sizeof(string), "%s(IP: %s) has denied shop order ID %d from %s(%d) (IP: %s), reason: %s", GetPlayerNameEx(playerid), playerip, orderid, GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), giveplayerip, reason);
  603. Log("logs/shoporders.log", string);
  604. PlayerInfo[giveplayerid][pOrder] = 0;
  605. OrderAssignedTo[giveplayerid] = INVALID_PLAYER_ID;
  606. }
  607. else SendClientMessageEx(playerid, COLOR_GREY, "That person does not have any shop orders pending!");
  608. }
  609. else SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  610. }
  611. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  612. return 1;
  613. }
  614. CMD:shoporder(playerid, params[])
  615. {
  616. if(PlayerInfo[playerid][pOrder] != 0)
  617. {
  618. new string[128];
  619. new orderid = PlayerInfo[playerid][pOrder];
  620. format(string, sizeof(string), "You already have shop order ID %d pending, if you wish to cancel that type /cancelorder", orderid);
  621. SendClientMessageEx(playerid, COLOR_WHITE, string);
  622. return 1;
  623. }
  624. if (GetPVarInt(playerid, "ShopOrderTimer") > 0)
  625. {
  626. new string[128];
  627. format(string, sizeof(string), "You must wait %d seconds before submitting another shop order.", GetPVarInt(playerid, "ShopOrderTimer"));
  628. SendClientMessageEx(playerid,COLOR_GREY, string);
  629. return 1;
  630. }
  631. ShowPlayerDialogEx(playerid, DIALOG_SHOPORDER, DIALOG_STYLE_INPUT, "Shop Order", "This is for shop orders from http://shop.ng-gaming.net\n\nIf you do not have a shop order then please cancel this dialog box now.\n\nWarning: Abuse of this feature may result to an indefinite block from this command.\n\nPlease enter your shop order ID (if you do not know it put 1):", "Submit", "Cancel" );
  632. return 1;
  633. }
  634. CMD:cancelorder(playerid, params[])
  635. {
  636. if(PlayerInfo[playerid][pOrder] != 0)
  637. {
  638. new string[128];
  639. new orderid = PlayerInfo[playerid][pOrder];
  640. new playerip[32];
  641. GetPlayerIp(playerid, playerip, sizeof(playerip));
  642. format(string, sizeof(string), "%s(%d) (IP: %s) canceled their shop order (ID %i).", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), playerip, orderid);
  643. Log("logs/shoporders.log", string);
  644. format(string, sizeof(string), "You have canceled your shop order (ID %i). If you wish to submit another order, type /shoporder.", orderid);
  645. SendClientMessageEx(playerid, COLOR_WHITE, string);
  646. PlayerInfo[playerid][pOrder] = 0;
  647. OrderAssignedTo[playerid] = INVALID_PLAYER_ID;
  648. }
  649. else
  650. {
  651. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any shop orders pending!");
  652. }
  653. return 1;
  654. }
  655. CMD:useexp(playerid, params[])
  656. {
  657. new string[128];
  658. if (PlayerInfo[playerid][pEXPToken] < 1)
  659. {
  660. SendClientMessageEx(playerid, COLOR_GREY, " You do not have any Double EXP tokens!");
  661. return 1;
  662. }
  663. PlayerInfo[playerid][pDoubleEXP] += 8;
  664. PlayerInfo[playerid][pEXPToken]--;
  665. format(string, sizeof(string), "You have used a Double EXP Token! You now have a total of %d of Double EXP hours!", PlayerInfo[playerid][pDoubleEXP]);
  666. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  667. return 1;
  668. }
  669. CMD:shopexp(playerid, params[])
  670. {
  671. if (PlayerInfo[playerid][pShopTech] < 1)
  672. {
  673. SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  674. return 1;
  675. }
  676. new string[128], giveplayerid, amount, invoice[32];
  677. if(sscanf(params, "uds[32]", giveplayerid, amount, invoice)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopexp [player] [tokens] [invoice #]");
  678. PlayerInfo[giveplayerid][pEXPToken] += amount;
  679. format(string, sizeof(string), "You have received %d Double EXP Token(s) from Shop Tech %s.", amount, GetPlayerNameEx(playerid));
  680. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  681. format(string, sizeof(string), "[SHOPEXP] %s given %s(%d), %d Double EXP Token(s) - Invoice %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount, invoice);
  682. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  683. Log("logs/shoplog.log", string);
  684. return 1;
  685. }
  686. CMD:shoptokens(playerid, params[])
  687. {
  688. if (PlayerInfo[playerid][pShopTech] < 1)
  689. {
  690. SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  691. return 1;
  692. }
  693. new string[128], giveplayerid, amount, invoice[32];
  694. if(sscanf(params, "uds[32]", giveplayerid, amount, invoice)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shoptokens [player] [amount] [invoice #]");
  695. PlayerInfo[giveplayerid][pPaintTokens] += amount;
  696. format(string, sizeof(string), "You have received %d Paintball Tokens from Shop Tech %s.", amount, GetPlayerNameEx(playerid));
  697. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  698. format(string, sizeof(string), "[SHOPTOKENS] %s given %s(%d), %d Paintball Tokens - Invoice %s for %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount, invoice, GetPlayerNameEx(giveplayerid));
  699. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  700. Log("logs/shoplog.log", string);
  701. return 1;
  702. }
  703. CMD:shopviptokens(playerid, params[])
  704. {
  705. if (PlayerInfo[playerid][pShopTech] < 1)
  706. {
  707. SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  708. return 1;
  709. }
  710. new string[128], giveplayerid, amount, invoice[32];
  711. if(sscanf(params, "uds[32]", giveplayerid, amount, invoice)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopviptokens [player] [amount] [invoice #]");
  712. PlayerInfo[giveplayerid][pTokens] += amount;
  713. format(string, sizeof(string), "You have received %d VIP Tokens from Shop Tech %s.", amount, GetPlayerNameEx(playerid));
  714. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  715. format(string, sizeof(string), "[SHOPTOKENS] %s given %s(%d), %d VIP Tokens - Invoice %s for %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount, invoice, GetPlayerNameEx(giveplayerid));
  716. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  717. Log("logs/shoplog.log", string);
  718. return 1;
  719. }
  720. CMD:shopfirework(playerid, params[])
  721. {
  722. if (PlayerInfo[playerid][pShopTech] < 1)
  723. {
  724. SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  725. return 1;
  726. }
  727. new string[128], giveplayerid, amount, invoice[32];
  728. if(sscanf(params, "uds[32]", giveplayerid, amount, invoice)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopfirework [player] [amount] [invoice #]");
  729. PlayerInfo[giveplayerid][pFirework] += amount;
  730. format(string, sizeof(string), "You have received %d Fireworks from Shop Tech %s. ", amount, GetPlayerNameEx(playerid));
  731. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  732. format(string, sizeof(string), "[SHOPFIREWORK] %s given %s(%d) %d Firework(s) - Invoice %s for %s. ", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount, invoice, GetPlayerNameEx(giveplayerid));
  733. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  734. Log("logs/shoplog.log", string);
  735. return 1;
  736. }
  737. CMD:miscshop(playerid, params[])
  738. {
  739. if(ShopClosed == 1)
  740. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  741. if (IsAt247(playerid) || IsPlayerInRangeOfPoint(playerid, 4.0, 2939.8442, -1411.2906, 11.0000) && GetPlayerVirtualWorld(playerid) == 1)
  742. {
  743. if(GetPVarInt(playerid, "PinConfirmed"))
  744. {
  745. new szDialog[1024];
  746. format(szDialog, sizeof(szDialog), "Poker Table (Credits: {FFD700}%s{A9C4E4})\nBoombox (Credits: {FFD700}%s{A9C4E4})\n100 Paintball Tokens (Credits: {FFD700}%s{A9C4E4})\nEXP Token (Credits: {FFD700}%s{A9C4E4})\nFireworks x5 (Credits: {FFD700}%s{A9C4E4})\nCustom License Plate (Credits: {FFD700}%s{A9C4E4})",
  747. number_format(ShopItems[6][sItemPrice]), number_format(ShopItems[7][sItemPrice]), number_format(ShopItems[8][sItemPrice]), number_format(ShopItems[9][sItemPrice]),
  748. number_format(ShopItems[10][sItemPrice]), number_format(ShopItems[22][sItemPrice]));
  749. format(szDialog, sizeof(szDialog), "%s\nRestricted Last Name (NEW) (Credits: {FFD700}%s{A9C4E4})\nRestricted Last Name (CHANGE) (Credits: {FFD700}%s{A9C4E4})\nCustom User Title (NEW) (Credits: {FFD700}%s{A9C4E4})\nCustom User Title (CHANGE) (Credits: {FFD700}%s{A9C4E4})\nTeamspeak User Channel (Credits: {FFD700}%s{A9C4E4})\nBackpacks\nDeluxe Car Alarm (Credits: {FFD700}%s{A9C4E4})",
  750. szDialog, number_format(ShopItems[31][sItemPrice]), number_format(ShopItems[32][sItemPrice]), number_format(ShopItems[33][sItemPrice]), number_format(ShopItems[34][sItemPrice]), number_format(ShopItems[35][sItemPrice]), number_format(ShopItems[39][sItemPrice]));
  751. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP, DIALOG_STYLE_LIST, "Misc Shop", szDialog, "Select", "Cancel");
  752. }
  753. else
  754. {
  755. SetPVarInt(playerid, "OpenShop", 1);
  756. PinLogin(playerid);
  757. }
  758. }
  759. else
  760. {
  761. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at a 24/7.");
  762. }
  763. return 1;
  764. }
  765. CMD:credits(playerid, params[])
  766. {
  767. if(PlayerInfo[playerid][pAdmin] < 2)
  768. {
  769. new szString[128];
  770. format(szString, sizeof(szString), "Credits: {FFD700}%s", number_format(PlayerInfo[playerid][pCredits]));
  771. SendClientMessageEx(playerid, COLOR_CYAN, szString);
  772. }
  773. else
  774. {
  775. new Player;
  776. if(sscanf(params, "u", Player))
  777. return SendClientMessageEx(playerid, COLOR_GREY, "Usage: /credits [Player]");
  778. new szString[128];
  779. format(szString, sizeof(szString), "%s - Credits: {FFD700}%s",GetPlayerNameEx(Player), number_format(PlayerInfo[Player][pCredits]));
  780. SendClientMessageEx(playerid, COLOR_CYAN, szString);
  781. }
  782. return 1;
  783. }
  784. CMD:shopstats(playerid, params[])
  785. {
  786. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pShopTech] != 3)
  787. return 0;
  788. mysql_tquery(MainPipeline, "SELECT `id`, `Month` FROM `sales`", "CheckSales", "i", playerid);
  789. return 1;
  790. }
  791. CMD:shophelp(playerid, params[]) {
  792. return ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU, DIALOG_STYLE_LIST, "Which shop do you want to learn more about?","VIP Shop\nHouse Shop\nBusiness Shop\nToy Shop\nMiscellaneous Shop\nCar Shop\nPlane Shop\nBoat Shop", "Select", "Exit");
  793. }
  794. CMD:nggshop(playerid, params[]) {
  795. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen") || PlayerInfo[playerid][pHospital] || PlayerInfo[playerid][pJailTime] > 0 || GetPVarInt(playerid, "EventToken") == 1 || GetPVarInt(playerid, "IsInArena"))
  796. return SendClientMessage(playerid, COLOR_GRAD2, "You can't do this at this time!");
  797. if(PlayerInfo[playerid][pWantedLevel] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are currently wanted, you cannot use this commmand.");
  798. if(gettime() - LastShot[playerid] < 60) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have been shot within the last 60 seconds, you cannot use this command.");
  799. if(IsPlayerInDynamicArea(playerid, NGGShop)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are already at NGG's Shop");
  800. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot do this while being inside a vehicle.");
  801. if(GetPVarInt(playerid, "ShopTP") == 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have already requested a Teleport to the NGG Shop.");
  802. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have requested a Teleport to the NGG Shop, please wait 30 seconds..");
  803. SetTimerEx("TeleportToShop", 30000, false, "i", playerid);
  804. TogglePlayerControllable(playerid, 0);
  805. SetPVarInt(playerid, "ShopTP", 1);
  806. new Float:tmp[3];
  807. GetPlayerPos(playerid, tmp[0], tmp[1], tmp[2]);
  808. SetPVarFloat(playerid, "tmpX", tmp[0]);
  809. SetPVarFloat(playerid, "tmpY", tmp[1]);
  810. SetPVarFloat(playerid, "tmpZ", tmp[2]);
  811. SetPVarInt(playerid, "tmpInt", GetPlayerInterior(playerid));
  812. SetPVarInt(playerid, "tmpVW", GetPlayerVirtualWorld(playerid));
  813. return 1;
  814. }
  815. CMD:leaveshop(playerid, params[]) {
  816. if(GetPVarInt(playerid, "ShopTP") == 1)
  817. {
  818. DeletePVar(playerid, "ShopTP");
  819. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen") || PlayerInfo[playerid][pHospital] || PlayerInfo[playerid][pJailTime] > 0 || IsPlayerInAnyVehicle(playerid))
  820. return SendClientMessage(playerid, COLOR_GRAD2, "You can't do this at this time!.");
  821. if(gettime() - LastShot[playerid] < 60) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have been injured within the last 60 seconds, you will not be teleported to your previous location.");
  822. Player_StreamPrep(playerid, GetPVarFloat(playerid, "tmpX"), GetPVarFloat(playerid, "tmpY"), GetPVarFloat(playerid, "tmpZ"), 2500);
  823. PlayerInfo[playerid][pVW] = GetPVarInt(playerid, "tmpVW");
  824. SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  825. PlayerInfo[playerid][pInt] = GetPVarInt(playerid, "tmpInt");
  826. SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
  827. }
  828. return 1;
  829. }
  830. CMD:buygiftreset(playerid, params[]) {
  831. if(IsPlayerInRangeOfPoint(playerid, 4.0, 2937.2878, -1357.2294, 10.8503))
  832. {
  833. new string[128];
  834. format(string, sizeof(string),"Item: Reset Gift Timer\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[17][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[17][sItemPrice]));
  835. return ShowPlayerDialogEx( playerid, DIALOG_SHOPGIFTRESET, DIALOG_STYLE_MSGBOX, "Reset Gift Timer", string, "Purchase", "Exit" );
  836. }
  837. else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the gift reset purchase location.");
  838. }
  839. CMD:buyhealthcare(playerid, params[]) {
  840. if(IsPlayerInRangeOfPoint(playerid, 4.0, 2946.8672, -1484.9561, 11.0000))
  841. {
  842. return ShowPlayerDialogEx(playerid, DIALOG_HEALTHCARE, DIALOG_STYLE_LIST, "Health Care Purchase", "Advanced Health Care\nSuper Advanced Health Care", "Select", "Exit");
  843. }
  844. return 1;
  845. }
  846. CMD:togshopnotices(playerid, params[]) {
  847. if(PlayerInfo[playerid][pAdmin] >= 1337)
  848. {
  849. if(ShopReminder == 0)
  850. {
  851. ShopReminder = 1;
  852. SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled Shop Notifications.");
  853. }
  854. else
  855. {
  856. ShopReminder = 0;
  857. SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled Shop Notifications.");
  858. }
  859. }
  860. else return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not authorized to use this command.");
  861. return 1;
  862. }
  863. CMD:stoprentacar(playerid, params[])
  864. {
  865. if(GetPVarType(playerid, "RentedVehicle"))
  866. {
  867. new string[128];
  868. SendClientMessageEx(playerid, COLOR_CYAN, "You have stopped renting your vehicle.");
  869. DestroyVehicle(GetPVarInt(playerid, "RentedVehicle"));
  870. mysql_format(MainPipeline, string, sizeof(string), "DELETE FROM `rentedcars` WHERE `sqlid`= '%d'", GetPlayerSQLId(playerid));
  871. mysql_tquery(MainPipeline, string, "OnQueryFinish", "i", SENDDATA_THREAD);
  872. DeletePVar(playerid, "RentedHours");
  873. DeletePVar(playerid, "RentedVehicle");
  874. }
  875. else SendClientMessageEx(playerid, COLOR_GREY, "You are not currently renting a vehicle.");
  876. return 1;
  877. }
  878. CMD:rentacar(playerid, params[])
  879. {
  880. if(ShopClosed == 1)
  881. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  882. if(IsPlayerInRangeOfPoint(playerid, 4, 1102.8999, -1440.1669, 15.7969) || IsPlayerInRangeOfPoint(playerid, 4, 1796.0620, -1588.5571, 13.4951))
  883. {
  884. if(GetPVarInt(playerid, "PinConfirmed"))
  885. {
  886. if(!GetPVarType(playerid, "RentedVehicle"))
  887. {
  888. SetPVarInt(playerid, "RentaCar", 1);
  889. ShowModelSelectionMenu(playerid, CarList2, "Rent a Car!");
  890. }
  891. else SendClientMessageEx(playerid, COLOR_GREY, "You already are renting a vehicle.");
  892. }
  893. else
  894. {
  895. SetPVarInt(playerid, "OpenShop", 2);
  896. PinLogin(playerid);
  897. }
  898. }
  899. else
  900. {
  901. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at a rent a car location.");
  902. }
  903. return 1;
  904. }
  905. CMD:boatshop(playerid, params[])
  906. {
  907. if(ShopClosed == 1)
  908. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  909. if(IsPlayerInRangeOfPoint(playerid, 4, -2214.1636, 2422.4763, 2.4961) || IsPlayerInRangeOfPoint(playerid, 4,-2975.8950, 505.1325, 2.4297) || IsPlayerInRangeOfPoint(playerid, 4, 723.1553, -1494.4547, 1.9343) || IsPlayerInRangeOfPoint(playerid, 4, 2974.7520, -1462.9265, 2.8184))
  910. {
  911. if(GetPVarInt(playerid, "PinConfirmed"))
  912. {
  913. ShowModelSelectionMenu(playerid, BoatList, "Boat Shop");
  914. }
  915. else
  916. {
  917. SetPVarInt(playerid, "OpenShop", 8);
  918. PinLogin(playerid);
  919. }
  920. }
  921. else
  922. {
  923. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the boat shop location.");
  924. }
  925. return 1;
  926. }
  927. CMD:planeshop(playerid, params[])
  928. {
  929. if(ShopClosed == 1)
  930. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  931. if(IsPlayerInRangeOfPoint(playerid, 5, 1891.9105, -2279.6174, 13.5469) || IsPlayerInRangeOfPoint(playerid, 5, 1632.0836, 1551.7365, 10.8061) || IsPlayerInRangeOfPoint(playerid, 5, 2950.4014,-1283.0776,4.6875))
  932. {
  933. if(GetPVarInt(playerid, "PinConfirmed"))
  934. {
  935. ShowModelSelectionMenu(playerid, PlaneList, "Plane Shop");
  936. }
  937. else
  938. {
  939. SetPVarInt(playerid, "OpenShop", 7);
  940. PinLogin(playerid);
  941. }
  942. }
  943. else
  944. {
  945. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the plane shop location.");
  946. }
  947. return 1;
  948. }
  949. CMD:carshop(playerid, params[])
  950. {
  951. if(ShopClosed == 1)
  952. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  953. if(IsPlayerInRangeOfPoint(playerid, 4, 2280.5720, -2325.2490, 13.5469) || IsPlayerInRangeOfPoint(playerid, 4,-1731.1923, 127.4794, 3.2976) || IsPlayerInRangeOfPoint(playerid, 4, 1663.9569, 1628.5106, 10.8203) ||
  954. IsPlayerInRangeOfPoint(playerid, 4, 2958.2200, -1339.2900, 5.2100))
  955. {
  956. if(GetPVarInt(playerid, "PinConfirmed"))
  957. {
  958. ShowModelSelectionMenu(playerid, CarList2, "Car Shop");
  959. }
  960. else
  961. {
  962. SetPVarInt(playerid, "OpenShop", 3);
  963. PinLogin(playerid);
  964. }
  965. }
  966. else
  967. {
  968. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the car shop location.");
  969. }
  970. return 1;
  971. }
  972. CMD:changepin(playerid, params[])
  973. {
  974. if(GetPVarInt(playerid, "PinConfirmed"))
  975. {
  976. SetPVarInt(playerid, "ChangePin", 1);
  977. ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN, DIALOG_STYLE_INPUT, "Change Pin Number", "Enter a new pin number to change your current one.", "Change", "Cancel");
  978. }
  979. else
  980. {
  981. PinLogin(playerid);
  982. }
  983. return 1;
  984. }
  985. CMD:houseshop(playerid, params[])
  986. {
  987. if(ShopClosed == 1) return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  988. if(IsPlayerInRangeOfPoint(playerid, 4.0, 2938.2734, -1391.0596, 11.0000) && GetPlayerVirtualWorld(playerid) == 1)
  989. {
  990. if(GetPVarInt(playerid, "PinConfirmed"))
  991. {
  992. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP, DIALOG_STYLE_LIST, "House Shop", "Purchase House\nHouse Interior Change\nHouse Move\nGarage - Small\nGarage - Medium\nGarage - Large\nGarage - Extra Large","Select", "Exit" );
  993. }
  994. else
  995. {
  996. SetPVarInt(playerid, "OpenShop", 4);
  997. PinLogin(playerid);
  998. }
  999. }
  1000. else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the house shop location.");
  1001. return 1;
  1002. }
  1003. CMD:sellcredits(playerid, params[])
  1004. {
  1005. if(restarting) return SendClientMessageEx(playerid, COLOR_GRAD2, "Transactions are currently disabled due to the server being restarted for maintenance.");
  1006. new
  1007. Player,
  1008. Credits,
  1009. Amount;
  1010. if(SellClosed == 1)
  1011. return SendClientMessageEx(playerid, COLOR_GREY, "Selling of credits is currently disabled.");
  1012. if(PlayerInfo[playerid][pDonateRank] < 2 && !nonvipcredits)
  1013. return SendClientMessageEx(playerid, COLOR_GREY, "You cannot initiate trades unless you are SVIP+!");
  1014. if(sscanf(params, "udd", Player, Credits, Amount))
  1015. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sellcredits [Player] [Credits] [Amount]");
  1016. else if(!IsPlayerConnected(Player))
  1017. return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1018. else if(Credits < 0 || Amount < 0)
  1019. return SendClientMessageEx(playerid, COLOR_GREY, "Amount/Price can't be below zero.");
  1020. else if(Player == playerid)
  1021. return SendClientMessageEx(playerid, COLOR_GREY, "You can't sell credits to yourself.");
  1022. else if(Credits > PlayerInfo[playerid][pCredits])
  1023. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many credits.");
  1024. else if(Credits < 51)
  1025. return SendClientMessageEx(playerid, COLOR_GREY, "You need to trade at least 51 credits.");
  1026. else if (!ProxDetectorS(10.0, playerid, Player))
  1027. return SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
  1028. else if(GetPVarType(Player, "CreditsAmount"))
  1029. return SendClientMessageEx(playerid, COLOR_GREY, "That player already has been offered.");
  1030. else if(!GetPVarInt(playerid, "PinConfirmed"))
  1031. PinLogin(playerid);
  1032. else
  1033. {
  1034. new szMessage[200], CreditsTaxed;
  1035. new year, month, day;
  1036. new TransactionFee;
  1037. getdate(year, month, day);
  1038. SetPVarInt(Player, "CreditsFirstAmount", Credits);
  1039. if(!freeweekend)
  1040. {
  1041. switch(PlayerInfo[playerid][pDonateRank]) {
  1042. case 0 .. 2: {
  1043. CreditsTaxed = 2*Credits/100;
  1044. Credits = Credits-10;
  1045. Credits = Credits-CreditsTaxed;
  1046. TransactionFee = (10+CreditsTaxed);
  1047. }
  1048. case 3: {
  1049. CreditsTaxed = 2*Credits/100;
  1050. Credits = Credits-5;
  1051. Credits = Credits-CreditsTaxed;
  1052. TransactionFee = (5+CreditsTaxed);
  1053. }
  1054. case 4 .. 5: {
  1055. CreditsTaxed = 0;
  1056. Credits = Credits-5;
  1057. TransactionFee = 5;
  1058. }
  1059. }
  1060. }
  1061. SetPVarInt(Player, "CreditsOffer", Amount);
  1062. SetPVarInt(Player, "CreditsAmount", Credits);
  1063. SetPVarInt(Player, "CreditsSeller", playerid);
  1064. SetPVarInt(playerid, "CreditsSeller", Player);
  1065. format(szMessage, 200, "You have offered %s {FFD700}%s{FFFFFF} credits for $%s. (Transaction Fee: %s)", GetPlayerNameEx(Player), number_format(Credits+TransactionFee), number_format(Amount), number_format(TransactionFee));
  1066. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  1067. format(szMessage, 200, "Seller: %s(%d)\nPrice: $%s\nCredits: {FFD700}%s{A9C4E4}\nTransaction Fee: {FFD700}%s{A9C4E4}\nCredits you will recieve: {FFD700}%s{A9C4E4}", GetPlayerNameEx(playerid), playerid, number_format(Amount), number_format(Credits+TransactionFee), number_format(TransactionFee), number_format(Credits));
  1068. ShowPlayerDialogEx(Player, DIALOG_SELLCREDITS, DIALOG_STYLE_MSGBOX, "Purchase Credits", szMessage, "Purchase", "Decline");
  1069. }
  1070. return 1;
  1071. }
  1072. CMD:togglehealthcare(playerid, params[])
  1073. {
  1074. if(PlayerInfo[playerid][pHealthCare] == 0)
  1075. {
  1076. ShowPlayerDialogEx(playerid, DIALOG_HEALTHCARE, DIALOG_STYLE_LIST, "Health Care", "Advanced Health Care\nSuper Advanced Health Care", "Select", "Exit");
  1077. }
  1078. else
  1079. {
  1080. PlayerInfo[playerid][pHealthCare] = 0;
  1081. SendClientMessageEx(playerid, COLOR_CYAN, "You have disabled health care.");
  1082. }
  1083. return 1;
  1084. }
  1085. CMD:vipshop(playerid, params[])
  1086. {
  1087. if(ShopClosed == 1)
  1088. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  1089. if(IsPlayerInRangeOfPoint(playerid, 4, -2443.6013, 499.7480, 30.0906) || IsPlayerInRangeOfPoint(playerid, 4, 1934.1083, 1364.5004, 9.2578) || IsPlayerInRangeOfPoint(playerid, 4, 1811.3344, -1569.4244, 13.4811)
  1090. || IsPlayerInRangeOfPoint(playerid, 4, 2939.0134, -1401.2946, 11.0000))
  1091. {
  1092. if(GetPVarInt(playerid, "PinConfirmed"))
  1093. {
  1094. ShowPlayerDialogEx( playerid, DIALOG_VIPSHOP, DIALOG_STYLE_LIST, "VIP Shop", "Purchase VIP\nRenew Gold VIP","Continue", "Exit" );
  1095. }
  1096. else
  1097. {
  1098. SetPVarInt(playerid, "OpenShop", 5);
  1099. PinLogin(playerid);
  1100. }
  1101. }
  1102. else
  1103. {
  1104. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the vip shop location.");
  1105. }
  1106. return 1;
  1107. }
  1108. CMD:reloadstats(playerid, params[])
  1109. {
  1110. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pShopTech] != 3)
  1111. return 0;
  1112. mysql_tquery(MainPipeline, "SELECT * FROM `sales` WHERE `Month` > NOW() - INTERVAL 1 MONTH", "OnQueryFinish", "iii", LOADSALEDATA_THREAD, INVALID_PLAYER_ID, -1);
  1113. SendClientMessageEx(playerid, COLOR_WHITE, "Reloading sale stats.");
  1114. return 1;
  1115. }
  1116. CMD:closesellcredits(playerid, params[])
  1117. {
  1118. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pShopTech] != 3)
  1119. return 0;
  1120. if(SellClosed == 0)
  1121. {
  1122. SellClosed = 1;
  1123. SendClientMessageEx(playerid, COLOR_WHITE, "The shop is now closed.");
  1124. }
  1125. else
  1126. {
  1127. SellClosed = 0;
  1128. SendClientMessageEx(playerid, COLOR_WHITE, "The shop is now opened.");
  1129. }
  1130. return 1;
  1131. }
  1132. CMD:closeshop(playerid, params[])
  1133. {
  1134. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pShopTech] != 3)
  1135. return 0;
  1136. if(ShopClosed == 0)
  1137. {
  1138. ShopClosed = 1;
  1139. SendClientMessageEx(playerid, COLOR_WHITE, "The shop is now closed.");
  1140. }
  1141. else
  1142. {
  1143. ShopClosed = 0;
  1144. SendClientMessageEx(playerid, COLOR_WHITE, "The shop is now opened.");
  1145. }
  1146. g_mysql_SaveMOTD();
  1147. return 1;
  1148. }
  1149. CMD:editshop(playerid, params[])
  1150. {
  1151. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pShopTech] != 3)
  1152. return 0;
  1153. if (isnull(params)) {
  1154. SendClientMessageEx(playerid, COLOR_WHITE, "Usage: /editshop <code>");
  1155. return 1;
  1156. }
  1157. if (strcmp(params, SecurityCode) == 0)
  1158. {
  1159. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPMENU, DIALOG_STYLE_LIST, "Edit Shop", "Edit Shop Prices\nEdit Business Shop\nEdit Micro Shop", "Select", "Exit");
  1160. if(GetPVarType(playerid, "CodeAttempts")) DeletePVar(playerid, "CodeAttempts");
  1161. }
  1162. else
  1163. {
  1164. if(GetPVarInt(playerid, "CodeAttempts") != 3) {
  1165. SendClientMessageEx(playerid, COLOR_GREY, "Password entered is invalid.");
  1166. SetPVarInt(playerid, "CodeAttempts", GetPVarInt(playerid, "CodeAttempts")+1);
  1167. }
  1168. else
  1169. {
  1170. new string[128];
  1171. format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: To many failed attempts.", GetPlayerNameEx(playerid)), ABroadCast(COLOR_YELLOW,string,2);
  1172. PlayerInfo[playerid][pBanned] = 1;
  1173. SystemBan(playerid, "[System] (To many failed attempts)");
  1174. Kick(playerid);
  1175. }
  1176. }
  1177. return 1;
  1178. }
  1179. CMD:businessshop(playerid, params[])
  1180. {
  1181. if(ShopClosed == 1)
  1182. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  1183. if(GetPVarInt(playerid, "PinConfirmed"))
  1184. {
  1185. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUSINESS, DIALOG_STYLE_LIST, "Businesses Shop", "Purchase Business\nRenew Business", "Select", "Exit");
  1186. }
  1187. else
  1188. {
  1189. SetPVarInt(playerid, "OpenShop", 6);
  1190. PinLogin(playerid);
  1191. }
  1192. return 1;
  1193. }
  1194. CMD:toyshop(playerid, params[])
  1195. {
  1196. if(ShopClosed == 1)
  1197. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  1198. if (IsAtClothingStore(playerid) || IsPlayerInRangeOfPoint(playerid, 4.0, 2927.5244, -1549.1826, 11.0469))
  1199. {
  1200. if(GetPVarInt(playerid, "PinConfirmed"))
  1201. {
  1202. ShowModelSelectionMenu(playerid, ToyList2, "Toy Shop");
  1203. }
  1204. else
  1205. {
  1206. PinLogin(playerid);
  1207. }
  1208. }
  1209. else
  1210. {
  1211. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at a clothes shop.");
  1212. }
  1213. return 1;
  1214. }
  1215. CMD:thanksgivingshop(playerid, params[])
  1216. {
  1217. if(HalloweenShop == 1)
  1218. return SendClientMessageEx(playerid, COLOR_GREY, "The shop is currently closed.");
  1219. if (IsAtClothingStore(playerid))
  1220. {
  1221. if(GetPVarInt(playerid, "PinConfirmed"))
  1222. {
  1223. new string[150];
  1224. format(string, sizeof(string), "Straw Hat (Cost: 150 Credits | Stock: %d)\nCluckin Bell Hat (Cost: 150 Credits | Stock: %d)", PumpkinStock, PumpkinStock);//\nSpiked Club Toy (Cost: 60 Credits)", PumpkinStock);
  1225. ShowPlayerDialogEx(playerid, DIALOG_HALLOWEENSHOP, DIALOG_STYLE_LIST, "Halloween Shop", string, "Select", "Exit");
  1226. return 1;
  1227. }
  1228. else
  1229. {
  1230. PinLogin(playerid);
  1231. }
  1232. }
  1233. else
  1234. {
  1235. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at a clothes shop.");
  1236. }
  1237. return 1;
  1238. }
  1239. CMD:chargeplayer(playerid, params[])
  1240. {
  1241. new string[128], giveplayerid, amount, reason[64];
  1242. if(sscanf(params, "uds[64]", giveplayerid, amount, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /chargeplayer [player] [amount] [reason]");
  1243. if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pShopTech] == 2)
  1244. {
  1245. if(IsPlayerConnected(giveplayerid))
  1246. {
  1247. if (amount < 1)
  1248. return SendClientMessageEx(playerid, COLOR_GREY, "Amount must be greater than 0");
  1249. if(PlayerInfo[giveplayerid][pCredits] < amount)
  1250. return SendClientMessageEx(playerid, COLOR_GREY, "That player doesn't have that many credits.");
  1251. format(string, sizeof(string), "You have offered %s a charge of %s credits for %s.", GetPlayerNameEx(giveplayerid), number_format(amount), reason);
  1252. SendClientMessageEx(playerid, COLOR_CYAN, string);
  1253. SetPVarInt(giveplayerid, "FineAmount", amount), SetPVarInt(giveplayerid, "FineBy", playerid), SetPVarString(giveplayerid, "FineReason", reason);
  1254. format(string, sizeof(string), "Admin: %s\nReason: %s\nCredits Available: %s\nFine Amount: %s", GetPlayerNameEx(playerid), reason, number_format(PlayerInfo[giveplayerid][pCredits]), number_format(amount));
  1255. ShowPlayerDialogEx(giveplayerid, DIALOG_CHARGEPLAYER, DIALOG_STYLE_MSGBOX, "Credit Fine", string, "Accept", "Decline");
  1256. return 1;
  1257. }
  1258. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  1259. }
  1260. else
  1261. {
  1262. SendClientMessageEx(playerid, COLOR_WHITE, "You're not a level three admin.");
  1263. }
  1264. return 1;
  1265. }
  1266. CMD:givecredits(playerid, params[])
  1267. {
  1268. if(PlayerInfo[playerid][pAdmin] < 99999 && PlayerInfo[playerid][pShopTech] != 3)
  1269. return 0;
  1270. new szMessage[128], Player, Amount;
  1271. if(sscanf(params, "ud", Player, Amount))
  1272. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givecredits [Player] [Amount]");
  1273. if(!IsPlayerConnected(Player))
  1274. return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1275. PlayerInfo[Player][pCredits] += Amount;
  1276. mysql_format(MainPipeline, szMessage, sizeof(szMessage), "UPDATE `accounts` SET `Credits`=%d WHERE `id` = %d", PlayerInfo[Player][pCredits], GetPlayerSQLId(Player));
  1277. mysql_tquery(MainPipeline, szMessage, "OnQueryFinish", "ii", SENDDATA_THREAD, Player);
  1278. print(szMessage);
  1279. format(szMessage, sizeof(szMessage), "[SETCREDITS] [Amount: %d] [User: %s(%i)] [IP: %s] [Credits: %s] [Admin: %s] [IP: %s]",Amount,GetPlayerNameEx(Player), GetPlayerSQLId(Player), GetPlayerIpEx(Player), number_format(PlayerInfo[Player][pCredits]), GetPlayerNameEx(playerid), GetPlayerIpEx(playerid));
  1280. Log("logs/credits.log", szMessage), print(szMessage);
  1281. format(szMessage, sizeof(szMessage), "You have given %s %s credits.", GetPlayerNameEx(Player), number_format(Amount));
  1282. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  1283. return 1;
  1284. }
  1285. CMD:setcredits(playerid, params[])
  1286. {
  1287. if(PlayerInfo[playerid][pAdmin] < 99999 && PlayerInfo[playerid][pShopTech] != 3)
  1288. return 0;
  1289. new szMessage[128], Player, Amount;
  1290. if(sscanf(params, "ud", Player, Amount))
  1291. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setcredits [Player] [Amount]");
  1292. if(!IsPlayerConnected(Player))
  1293. return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1294. PlayerInfo[Player][pCredits] = Amount;
  1295. mysql_format(MainPipeline, szMessage, sizeof(szMessage), "UPDATE `accounts` SET `Credits`=%d WHERE `id` = %d", PlayerInfo[Player][pCredits], GetPlayerSQLId(Player));
  1296. mysql_tquery(MainPipeline, szMessage, "OnQueryFinish", "ii", SENDDATA_THREAD, Player);
  1297. print(szMessage);
  1298. format(szMessage, sizeof(szMessage), "[SETCREDITS] [Amount: %d] [User: %s(%i)] [IP: %s] [Credits: %s] [Admin: %s] [IP: %s]",Amount,GetPlayerNameEx(Player), GetPlayerSQLId(Player), GetPlayerIpEx(Player), number_format(PlayerInfo[Player][pCredits]), GetPlayerNameEx(playerid), GetPlayerIpEx(playerid));
  1299. Log("logs/credits.log", szMessage), print(szMessage);
  1300. format(szMessage, sizeof(szMessage), "You have set %s's credits to %s.", GetPlayerNameEx(Player), number_format(PlayerInfo[Player][pCredits]));
  1301. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  1302. return 1;
  1303. }
  1304. CMD:settotalcredits(playerid, params[])
  1305. {
  1306. if(PlayerInfo[playerid][pAdmin] < 99999 && PlayerInfo[playerid][pShopTech] != 3)
  1307. return 0;
  1308. new szMessage[128], Player, Amount;
  1309. if(sscanf(params, "ud", Player, Amount))
  1310. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /settotalcredits [Player] [Amount]");
  1311. if(!IsPlayerConnected(Player))
  1312. return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1313. PlayerInfo[Player][pTotalCredits] = Amount;
  1314. mysql_format(MainPipeline, szMessage, sizeof(szMessage), "UPDATE `accounts` SET `TotalCredits`=%d WHERE `id` = %d", PlayerInfo[Player][pTotalCredits], GetPlayerSQLId(Player));
  1315. mysql_tquery(MainPipeline, szMessage, "OnQueryFinish", "ii", SENDDATA_THREAD, Player);
  1316. format(szMessage, sizeof(szMessage), "[SETTOTALCREDITS][Amount: %d] [User: %s(%i)] [IP: %s] [Admin: %s] [IP: %s]",Amount, GetPlayerNameEx(Player), GetPlayerSQLId(Player), GetPlayerIpEx(Player), GetPlayerNameEx(playerid), GetPlayerIpEx(playerid));
  1317. Log("logs/credits.log", szMessage), print(szMessage);
  1318. format(szMessage, sizeof(szMessage), "You have set %s's total credits to %s.", GetPlayerNameEx(Player), number_format(PlayerInfo[Player][pTotalCredits]));
  1319. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  1320. return 1;
  1321. }
  1322. CMD:toghalloweenshop(playerid, params[])
  1323. {
  1324. if(PlayerInfo[playerid][pAdmin] > 1337 || PlayerInfo[playerid][pPR] == 2 || PlayerInfo[playerid][pShopTech] == 3)
  1325. {
  1326. new string[128];
  1327. if(HalloweenShop)
  1328. {
  1329. HalloweenShop = 0;
  1330. SendClientMessageEx(playerid, COLOR_RED, "You have toggled the halloween shop on. It will now be available to players.");
  1331. g_mysql_SaveMOTD();
  1332. format(string, sizeof(string), "Admin %s(%i) has toggled the halloween toy shop on.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid) );
  1333. Log("logs/zombiecure.log", string);
  1334. }
  1335. else{
  1336. HalloweenShop = 1;
  1337. SendClientMessageEx(playerid, COLOR_RED, "You have toggled the halloween shop off. It will not be available to players.");
  1338. g_mysql_SaveMOTD();
  1339. format(string, sizeof(string), "Admin %s(%i) has toggled the halloween toy shop off.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid) );
  1340. Log("logs/zombiecure.log", string);
  1341. }
  1342. }
  1343. return 1;
  1344. }
  1345. CMD:setpumpkinstock(playerid, params[])
  1346. {
  1347. if(PlayerInfo[playerid][pAdmin] > 1337 || PlayerInfo[playerid][pPR] == 2 || PlayerInfo[playerid][pShopTech] == 3)
  1348. {
  1349. new string[128], pumpkins;
  1350. if(sscanf(params, "d", pumpkins)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setpumpkinstock [stock]");
  1351. format(string, sizeof(string), "You have set the pumpkin stock to %d.", pumpkins);
  1352. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  1353. format(string, sizeof(string), "Admin %s(%i) has set the pumpkin stock to %d from %d.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), pumpkins, PumpkinStock );
  1354. Log("logs/zombiecure.log", string);
  1355. PumpkinStock = pumpkins;
  1356. g_mysql_SaveMOTD();
  1357. }
  1358. return 1;
  1359. }
  1360. CMD:microshop(playerid, params[])
  1361. {
  1362. DeletePVar(playerid, "m_listitem");
  1363. DeletePVar(playerid, "m_Item");
  1364. DeletePVar(playerid, "m_Response");
  1365. if(GetPVarInt(playerid, "PinConfirmed")) ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP, DIALOG_STYLE_LIST, "Microtransaction Shop", "Job & Experience\nVIP\nFood\nHouse\nVehicle\nMiscellaneous\nEvents", "Select", "Exit");
  1366. else SetPVarInt(playerid, "OpenShop", 11), PinLogin(playerid);
  1367. return 1;
  1368. }
  1369. CMD:placesign(playerid, params[])
  1370. {
  1371. if(!PlayerInfo[playerid][mInventory][6]) return SendClientMessageEx(playerid, COLOR_GREY, "You do not have any house sale signs in your inventory, visit /microshop to purchase");
  1372. new h = InRangeOfWhichHouse(playerid, 10);
  1373. if(h == INVALID_HOUSE_ID) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at a 10 meter radius from your house to place it down.");
  1374. if(HouseInfo[h][hSignExpire]) return SendClientMessageEx(playerid, COLOR_GREY, "This house already has a house sale sign attached to it, type /editsign to adjust its position or text.");
  1375. if(GetPVarType(playerid, "signID")) return SendClientMessageEx(playerid, COLOR_GREY, "Please complete placing down your current house sale sign before attempting to place another.");
  1376. ClearCheckpoint(playerid);
  1377. new Float:pos[4];
  1378. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  1379. GetPlayerFacingAngle(playerid, pos[3]);
  1380. SetPVarInt(playerid, "house", h);
  1381. SetPVarInt(playerid, "editingsign", 1);
  1382. SetPVarInt(playerid, "signID", CreateDynamicObject(19471, pos[0]+1, pos[1], pos[2], 0, 0, pos[3], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
  1383. EditDynamicObject(playerid, GetPVarInt(playerid, "signID"));
  1384. SendClientMessageEx(playerid, 0xFFFFAAAA, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
  1385. SetPlayerCheckpoint(playerid, HouseInfo[h][hExteriorX], HouseInfo[h][hExteriorY], HouseInfo[h][hExteriorZ], 20);
  1386. SendClientMessageEx(playerid, COLOR_GREY, "Keep the object within the checkpoint to place successfully.");
  1387. return 1;
  1388. }
  1389. CMD:editsign(playerid, params[])
  1390. {
  1391. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  1392. {
  1393. new h, option[10], desc[64];
  1394. if(sscanf(params, "ds[10]S()[64]", h, option, desc)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /editsign [houseid] [option]"), SendClientMessageEx(playerid, COLOR_GREY, "Available options: text, position");
  1395. if(HouseInfo[h][hSignExpire] == 0) return SendClientMessageEx(playerid, COLOR_GREY, "This house doesn't have a House Sale Sign attached, /placesign to place one down.");
  1396. if(!strcmp(option, "text", true))
  1397. {
  1398. if(!(1 <= strlen(desc) <= 64)) return SendClientMessageEx(playerid, COLOR_GREY, "Description text cannot be empty and no longer than 64 characters.");
  1399. new string[128], escapeDesc[64];
  1400. mysql_escape_string(desc, escapeDesc);
  1401. format(HouseInfo[h][hSignDesc], sizeof(escapeDesc), "%s", escapeDesc);
  1402. format(string, sizeof(string), "%s has edited house ID: %d sale sign text to %s", GetPlayerNameEx(playerid), h, HouseInfo[h][hSignDesc]);
  1403. Log("logs/hedit.log", string);
  1404. SendClientMessageEx(playerid, -1, string);
  1405. }
  1406. if(!strcmp(option, "position", true))
  1407. {
  1408. ClearCheckpoint(playerid);
  1409. SetPVarInt(playerid, "house", h);
  1410. SetPVarInt(playerid, "editingsign", 3);
  1411. SetPVarInt(playerid, "signID", HouseInfo[h][hSignObj]);
  1412. EditDynamicObject(playerid, GetPVarInt(playerid, "signID"));
  1413. SendClientMessageEx(playerid, 0xFFFFAAAA, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
  1414. SetPlayerCheckpoint(playerid, HouseInfo[h][hExteriorX], HouseInfo[h][hExteriorY], HouseInfo[h][hExteriorZ], 20);
  1415. SendClientMessageEx(playerid, COLOR_GREY, "Keep the object within the checkpoint to place successfully.");
  1416. }
  1417. return 1;
  1418. }
  1419. if(GetPVarType(playerid, "editingsign")) return SendClientMessageEx(playerid, COLOR_GREY, "You are already editing your house sign.");
  1420. new h = InRangeOfWhichHouse(playerid, 10);
  1421. if(h == INVALID_HOUSE_ID) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at a 10 meter radius from your house to edit your house sign.");
  1422. if(HouseInfo[h][hSignExpire] == 0) return SendClientMessageEx(playerid, COLOR_GREY, "This house doesn't have a House Sale Sign attached, /placesign to place one down.");
  1423. new option[10], desc[64];
  1424. if(sscanf(params, "s[10]S()[64]", option, desc)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /editsign [option]"), SendClientMessageEx(playerid, COLOR_GREY, "Available options: text, position");
  1425. if(!strcmp(option, "text", true))
  1426. {
  1427. if(GetPVarType(playerid, "HasReport")) return SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  1428. if(isnull(desc)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /editsign text [decription]");
  1429. if(!(1 <= strlen(desc) <= 64)) return SendClientMessageEx(playerid, COLOR_GREY, "Description text cannot be empty and no longer than 64 characters.");
  1430. new string[128];
  1431. SetPVarInt(playerid, "hSignRequest", h);
  1432. SetPVarString(playerid, "hSignRequestText", desc);
  1433. format(string, sizeof(string), "You have requested a House Sale Sign Text Change for house ID: %d, please wait until a General Admin approves it.", h);
  1434. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  1435. format(string, sizeof(string), "House Sale Sign Text Change (HID: %d)", h);
  1436. SendReportToQue(playerid, string, 2, 4);
  1437. }
  1438. if(!strcmp(option, "position", true))
  1439. {
  1440. ClearCheckpoint(playerid);
  1441. SetPVarInt(playerid, "house", h);
  1442. SetPVarInt(playerid, "editingsign", 2);
  1443. SetPVarInt(playerid, "signID", HouseInfo[h][hSignObj]);
  1444. EditDynamicObject(playerid, GetPVarInt(playerid, "signID"));
  1445. SendClientMessageEx(playerid, 0xFFFFAAAA, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
  1446. SetPlayerCheckpoint(playerid, HouseInfo[h][hExteriorX], HouseInfo[h][hExteriorY], HouseInfo[h][hExteriorZ], 20);
  1447. SendClientMessageEx(playerid, COLOR_GREY, "Keep the object within the checkpoint to place successfully.");
  1448. }
  1449. return 1;
  1450. }
  1451. CMD:readsign(playerid, params[])
  1452. {
  1453. for(new i; i < MAX_HOUSES; i++)
  1454. {
  1455. if(!HouseInfo[i][hSignExpire]) continue;
  1456. if(IsPlayerInRangeOfPoint(playerid, 5, HouseInfo[i][hSign][0], HouseInfo[i][hSign][1], HouseInfo[i][hSign][2]))
  1457. {
  1458. if(isnull(HouseInfo[i][hSignDesc])) format(HouseInfo[i][hSignDesc], 64, "None");
  1459. return ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "House Sale Sign", HouseInfo[i][hSignDesc], "Close", "");
  1460. }
  1461. }
  1462. SendClientMessageEx(playerid, COLOR_GREY, "You are not in range of any house sale sign.");
  1463. return 1;
  1464. }
  1465. CMD:fuelcan(playerid, params[])
  1466. {
  1467. if(!PlayerInfo[playerid][mInventory][7]) return SendClientMessageEx(playerid, COLOR_GREY, "You do not have any Fuel Cans in your inventory, visit /microshop to purchase.");
  1468. if(GetPVarInt(playerid, "fuelcan") == 1) return 1;
  1469. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can not use your fuel can while inside the vehicle.");
  1470. if(GetPVarInt(playerid, "EventToken")) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this while in an event.");
  1471. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen")) return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
  1472. new closestcar = GetClosestCar(playerid);
  1473. if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 10.0)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not close enough to any vehicle.");
  1474. new string[72];
  1475. format(string, sizeof(string), "%s begins refilling their vehicle with a fuel can.", GetPlayerNameEx(playerid));
  1476. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1477. ApplyAnimation(playerid, "SCRATCHING", "scdldlp", 4.0, 1, 0, 0, 0, 0, 1);
  1478. SetTimerEx("FuelCan", 10000, false, "iii", playerid, closestcar, 100);
  1479. SetPVarInt(playerid, "fuelcan", 1);
  1480. GameTextForPlayer(playerid, "~w~Refueling...", 10000, 3);
  1481. return 1;
  1482. }
  1483. CMD:jumpstart(playerid, params[])
  1484. {
  1485. if(!PlayerInfo[playerid][mInventory][8]) return SendClientMessageEx(playerid, COLOR_GREY, "You do not have any Jump Start's in your inventory, visit /microshop to purchase.");
  1486. if(GetPVarInt(playerid, "jumpstarting") == 1) return 1;
  1487. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can not jump start while inside the vehicle.");
  1488. if(GetPVarInt(playerid, "EventToken")) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this while in an event.");
  1489. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen")) return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
  1490. new closestcar = GetClosestCar(playerid);
  1491. if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 10.0)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not close enough to any vehicle.");
  1492. if(!IsABike(closestcar) && !IsAPlane(closestcar))
  1493. {
  1494. new engine,lights,alarm,doors,bonnet,boot,objective;
  1495. GetVehicleParamsEx(closestcar,engine,lights,alarm,doors,bonnet,boot,objective);
  1496. if(bonnet == VEHICLE_PARAMS_OFF || bonnet == VEHICLE_PARAMS_UNSET) return SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle hood must be opened in order to jump start it.");
  1497. }
  1498. new string[61];
  1499. format(string, sizeof(string), "%s begins to jump start their vehicle.", GetPlayerNameEx(playerid));
  1500. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1501. ApplyAnimation(playerid, "MISC", "Plunger_01", 4.1, 1, 1, 1, 1, 1, 1);
  1502. SetTimerEx("JumpStart", 10000, false, "ii", playerid, closestcar);
  1503. SetPVarInt(playerid, "jumpstarting", 1);
  1504. GameTextForPlayer(playerid, "~w~Jump Starting...", 10000, 3);
  1505. return 1;
  1506. }
  1507. CMD:rcarcolor(playerid, params[])
  1508. {
  1509. if(!PlayerInfo[playerid][mInventory][9]) return SendClientMessageEx(playerid, COLOR_GREY, "You do not have any Restricted Car Colors in your inventory, visit /microshop to purchase.");
  1510. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a vehicle.");
  1511. new iColors[2];
  1512. if(sscanf(params, "dd", iColors[0], iColors[1])) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /rcarcolor [color1] [color2]. Colors must be an ID.");
  1513. if(!(128 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (Restricted color IDs start at 128, and end at 255).");
  1514. new szMessage[128];
  1515. for(new i = 0; i < MAX_PLAYERVEHICLES; i++)
  1516. {
  1517. if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][i][pvId]))
  1518. {
  1519. PlayerVehicleInfo[playerid][i][pvColor1] = iColors[0], PlayerVehicleInfo[playerid][i][pvColor2] = iColors[1];
  1520. ChangeVehicleColor(PlayerVehicleInfo[playerid][i][pvId], PlayerVehicleInfo[playerid][i][pvColor1], PlayerVehicleInfo[playerid][i][pvColor2]);
  1521. PlayerInfo[playerid][mInventory][9]--;
  1522. g_mysql_SaveVehicle(playerid, i);
  1523. format(szMessage, sizeof(szMessage), "[RCARCOLOR] %s(%d) used a restricted car color. Left: %d", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), PlayerInfo[playerid][mInventory][9]);
  1524. Log("logs/micro.log", szMessage);
  1525. format(szMessage, sizeof(szMessage), "You have changed the colors of your vehicle to ID %d, %d.", iColors[0], iColors[1]);
  1526. return SendClientMessageEx(playerid, COLOR_GRAD2, szMessage);
  1527. }
  1528. }
  1529. SendClientMessageEx(playerid, COLOR_GREY, "You need to be inside a vehicle that you own.");
  1530. return 1;
  1531. }
  1532. CMD:eatbar(playerid, params[])
  1533. {
  1534. if(!PlayerInfo[playerid][mInventory][4]) return SendClientMessageEx(playerid, COLOR_GREY, "You do not have any Energy Bars in your inventory, visit /microshop to purchase.");
  1535. if(GetPVarInt(playerid, "eatingbar") == 1) return 1;
  1536. new string[128];
  1537. if(PlayerInfo[playerid][mCooldown][4])
  1538. {
  1539. format(string, sizeof(string), "You currently have a active Energy Bar, please wait for it to expire in %d minute(s) to consume again.", PlayerInfo[playerid][mCooldown][4]);
  1540. return SendClientMessageEx(playerid, COLOR_GRAD2, string);
  1541. }
  1542. ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 1, 0, 0, 0, 0, 1);
  1543. format(string, sizeof(string), "%s chews on a energy bar", GetPlayerNameEx(playerid));
  1544. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1545. SetPVarInt(playerid, "eatingbar", 1);
  1546. SetTimerEx("EatBar", 2000, false, "i", playerid);
  1547. return 1;
  1548. }
  1549. CMD:activeitems(playerid, params[])
  1550. {
  1551. new string[128];
  1552. if(PlayerInfo[playerid][mPurchaseCount][1] && PlayerInfo[playerid][mCooldown][1]) format(string, sizeof(string), "You currently have an active Job Boost for the %s job for another %d minute(s).", GetJobName(PlayerInfo[playerid][mBoost][0]), PlayerInfo[playerid][mCooldown][1]), SendClientMessageEx(playerid, -1, string);
  1553. if(PlayerInfo[playerid][mCooldown][4]) format(string, sizeof(string), "You currently have an active Energy Bar for another %d minute(s).", PlayerInfo[playerid][mCooldown][4]), SendClientMessageEx(playerid, -1, string);
  1554. if(PlayerInfo[playerid][mPurchaseCount][12] && PlayerInfo[playerid][mCooldown][12]) format(string, sizeof(string), "You currently have a Quick Bank Access for another %d minute(s).", PlayerInfo[playerid][mCooldown][12]), SendClientMessageEx(playerid, -1, string);
  1555. if(zombieevent) format(string, sizeof(string), "You currently have a antibiotic flowing through your bloodstream protecting you from %d zombie bite(s).", PlayerInfo[playerid][mInventory][18]), SendClientMessageEx(playerid, -1, string);
  1556. return 1;
  1557. }
  1558. CMD:cooldowns(playerid, params[])
  1559. {
  1560. new string[128];
  1561. for(new item; item < MAX_MICROITEMS; item++)
  1562. {
  1563. if(gettime() < PlayerInfo[playerid][mCooldown][item])
  1564. {
  1565. format(string, sizeof(string), "You can purchase another \"%s\" in %s.", mItemName[item], ConvertTimeS(PlayerInfo[playerid][mCooldown][item]-gettime()));
  1566. SendClientMessageEx(playerid, -1, string);
  1567. }
  1568. }
  1569. return 1;
  1570. }
  1571. CMD:managecredits(playerid, params[])
  1572. {
  1573. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pShopTech] >= 3)
  1574. return ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS, DIALOG_STYLE_LIST, "Manage Credits", "Credits Selling\nFree Weekend\nNon-VIP Credit Selling", "Okay", "Cancel");
  1575. return 0;
  1576. }
  1577. forward OnShopOrder(index);
  1578. public OnShopOrder(index)
  1579. {
  1580. if(IsPlayerConnected(index))
  1581. {
  1582. HideNoticeGUIFrame(index);
  1583. new rows;
  1584. cache_get_row_count(rows);
  1585. if(rows > 0)
  1586. {
  1587. new string[512];
  1588. new ipsql[16], ip[16];
  1589. GetPlayerIp(index, ip, sizeof(ip));
  1590. cache_get_value_name(0, "ip", ipsql);
  1591. if(!isnull(ipsql) && strcmp(ipsql, ip, true) == 0)
  1592. {
  1593. new status, name[64], quantity, delivered, product_id;
  1594. for(new i;i<rows;i++)
  1595. {
  1596. cache_get_value_name_int(i, "order_status_id", status);
  1597. if(status == 2)
  1598. {
  1599. cache_get_value_name(i, "name", name);
  1600. cache_get_value_name_int(i, "quantity", quantity);
  1601. cache_get_value_name_int(i, "delivered", delivered);
  1602. cache_get_value_name_int(i, "order_product_id", product_id);
  1603. if(quantity-delivered <= 0)
  1604. {
  1605. if(i<rows) format(string, sizeof(string), "%s%s (Delivered)\n", string, name);
  1606. else format(string, sizeof(string), "%s%s (Delivered)", string, name);
  1607. }
  1608. else
  1609. {
  1610. if(i<rows) format(string, sizeof(string), "%s%s (%d)\n", string, name, quantity-delivered);
  1611. else format(string, sizeof(string), "%s%s (%d)", string, name, quantity-delivered);
  1612. }
  1613. }
  1614. else
  1615. {
  1616. new reason[27];
  1617. switch(status)
  1618. {
  1619. case 0: format(reason, sizeof(reason), "{FF0000}No Payment");
  1620. case 1: format(reason, sizeof(reason), "{FF0000}Pending");
  1621. case 3: format(reason, sizeof(reason), "{00FF00}Shipped");
  1622. case 5:
  1623. {
  1624. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "This order has already been delivered", "OK", "");
  1625. return 1;
  1626. }
  1627. case 7: format(reason, sizeof(reason), "{FF0000}Cancelled");
  1628. case 8: format(reason, sizeof(reason), "{FF0000}Denied");
  1629. case 9: format(reason, sizeof(reason), "{FF0000}Cancelled Reversal");
  1630. case 10: format(reason, sizeof(reason), "{FF0000}Failed");
  1631. case 11: format(reason, sizeof(reason), "{00FF00}Refundend");
  1632. case 12: format(reason, sizeof(reason), "{FF0000}Reversed");
  1633. case 13: format(reason, sizeof(reason), "{FF0000}Chargeback");
  1634. default: format(reason, sizeof(reason), "{FF0000}Unknown");
  1635. }
  1636. format(string, sizeof(string), "We are unable to process that order at this time,\nbecause the payment is currently marked as: %s", reason);
  1637. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", string, "OK", "");
  1638. return 1;
  1639. }
  1640. }
  1641. }
  1642. else
  1643. {
  1644. new email[256];
  1645. cache_get_value_name(0, "email", email);
  1646. SetPVarString(index, "ShopEmailVerify", email);
  1647. ShowPlayerDialogEx(index, DIALOG_SHOPORDEREMAIL, DIALOG_STYLE_INPUT, "Shop Order Error", "We were unable to link your order to your IP,\nfor further verification of your identity please input your shop e-mail address:", "Submit", "Cancel");
  1648. return 1;
  1649. }
  1650. ShowPlayerDialogEx(index, DIALOG_SHOPORDER2, DIALOG_STYLE_LIST, "Shop Order List", string, "Select", "Cancel");
  1651. }
  1652. else
  1653. {
  1654. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "Error: No orders were found by that Order ID\nIf you are sure that is the correct Order ID, please try again or input '1' for your order ID.", "OK", "");
  1655. }
  1656. }
  1657. return 1;
  1658. }
  1659. forward OnShopOrderEmailVer(index);
  1660. public OnShopOrderEmailVer(index)
  1661. {
  1662. if(IsPlayerConnected(index))
  1663. {
  1664. HideNoticeGUIFrame(index);
  1665. new rows;
  1666. cache_get_row_count(rows);
  1667. if(rows > 0)
  1668. {
  1669. new string[512];
  1670. new status, name[64], quantity, delivered, product_id;
  1671. for(new i; i < rows; i++)
  1672. {
  1673. cache_get_value_name_int(i, "order_status_id", status);
  1674. if(status == 2)
  1675. {
  1676. cache_get_value_name(i, "name", name);
  1677. cache_get_value_name_int(i, "quantity", quantity);
  1678. cache_get_value_name_int(i, "delivered", delivered);
  1679. cache_get_value_name_int(i, "order_product_id", product_id);
  1680. if(quantity-delivered <= 0)
  1681. {
  1682. if(i<rows) format(string, sizeof(string), "%s%s (Delivered)\n", string, name);
  1683. else format(string, sizeof(string), "%s%s (Delivered)", string, name);
  1684. }
  1685. else
  1686. {
  1687. if(i<rows) format(string, sizeof(string), "%s%s (%d)\n", string, name, quantity-delivered);
  1688. else format(string, sizeof(string), "%s%s (%d)", string, name, quantity-delivered);
  1689. }
  1690. }
  1691. else
  1692. {
  1693. new reason[27];
  1694. switch(status)
  1695. {
  1696. case 0: format(reason, sizeof(reason), "{FF0000}No Payment");
  1697. case 1: format(reason, sizeof(reason), "{FF0000}Pending");
  1698. case 3: format(reason, sizeof(reason), "{00FF00}Shipped");
  1699. case 5:
  1700. {
  1701. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "This order has already been delivered", "OK", "");
  1702. return 1;
  1703. }
  1704. case 7: format(reason, sizeof(reason), "{FF0000}Cancelled");
  1705. case 8: format(reason, sizeof(reason), "{FF0000}Denied");
  1706. case 9: format(reason, sizeof(reason), "{FF0000}Cancelled Reversal");
  1707. case 10: format(reason, sizeof(reason), "{FF0000}Failed");
  1708. case 11: format(reason, sizeof(reason), "{00FF00}Refundend");
  1709. case 12: format(reason, sizeof(reason), "{FF0000}Reversed");
  1710. case 13: format(reason, sizeof(reason), "{FF0000}Chargeback");
  1711. default: format(reason, sizeof(reason), "{FF0000}Unknown");
  1712. }
  1713. format(string, sizeof(string), "We are unable to process that order at this time,\nbecause the payment is currently marked as: %s", reason);
  1714. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", string, "OK", "");
  1715. return 1;
  1716. }
  1717. }
  1718. ShowPlayerDialogEx(index, DIALOG_SHOPORDER2, DIALOG_STYLE_LIST, "Shop Order List", string, "Select", "Cancel");
  1719. }
  1720. else
  1721. {
  1722. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "Error: No orders were found by that Order ID\nIf you are sure that is the correct Order ID, please try again or input '1' for your order ID.", "OK", "");
  1723. }
  1724. }
  1725. return 1;
  1726. }
  1727. forward OnShopOrder2(index, extraid);
  1728. public OnShopOrder2(index, extraid)
  1729. {
  1730. if(IsPlayerConnected(index))
  1731. {
  1732. HideNoticeGUIFrame(index);
  1733. new string[256];
  1734. new rows;
  1735. cache_get_row_count(rows);
  1736. if(rows > 0)
  1737. {
  1738. for(new i; i < rows; i++)
  1739. {
  1740. if(i == extraid)
  1741. {
  1742. new status;
  1743. cache_get_value_name_int(i, "status", status);
  1744. if(status == 2)
  1745. {
  1746. new order_id, order_product_id, product_id, name[64], price, user[32], quantity, delivered;
  1747. cache_get_value_name_int(i, "order_id", order_id);
  1748. cache_get_value_name_int(i, "order_product_id", order_product_id);
  1749. cache_get_value_name_int(i, "product_id", product_id);
  1750. cache_get_value_name(i, "name", name);
  1751. cache_get_value_name_int(i, "price", price);
  1752. cache_get_value_name(i, "deliveruser", user);
  1753. cache_get_value_name_int(i, "quantity", quantity);
  1754. cache_get_value_name_int(i, "delivered", delivered);
  1755. format(string, sizeof(string), "Order ID: %d\nProduct ID: %d\nProduct: %s\nPrice: %s\nName: %s\nQuantity: %d", \
  1756. order_id, order_product_id, name, price, user, quantity-delivered);
  1757. SetPVarInt(index, "DShop_order_id", order_id);
  1758. SetPVarInt(index, "DShop_product_id", product_id);
  1759. SetPVarString(index, "DShop_name", name);
  1760. SetPVarInt(index, "DShop_quantity", quantity-delivered);
  1761. ShowPlayerDialogEx(index, DIALOG_SHOPDELIVER, DIALOG_STYLE_LIST, "Shop Order Info", string, "Deliver", "Cancel");
  1762. return 1;
  1763. }
  1764. else
  1765. {
  1766. new reason[27];
  1767. switch(status)
  1768. {
  1769. case 0: format(reason, sizeof(reason), "{FF0000}No Payment");
  1770. case 1: format(reason, sizeof(reason), "{FF0000}Pending");
  1771. case 3: format(reason, sizeof(reason), "{00FF00}Shipped");
  1772. case 5:
  1773. {
  1774. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "This order has already been delivered", "OK", "");
  1775. return 1;
  1776. }
  1777. case 7: format(reason, sizeof(reason), "{FF0000}Cancelled");
  1778. case 8: format(reason, sizeof(reason), "{FF0000}Denied");
  1779. case 9: format(reason, sizeof(reason), "{FF0000}Cancelled Reversal");
  1780. case 10: format(reason, sizeof(reason), "{FF0000}Failed");
  1781. case 11: format(reason, sizeof(reason), "{00FF00}Refundend");
  1782. case 12: format(reason, sizeof(reason), "{FF0000}Reversed");
  1783. case 13: format(reason, sizeof(reason), "{FF0000}Chargeback");
  1784. default: format(reason, sizeof(reason), "{FF0000}Unknown");
  1785. }
  1786. format(string, sizeof(string), "We are unable to process that order at this time,\nbecause the payment is currently marked as: %s", reason);
  1787. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", string, "OK", "");
  1788. return 1;
  1789. }
  1790. }
  1791. }
  1792. }
  1793. else
  1794. {
  1795. ShowPlayerDialogEx(index, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "Error: No orders were found by that Order ID\nIf you are sure that is the correct Order ID, please try again or input '1' for your order ID.", "OK", "");
  1796. }
  1797. }
  1798. return 1;
  1799. }
  1800. forward OnProcessOrderCheck(index, extraid);
  1801. public OnProcessOrderCheck(index, extraid)
  1802. {
  1803. if(IsPlayerConnected(index))
  1804. {
  1805. new string[256],playerip[32], giveplayerip[32];
  1806. GetPlayerIp(index, playerip, sizeof(playerip));
  1807. GetPlayerIp(extraid, giveplayerip, sizeof(giveplayerip));
  1808. new rows;
  1809. cache_get_row_count(rows);
  1810. if(rows)
  1811. {
  1812. SendClientMessageEx(index, COLOR_WHITE, "This order has previously been processed, therefore it did not count toward your pay.");
  1813. format(string, sizeof(string), "%s(IP: %s) has processed shop order ID %d from %s(IP: %s).", GetPlayerNameEx(index), playerip, GetPVarInt(index, "processorder"), GetPlayerNameEx(extraid), giveplayerip);
  1814. Log("logs/shoporders.log", string);
  1815. }
  1816. else
  1817. {
  1818. format(string, sizeof(string), "%s(IP: %s) has processed shop order ID %d from %s(IP: %s).", GetPlayerNameEx(index), playerip, GetPVarInt(index, "processorder"), GetPlayerNameEx(extraid), giveplayerip);
  1819. Log("logs/shopconfirmedorders.log", string);
  1820. PlayerInfo[index][pShopTechOrders]++;
  1821. mysql_format(MainPipeline, string, sizeof(string), "INSERT INTO shoptech (id,total,dtotal) VALUES (%d,1,%f) ON DUPLICATE KEY UPDATE total = total + 1, dtotal = dtotal + %f", GetPlayerSQLId(index), ShopTechPay, ShopTechPay);
  1822. mysql_tquery(MainPipeline, string, "OnQueryFinish", "ii", SENDDATA_THREAD, index);
  1823. mysql_format(MainPipeline, string, sizeof(string), "INSERT INTO `orders` (`id`) VALUES ('%d')", GetPVarInt(index, "processorder"));
  1824. mysql_tquery(MainPipeline, string, "OnQueryFinish", "ii", SENDDATA_THREAD, index);
  1825. /*format(string, sizeof(string), "INSERT INTO betazorder_history (`order_id`, `order_status_id`, `comment`, `date_added`, `notify`) \
  1826. VALUES ('%d', '5', 'Order Processed (%s) (Status: Complete)', NOW(), '1')", GetPVarInt(index, "processorder"), GetPlayerNameEx(index));
  1827. mysql_tquery(ShopPipeline, string, false, "OnQueryFinish", "ii", SENDDATA_THREAD, index);
  1828. format(string, sizeof(string), "UPDATE betazorder SET `order_status_id` = '5' WHERE `order_id` = '%d'", GetPVarInt(index, "processorder"));
  1829. mysql_tquery(ShopPipeline, string, false, "OnQueryFinish", "ii", SENDDATA_THREAD, index);*/
  1830. }
  1831. DeletePVar(index, "processorder");
  1832. }
  1833. return 1;
  1834. }