KaLu17

RolePlay, 2012 / 13.

Jan 12th, 2014
1,498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 456.55 KB | None | 0 0
  1. /*
  2.  
  3. KaLu (c) 2012 / 2013
  4.  
  5. */
  6. #include    <a_samp>
  7. #include    <zcmd>
  8. #include    <DOF2>
  9. #include    <streamer>
  10. #include    <a_mysql>
  11. #include    <md5>
  12. #include    <sscanf2>
  13. #include    <foreach>
  14. #include    <CTime>
  15. #include    <a_npc>
  16.  
  17. #define SAVE_PLAYER_BASIC       1
  18. #define SAVE_PLAYER_POS         2
  19. #define SAVE_PLAYER_CASH        4
  20. #define SAVE_PLAYER_ORG         8
  21. #define SAVE_PLAYER_GROUP       16
  22. #define SAVE_PLAYER_SKILLS      32
  23.  
  24. #define GLOBAL_BLOCK_RUN        1
  25. #define GLOBAL_BLOCK_VEH        2
  26. #define GLOBAL_BLOCK_GUN        4
  27. #define GLOBAL_BLOCK_OOC        8
  28.  
  29. #define TEAM_DEFAULT            1
  30. #define DAY_SECOND              86400
  31. #define INVALID_WEAPON_DATA     -1
  32.  
  33. #define SERVICE_PREMIUM_1       10
  34. #define SERVICE_PREMIUM_2       19
  35. #define SERVICE_PREMIUM_3       27
  36. #define SERVICE_PREMIUM_4       4
  37. #define SERVICE_PREMIUM_5       7
  38. #define SERVICE_PREMIUM_6       5
  39. #define SERVICE_PREMIUM_7       10
  40. #define SERVICE_PREMIUM_8       8
  41. #define SERVICE_PREMIUM_9       10
  42. #define SERVICE_PREMIUM_10      8
  43. #define SERVICE_PREMIUM_11      4
  44. #define SERVICE_PREMIUM_11      4
  45. #define SERVICE_PREMIUM_12      0
  46.  
  47.  
  48. #define SERVICE_B_PREMIUM_1     1       //Konto premium 7 dni
  49. #define SERVICE_B_PREMIUM_2     2       //Konto premium 14 dni
  50. #define SERVICE_B_PREMIUM_3     4       //Konto premium 31 dni
  51. #define SERVICE_B_PREMIUM_4     8       //Dowolny przedmiot SMS
  52. #define SERVICE_B_PREMIUM_5     16      //Blokada postaci
  53. #define SERVICE_B_PREMIUM_6     32      //Edycja kodu CSS / HTML
  54. #define SERVICE_B_PREMIUM_7     64      //Nowa grupa
  55. #define SERVICE_B_PREMIUM_8     128     //10 etykiet
  56. #define SERVICE_B_PREMIUM_9     256     //Zmiana tożsamości
  57. #define SERVICE_B_PREMIUM_10    512     //Usunięcie postaci
  58. #define SERVICE_B_PREMIUM_11    1024    //Własny interior
  59. #define SERVICE_B_PREMIUM_12    2048    //Pakiet obiektów
  60.  
  61. main()
  62. {
  63.     print("RolePlay, 2012 / 13");
  64. }
  65. //Definicje Harvest
  66. #define chrtolower(%1) \
  67.         (((%1) > 0x40 && (%1) <= 0x5A) ? ((%1) | 0x20) : (%1))
  68.  
  69. #define chrtoupper(%1) \
  70.         (((%1) > 0x60 && (%1) <= 0x7A) ? ((%1) ^ 0x20) : (%1))
  71.  
  72. #if !defined IsNull
  73.     #define IsNull(%1) \
  74.                 ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  75. #endif
  76.  
  77. #define COLOR_PURPLE            0xC2A2DAFF
  78. #define COLOR_PURPLE2           0xE0EA64FF
  79. #define COLOR_DESC              0xC2A2DAFF
  80. #define COLOR_DO                0x9A9CCDFF
  81.  
  82. #define CHAR_SEX_MALE           1
  83. #define CHAR_SEX_FEMALE         2
  84. //koniec definicji Harvest
  85.  
  86. #define OFFER_VEHICLE           1
  87. #define OFFER_DOORS             2
  88. #define OFFER_WELCOME           3
  89. #define OFFER_REPAIR            7
  90. #define OFFER_REGISTER          8
  91. #define OFFER_MONTAGE           9
  92. #define OFFER_RESPRAY           9999
  93.  
  94. #define GAMEMODE_TEXT           "RolePlay ßeta"
  95. #undef  MAX_PLAYERS
  96. #define MAX_PLAYERS             100
  97. #define MAX_DRZWI               200
  98. #define Funkcja::%1(%2)         forward %1(%2);public %1(%2)
  99. /* Makro definicje */
  100. #define Maska(%1)               GetPVarInt(%1, "rpMaska")
  101. #define setMaska(%1,%2)         SetPVarInt(%1, "rpMaska", %2)
  102. #define Status(%1)              GetPVarInt(%1, "rpStatus")
  103. #define setStatus(%1,%2)        SetPVarInt(%1, "rpStatus", %2)
  104. #define Sluzba(%1)              GetPVarInt(%1, "rpDuty")
  105. #define setSluzba(%1,%2)        SetPVarInt(%1, "rpDuty", %2)
  106. #define Rekawice(%1)            GetPVarInt(%1, "rpRekawice");
  107. #define setRekawice(%1,%2)      SetPVarInt(%1, "rpRekawice", %2)
  108. #define Login(%1)               GetPVarInt(%1, "rpLogin")
  109. #define setLogin(%1,%2)         SetPVarInt(%1, "rpLogin", %2)
  110.  
  111. #define Obiekt(%1)              GetPVarInt(%1, "rpObiekt")
  112. #define setObiekt(%1,%2)        SetPVarInt(%1, "rpObiekt", %2)
  113.  
  114.  
  115. #define SQL_HOST                "localhost"
  116. #define SQL_USER                "root"
  117. #define SQL_DB                  "kalu"
  118. #define SQL_PASS                ""
  119.  
  120. #define DIALOG_ID               1
  121. #define tablename1              "1postacie"
  122. #define guidname1               "member_id"
  123. #define name1                   "nick"
  124. #define player_uid1             "owneruid"
  125.  
  126. #define Dialog(%1)              GetPVarInt(%1, "Dialog")
  127. #define setDialog(%1,%2)        SetPVarInt(%1, "Dialog", %2)
  128. #define ServName                "{AAC5E3}SA:MP RolePlay {B3D341}»{AAC5E3} "
  129. #define Info(%1,%2)             dShowPlayerDialog(%1, 9999, DIALOG_STYLE_MSGBOX, "{AAC5E3}SA:MP RolePlay {B3D341}»{AAC5E3} Informacja", %2, "Rozumiem", "")
  130. #undef  MAX_PLAYERS
  131. #define MAX_PLAYERS             100
  132. #define MAX_TEXTDRAW            25
  133. #define MAX_OBIEKT              5000
  134. #define KOL_NAME                0xFFFFFFBB
  135. #define KOL_DAMAGE              0xFF0000BB
  136. #define KOL_HEALTHUPDATE        0x368A1EBB
  137. #define KOL_ME                  0x9378abFF
  138. #define KOL_DO                  0x999cccFF
  139. #define COLOR_FADE1             0xE6E6E6E6
  140. #define COLOR_FADE2             0xC8C8C8C8
  141. #define COLOR_FADE3             0xAAAAAAAA
  142. #define COLOR_FADE4             0x8C8C8C8C
  143. #define COLOR_FADE5             0x6E6E6E6E
  144. #define MAX_IP_SIZE             17
  145. #define MAX_ITEM                10000
  146. #define MAX_POJAZDY             5000
  147.  
  148. #define DIALOG_ITEM_EDIT        5
  149. //sloty doczepianych obiektów
  150. #define ATTACH_SLOT_1           1//broń
  151. #define ATTACH_SLOT_2           2
  152. #define ATTACH_SLOT_3           3
  153. #define ATTACH_SLOT_4           4
  154. #define ATTACH_SLOT_5           5
  155. //
  156.  
  157. #define OWNER_PLAYER            1
  158. #define OWNER_GROUP             2
  159. #define OWNER_NONE              3
  160. #define OWNER_VEHICLE           4
  161.  
  162. #define EDIT_ITEM               "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie\n6\tUsuń przedmiot\n7\tEdytuj wagę przedmiotu\n8\tOflaguj przedmiot dla grupy"
  163.  
  164. #define KILL_LIMIT              4 //Limit killów na sekunde
  165. #define MAX_GRUPY               200
  166.  
  167.  
  168. #define DOOR_OPTIONS            "1\tPokaż informacje o drzwiach\n2\tZmień nazwę wyświetlaną\n3\tPrzepisz drzwi\n4\tZmień pozycję wewnętrzną\n5\tUkryj pickup\n6\tZajrzyj do schowka\n7\tSkasuj interior"
  169.  
  170. //definicje ustawień
  171.  
  172. new Random_Skin_Male[][1] = {
  173. {1},
  174. {2},
  175. {3},
  176. {4},
  177. {6},
  178. {7},
  179. {14},
  180. {15},
  181. {17},
  182. {18},
  183. {19},
  184. {20},
  185. {21},
  186. {23},
  187. {26},
  188. {29},
  189. {30},
  190. {32},
  191. {35},
  192. {37},
  193. {43},
  194. {44},
  195. {46},
  196. {47},
  197. {58},
  198. {59},
  199. {66},
  200. {67},
  201. {72},
  202. {73},
  203. {98},
  204. {147},
  205. {156},
  206. {177}
  207. };
  208.  
  209. new Random_Skin_Female[][1] = {
  210. {9},
  211. {11},
  212. {12},
  213. {31}
  214. };
  215.  
  216. new StatsObj, StatsDoor, StatsGroup, StatsItem, StatsVeh, StatsZone;
  217.  
  218. new Float:VehicleLastPos[MAX_VEHICLES][4];
  219.  
  220. new Serwer[2], restart = 0, Statystyki[5];
  221.  
  222. /* Statystyki
  223. 0   Logowania
  224. 1   Gracze
  225. 2   Komendy
  226. 3   Kary
  227. 4   Online
  228. */
  229.  
  230. //itemy
  231.  
  232. new Text:ItemTD0[MAX_PLAYERS],
  233. Text:ItemTD1[MAX_PLAYERS],
  234. Text:ItemTD2[MAX_PLAYERS],
  235. Text:ItemTD3[MAX_PLAYERS],
  236. Text:ItemTD4[MAX_PLAYERS],
  237. Text:ItemTD5[MAX_PLAYERS],
  238. Text:ItemTD6[MAX_PLAYERS],
  239. Text:ItemTD7[MAX_PLAYERS],
  240. Text:ItemTD8[MAX_PLAYERS],
  241. Text:ItemTD9[MAX_PLAYERS],
  242. Text:ItemTD10[MAX_PLAYERS];
  243.  
  244. //
  245.  
  246. new Text:ImagenGift;
  247. new ImagesGift[][] = { "LOADSUK:loadsc1","LOADSUK:loadsc2","LOADSUK:loadsc3","LOADSUK:loadsc4","LOADSUK:loadsc5","LOADSUK:loadsc6","LOADSUK:loadsc7","LOADSUK:loadsc8","LOADSUK:loadsc9","LOADSUK:loadsc10","LOADSUK:loadsc11","LOADSUK:loadsc12","LOADSUK:loadsc13","LOADSUK:loadsc14" };
  248. new Text:Licznik0[MAX_PLAYERS], Text:Licznik1[MAX_PLAYERS], Text:Licznik2[MAX_PLAYERS], Text:Licznik3[MAX_PLAYERS];
  249. /*
  250. Typy przedmiotów:
  251.  
  252. 1 - Broń
  253. 2 - Ubranie
  254. 3 - Żywność
  255. 4 - Brak typu
  256. 5 - Komponenty zewnętrzne  - tuning
  257. 6 - Narkotyki
  258. 7 - Rękawiczki
  259. 8 - Maska
  260. 9 - Medykamenty
  261. 10 - Megafon
  262. 11 - Kajdanki
  263. 12 - Części / Akcesoria dające pojazdom HP
  264. 13 - Amunicja
  265. 14 - Torby / Plecaki - od wagi
  266. 15 - Ciało
  267. 16 - Telefon komórkowy
  268. 17 - torba prawdziwa
  269. 18 - klucze do pojazdu (wartość1 - UID, wartosc2 - 0)
  270. 19 - Wędka
  271. 20 - weksel na pojfazd
  272. 21 - Discman
  273. 22 - Teczka
  274. 23 - Plecak
  275. 24 - Kanister
  276. 25 - Gotówka
  277.  
  278. Typy ownerów (Przedmiot):
  279. 1 - postać
  280. 2 - pojazd
  281. 3 - grupa
  282. 4 - paczka
  283. 5 - torba
  284. 6 - karton
  285. 7 - nikt
  286. 8 - komponent
  287.  
  288. Typy ownerów (Drzwi):
  289. 1 - gracz
  290. 2 - grupa
  291. 3 - nikt
  292.  
  293. Typy drzwi
  294.  
  295. 1 - dom
  296. 2- biznes
  297.  
  298. Typy ownerów (Pojazd):
  299. 1 - gracz
  300. 2 - grupa
  301. 3 - praca
  302.  
  303. Typy grup:
  304. 0 - brak
  305. 1 - LSPD
  306. 2 - Hospital
  307. 3 - Rząd
  308. 4 - San News
  309. 5 - Warsztat / Stacja paliw
  310. 6 - Siłownia
  311. 7 - Sklep 24/7
  312. 8 - Firma kurierska
  313. 9 - Binco
  314. 10 - (Przestępcza) Gang
  315. 11 - (Przestępcza) Mafia
  316. 12 - (Przestępcza) Szajka
  317.  
  318. Spawny (gracz)
  319. 0 - główny
  320. 1 - drzwi mieszkalne
  321. 2 - hotel
  322. */
  323.  
  324. enum Globalne
  325. {
  326.      ipb_ZoneShow, ipb_Grupa, ipb_GameScore, ipb_Premium, ipb_NoRUN, ipb_NoVEH, ipb_NoOOC, ipb_NoGUN, ipb_Ban, ipb_BanTime, ipb_Obiekty, ipb_PremiumScore, ipb_PremiumService, ipb_Object, ipb_3DText
  327. };
  328.  
  329. new Text3D:Veh3DText[MAX_VEHICLES];
  330.  
  331. //Strefy
  332. enum sGangZones
  333. {
  334.     gAktywna, Float:gMinX, Float:gMinY, Float:gMaxX, Float:gMaxY,
  335.     gColor, gOwner, gOwnerUID, gNazwa[64], gSpeed
  336. };
  337.  
  338. new GangZoneInfo[MAX_GANG_ZONES][sGangZones], GangZone[MAX_GANG_ZONES];
  339.  
  340. //Koniec stref
  341. enum zPlayer
  342. {
  343.     pLastSkin, pDutyAll, pAchiv1, pAchiv2, pAchiv3, pSesja, pIP[MAX_IP_SIZE], pUID, pNick[256], pKonto, pAdmin, pOnline, pSkin, pFirstSkin, pGID, pInGame, pInGameOd, pMiasto[64], pStrefa, pGodziny, pLastLogin,
  344.     pMayor, pName[64], pSalt[64], pPayDayGame, pAJ, pJail, pRadio, pBW, Float:pHP, pKasa, pDlug, pBank, pSex, pWiek, pSila, pSpawn, pSpawnID, pSpawnTyp, Float:pPosX, Float:pPosY, Float:pPosZ, pInt, pVir, pInvisible, pTelefon, pQuit, pQuitTime, pJob, Float:pWyjezdzone,
  345.     Text3D:pNickName, Text3D:pOpis, Text3D:pAme, pPakiet, pLastDay, pNameNick[32], pHistoryList[32], pDescList[32], pControl
  346. };
  347.  
  348. enum eObject
  349. {
  350.     /*
  351.     Typ 0 - Obiekt
  352.     Typ 1 - Brama
  353.     */
  354.     oAktywny, oModel, oVir, oTyp, Float:oPosX, Float:oPosY, Float:oPosZ, Float:oRotX, Float:oRotY, Float:oRotZ,
  355.     oMatIndex, oMatModel, oMatTxdname[64], oMatTexture[64], oGateStatus, oGate, Float:oGateX, Float:oGateY, Float:oGateZ, Float:oGateRotX , Float:oGateRotY, Float:oGateRotZ
  356. };
  357.  
  358. enum ePrzedmiot
  359. {
  360.     iAktywny, iNazwa[64], iWartosc1, iWartosc2, iWartosc3, iTyp, iOwner, iOwnerUID, iUsed, Float:iPosX, Float:iPosY, Float:iPosZ, iVir, iWaga, Float:iRotX, iFlaga, iFlagaUID, iPremiumPrice, iPrice, iMagazyn
  361. };
  362.  
  363.  
  364. enum eDrzwi
  365. {
  366.     dAktywne, dOwner, dOwnerUID, dWewVir, dZewVir, dPickup, dObiekty, dNazwa[64],
  367.     Float:dWewPosX, Float:dWewPosY, Float:dWewPosZ, Float:dZewPosX, Float:dZewPosY, Float:dZewPosZ, dStatus, dIntWew, dIntZew,
  368.     dCreateTime, dCreatePrice, Float:dZewRot, Float:dWewRot
  369. };
  370.  
  371. enum DeathEnum
  372. {
  373.         time0,
  374.         killed
  375. };
  376. new DeathInfo[MAX_PLAYERS][DeathEnum];
  377.  
  378. enum eGrupa
  379. {
  380.     gAktywna, gOwner, gPunkty, gPayDay, gTyp, gNazwa[64], gTag[64], gBank, gWirCash, gKolor, gKolorZone, gVehLimit, gVehLimitSpawn, gFlagPerm
  381.  
  382. };
  383.  
  384. //strefy
  385.  
  386. //
  387.  
  388. enum iPack
  389. {
  390.     pAktywna, pTyp, pValue1, pValue2, pValue3, pPrice, pWaga, pIlosc, pNazwa[64], pOwner, pOwnerUID, pDoor, pFlaga, pFlagaUID, pDostarcza
  391. };
  392.  
  393. new Paczka[MAX_ITEM][iPack];
  394.  
  395. enum eCars
  396. {
  397.     vAktywny, vModel, vOwner, vOwnerUID, vKolor1, vKolor2, Float:vPrzebieg, Float:vHP, Float:vPosX, Float:vPosY, Float:vPosZ, Float:vRot, vVir, vReje, vSpawn, vPanels, vDoors, vLights, vTires, vPaliwoTyp, Float:vPaliwo, Float:vPaliwoMax, vBlokada, vBlokadaText[64]
  398. };
  399.  
  400. enum sOffer
  401. {
  402.     oCustomerID,
  403.     oType,
  404.     oValue1,
  405.     oValue2,
  406.     oValue3,
  407.     oItemUID,
  408.     oControlUID,
  409.     oGroupUID,
  410.     oPrice,
  411.     oBlock
  412. }
  413.  
  414. new Offer[MAX_PLAYERS][sOffer];
  415.  
  416. new Pojazd[MAX_POJAZDY][eCars], PojazdModel[MAX_VEHICLES], PojazdUID[MAX_VEHICLES], engine, lights, alarm, doors, bonnet, boot, objective;
  417.  
  418. new pGrupa[MAX_PLAYERS][6], pGrupaPayDay[MAX_PLAYERS][6], pGrupaPerm[MAX_PLAYERS][6];
  419.  
  420. new IPB[MAX_PLAYERS][Globalne], Player[MAX_PLAYERS][zPlayer],Obiekt[MAX_OBIEKT][eObject], LogData[50], LogStr[256], Dzien, Miesiac, Rok,
  421. globaluid[MAX_PLAYERS], playeruid[MAX_PLAYERS], String[250], MapObiekt[MAX_OBIEKT], Text:Doors[MAX_PLAYERS], Text:Informacja[MAX_PLAYERS],
  422. InfoWyswietla[MAX_PLAYERS], DrzwiTimer[MAX_PLAYERS], ItemObiekt[MAX_ITEM], Text:Tiper[MAX_PLAYERS], Przedmiot[MAX_ITEM][ePrzedmiot], Drzwi[MAX_DRZWI][eDrzwi], DrzwiPickup[MAX_DRZWI], Text:TDKara, bool:NapisUzywany, NapisTimer, ListItemTD[MAX_PLAYERS][100], ListItem[MAX_PLAYERS][MAX_ITEM / 50],
  423. Float:dHP[MAX_PLAYERS], Text:PasekSanNews[MAX_PLAYERS], Text:TDData, Grupa[MAX_GRUPY][eGrupa], Text:TDOffe[MAX_PLAYERS];
  424.  
  425. new ItemTyp[24][32]={
  426.     "Broń", "Ubranie", "Żywność", "Brak typu", "Komponenty tuningowe", "Narkotyki", "Rękawiczki", "Maska", "Medykamenty", "Megafon", "Kajdanki", "Części pojazdów (HP)", "Amunicja", "Torby", "Ciało",
  427.     "Telefon komórkowy", "Klucze do pojazdu", "Wędka", "Weksel na pojazd", "Discman", "Teczka", "Plecak", "Kanister", "Gotówka"
  428. };
  429.  
  430.  
  431. new VehTune[MAX_POJAZDY][14];
  432.  
  433. new nazwypojazdow[212][32]=
  434. {
  435.     "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana",
  436.     "Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat",
  437.     "Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks",
  438.     "Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral",
  439.     "Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy",
  440.     "Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Harley","RC Baron","RC Raider","Glendale","Oceanic",
  441.     "Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR 350","Walton","Regina",
  442.     "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher",
  443.     "Virgo","Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
  444.     "RC Goblin","Hotring Racer","Hotring Racer","Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike",
  445.     "Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic","Buccaneer","Shamal","Hydra",
  446.     "FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck","Willard","Forklift","Traktor",
  447.     "Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler",
  448.     "Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor",
  449.     "Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna",
  450.     "Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley",
  451.     "Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer","Trailer",
  452.     "Andromeda","Dodo","RC Cam","Launch","LS Police-Car","SF Police-Car","LV Police-Car","Police Rancher","Picador","SWAT Van",
  453.     "Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  454. };
  455.  
  456. new Float:IntArray[146][4] = {
  457. {2003.12,1015.19,33.01,351.58},
  458. {770.8,-0.7,1000.73,22.86},
  459. {974.02,-9.59,1001.15,22.6},
  460. {961.93,-51.91,1001.12,95.54},
  461. {830.6,5.94,1004.18,125.81},
  462. {1037.83,0.4,1001.28,353.93},
  463. {1212.15,-28.54,1000.95,170.57},
  464. {1290.41,1.95,1001.02,179.94},
  465. {1412.15,-2.28,1000.92,114.66},
  466. {1527.05,-12.02,1002.1,350.0},
  467. {1523.51,-47.82,1002.27,262.7},
  468. {612.22,-123.9,997.99,266.57},
  469. {512.93,-11.69,1001.57,198.77},
  470. {418.47,-80.46,1001.8,343.24},
  471. {386.53,173.64,1008.38,63.74},
  472. {288.47,170.06,1007.18,22.05},
  473. {206.46,-137.71,1003.09,10.93},
  474. {-100.27,-22.94,1000.72,17.29},
  475. {-201.22,-43.25,1002.27,45.86},
  476. {-202.94,-6.7,1002.27,204.27},
  477. {-25.72,-187.82,1003.55,5.08},
  478. {454.99,-107.25,999.44,309.02},
  479. {372.56,-131.36,1001.49,354.23},
  480. {378.03,-190.52,1000.63,141.02},
  481. {315.24,-140.89,999.6,7.42},
  482. {225.03,-9.18,1002.22,85.53},
  483. {611.35,-77.56,998.0,320.93},
  484. {246.07,108.97,1003.22,0.29},
  485. {6.09,-28.9,1003.55,5.04},
  486. {773.73,-74.7,1000.65,5.23},
  487. {621.45,-23.73,1000.92,15.68},
  488. {445.6,-6.98,1000.73,172.21},
  489. {285.84,-39.02,1001.52,0.75},
  490. {204.12,-46.8,1001.8,357.58},
  491. {245.23,304.76,999.15,273.44},
  492. {290.62,309.06,999.15,89.92},
  493. {322.5,303.69,999.15,8.17},
  494. {-2041.23,178.4,28.85,156.22},
  495. {-1402.66,106.39,1032.27,105.14},
  496. {-1403.01,-250.45,1043.53,355.86},
  497. {1204.67,-13.54,1000.92,350.02},
  498. {2016.12,1017.15,996.88,88.01},
  499. {-741.85,493.0,1371.98,71.78},
  500. {2447.87,-1704.45,1013.51,314.53},
  501. {2527.02,-1679.21,1015.5,260.97},
  502. {-1129.89,1057.54,1346.41,274.53},
  503. {2496.05,-1695.17,1014.74,179.22},
  504. {366.02,-73.35,1001.51,292.01},
  505. {2233.94,1711.8,1011.63,184.39},
  506. {269.64,305.95,999.15,215.66},
  507. {414.3,-18.8,1001.8,41.43},
  508. {1.19,-3.24,999.43,87.57},
  509. {-30.99,-89.68,1003.55,359.84},
  510. {161.4,-94.24,1001.8,0.79},
  511. {-2638.82,1407.34,906.46,94.68},
  512. {1267.84,-776.96,1091.91,231.34},
  513. {2536.53,-1294.84,1044.13,254.95},
  514. {2350.16,-1181.07,1027.98,99.19},
  515. {-2158.67,642.09,1052.38,86.54},
  516. {419.89,2537.12,10.0,67.65},
  517. {256.9,-41.65,1002.02,85.88},
  518. {204.17,-165.77,1000.52,181.76},
  519. {1133.35,-7.85,1000.68,165.85},
  520. {-1420.43,1616.92,1052.53,159.13},
  521. {493.14,-24.26,1000.68,356.99},
  522. {1727.29,-1642.95,20.23,172.42},
  523. {-202.84,-24.03,1002.27,252.82},
  524. {2233.69,-1112.81,1050.88,8.65},
  525. {1211.25,1049.02,359.94,170.93},
  526. {2319.13,-1023.96,1050.21,167.4},
  527. {2261.1,-1137.88,1050.63,266.88},
  528. {-944.24,1886.15,5.01,179.85},
  529. {-26.19,-140.92,1003.55,2.91},
  530. {2217.28,-1150.53,1025.8,273.73},
  531. {1.55,23.32,1199.59,359.91},
  532. {681.62,-451.89,-25.62,166.17},
  533. {234.61,1187.82,1080.26,349.48},
  534. {225.57,1240.06,1082.14,96.29},
  535. {224.29,1289.19,1082.14,359.87},
  536. {239.28,1114.2,1080.99,270.27},
  537. {207.52,-109.74,1005.13,358.62},
  538. {295.14,1473.37,1080.26,352.95},
  539. {-1417.89,932.45,1041.53,0.7},
  540. {446.32,509.97,1001.42,330.57},
  541. {2306.38,-15.24,26.75,274.49},
  542. {2331.9,6.78,26.5,100.24},
  543. {663.06,-573.63,16.34,264.98},
  544. {-227.57,1401.55,27.77,269.3},
  545. {-688.15,942.08,13.63,177.66},
  546. {-1916.13,714.86,46.56,152.28},
  547. {818.77,-1102.87,25.79,91.14},
  548. {255.21,-59.68,1.57,1.46},
  549. {446.63,1397.74,1084.3,343.96},
  550. {227.39,1114.66,1081.0,267.46},
  551. {227.76,1114.38,1080.99,266.26},
  552. {261.12,1287.22,1080.26,178.91},
  553. {291.76,-80.13,1001.52,290.22},
  554. {449.02,-88.99,999.55,89.66},
  555. {-27.84,-26.67,1003.56,184.31},
  556. {2135.2,-2276.28,20.67,318.59},
  557. {306.2,307.82,1003.3,203.14},
  558. {24.38,1341.18,1084.38,8.33},
  559. {963.06,2159.76,1011.03,175.31},
  560. {2548.48,2823.74,10.82,270.6},
  561. {215.15,1874.06,13.14,177.55},
  562. {221.68,1142.5,1082.61,184.96},
  563. {2323.71,-1147.65,1050.71,206.54},
  564. {345.0,307.18,999.16,193.64},
  565. {411.97,-51.92,1001.9,173.34},
  566. {-1421.56,-663.83,1059.56,170.93},
  567. {773.89,-47.77,1000.59,10.72},
  568. {246.67,65.8,1003.64,7.96},
  569. {-1864.94,55.73,1055.53,85.85},
  570. {-262.18,1456.62,1084.37,82.46},
  571. {22.86,1404.92,1084.43,349.62},
  572. {140.37,1367.88,1083.86,349.24},
  573. {1494.86,1306.48,1093.3,196.07},
  574. {-1813.21,-58.01,1058.96,335.32},
  575. {-1401.07,1265.37,1039.87,178.65},
  576. {234.28,1065.23,1084.21,4.39},
  577. {-68.51,1353.85,1080.21,3.57},
  578. {-2240.1,136.97,1035.41,269.1},
  579. {297.14,-109.87,1001.52,20.23},
  580. {316.5,-167.63,999.59,10.3},
  581. {-285.25,1471.2,1084.38,85.65},
  582. {-26.83,-55.58,1003.55,3.95},
  583. {442.13,-52.48,999.72,177.94},
  584. {2182.2,1628.58,1043.87,224.86},
  585. {748.46,1438.24,1102.95,0.61},
  586. {2807.36,-1171.7,1025.57,193.71},
  587. {366.0,-9.43,1001.85,160.53},
  588. {2216.13,-1076.31,1050.48,86.43},
  589. {2268.52,1647.77,1084.23,99.73},
  590. {2236.7,-1078.95,1049.02,2.57},
  591. {-2031.12,-115.83,1035.17,190.19},
  592. {2365.11,-1133.08,1050.88,177.39},
  593. {1168.51,1360.11,10.93,196.59},
  594. {315.45,976.6,1960.85,359.64},
  595. {1893.07,1017.9,31.88,86.1},
  596. {501.96,-70.56,998.76,171.57},
  597. {-42.53,1408.23,1084.43,172.07},
  598. {2283.31,1139.31,1050.9,19.7},
  599. {84.92,1324.3,1083.86,159.56},
  600. {260.74,1238.23,1084.26,84.31},
  601. {-1658.17,1215.0,7.25,103.91},
  602. {-1961.63,295.24,35.47,264.49}
  603. };
  604.  
  605. new IntArray2[146][1] = {
  606. {11},
  607. {5},
  608. {3},
  609. {3},
  610. {3},
  611. {3},
  612. {3},
  613. {18},
  614. {1},
  615. {3},
  616. {2},
  617. {3},
  618. {3},
  619. {3},
  620. {3},
  621. {3},
  622. {3},
  623. {3},
  624. {3},
  625. {17},
  626. {17},
  627. {5},
  628. {5},
  629. {17},
  630. {7},
  631. {5},
  632. {2},
  633. {10},
  634. {10},
  635. {7},
  636. {1},
  637. {1},
  638. {1},
  639. {1},
  640. {1},
  641. {3},
  642. {5},
  643. {1},
  644. {1},
  645. {7},
  646. {2},
  647. {10},
  648. {1},
  649. {2},
  650. {1},
  651. {10},
  652. {3},
  653. {10},
  654. {1},
  655. {2},
  656. {2},
  657. {2},
  658. {18},
  659. {18},
  660. {3},
  661. {5},
  662. {2},
  663. {5},
  664. {1},
  665. {10},
  666. {14},
  667. {14},
  668. {12},
  669. {14},
  670. {17},
  671. {18},
  672. {16},
  673. {5},
  674. {6},
  675. {9},
  676. {10},
  677. {17},
  678. {16},
  679. {15},
  680. {1},
  681. {1},
  682. {3},
  683. {2},
  684. {1},
  685. {5},
  686. {15},
  687. {15},
  688. {15},
  689. {12},
  690. {0},
  691. {0},
  692. {0},
  693. {18},
  694. {0},
  695. {0},
  696. {0},
  697. {0},
  698. {2},
  699. {5},
  700. {5},
  701. {4},
  702. {4},
  703. {4},
  704. {4},
  705. {0},
  706. {4},
  707. {10},
  708. {1},
  709. {0},
  710. {0},
  711. {4},
  712. {12},
  713. {6},
  714. {12},
  715. {4},
  716. {6},
  717. {6},
  718. {14},
  719. {4},
  720. {5},
  721. {5},
  722. {3},
  723. {14},
  724. {16},
  725. {6},
  726. {6},
  727. {6},
  728. {6},
  729. {6},
  730. {15},
  731. {6},
  732. {6},
  733. {2},
  734. {6},
  735. {8},
  736. {9},
  737. {1},
  738. {1},
  739. {2},
  740. {3},
  741. {8},
  742. {0},
  743. {9},
  744. {10},
  745. {11},
  746. {8},
  747. {11},
  748. {9},
  749. {9},
  750. {0},
  751. {0}
  752. };
  753.  
  754. new IntName[146][] = {
  755. "Four Dragons Managerial Suite",
  756. "Ganton Gym",
  757. "Brothel",
  758. "Brothel2",
  759. "Inside Track Betting",
  760. "Blastin  Fools Records",
  761. "The Big Spread Ranch",
  762. "Warehouse1 ",
  763. "Warehouse2 ",
  764. "B Dup s Apartment",
  765. "B Dup s Crack Palace",
  766. "Wheel Arch Angels",
  767. "OG Loc s House",
  768. "Barber Shop",
  769. "Planning Department",
  770. "Las Venturas Police Department",
  771. "Pro-Laps",
  772. "Sex Shop",
  773. "Las Venturas Tattoo parlor",
  774. "Lost San Fierro Tattoo",
  775. "24/07/09 (version 1)",
  776. "Diner1 ",
  777. "Pizza Stack",
  778. "Rusty Brown s Donuts",
  779. "Ammu-nation",
  780. "Victim",
  781. "Loco Low Co",
  782. "San Fierro Police Department",
  783. "24/07/09 (version 2)",
  784. "Below The Belt Gym",
  785. "Transfenders",
  786. "World of Coq",
  787. "Ammu-nation (version 2)",
  788. "SubUrban",
  789. "Denise s Bedroom",
  790. "Helena s Barn",
  791. "Barbara s Love nest",
  792. "San Fierro Garage",
  793. "Oval Stadium",
  794. "8-Track Stadium",
  795. "The Pig Pen (strip",
  796. "Four Dragons",
  797. "Liberty City",
  798. "Ryder s house",
  799. "Sweet s House",
  800. "RC Battlefield",
  801. "The Johnson House",
  802. "Burger shot",
  803. "Caligula s Casino",
  804. "Katie s Lovenest",
  805. "Barber Shop2 (Reece s)",
  806. "Angel Pine Trailer",
  807. "24/07/09 (version 3)",
  808. "Zip",
  809. "The Pleasure Domes",
  810. "Madd Dogg s Mansion",
  811. "Big Smoke s Crack Palace",
  812. "Burning Desire Building",
  813. "Wu-Zi Mu s",
  814. "Abandoned AC tower",
  815. "Wardrobe/Changing room",
  816. "Didier Sachs",
  817. "Casino (Redsands West)",
  818. "Kickstart Stadium",
  819. "Club",
  820. "Atrium",
  821. "Los Santos Tattoo Parlor",
  822. "Safe House group1 ",
  823. "Safe House group2 ",
  824. "Safe House group3 ",
  825. "Safe House group4 ",
  826. "Sherman Dam",
  827. "24/07/09 (version 4)",
  828. "Jefferson Motel",
  829. "Jet Interior",
  830. "The Welcome Pump",
  831. "Burglary House X1",
  832. "Burglary House X2",
  833. "Burglary House X3",
  834. "Burglary House X4",
  835. "Binco",
  836. "4 Burglary houses",
  837. "Blood Bowl Stadium",
  838. "Budget Inn Motel Room",
  839. "Palamino Bank",
  840. "Palamino Diner",
  841. "Dillimore Gas Station",
  842. "Lil  Probe Inn",
  843. "Torreno s Ranch",
  844. "Zombotech - lobby area",
  845. "Crypt in LS cemetery",
  846. "Blueberry Liquor Store",
  847. "Pair of Burglary Houses",
  848. "Crack Den",
  849. "Burglary House X11",
  850. "Burglary House X12",
  851. "Ammu-nation (version 3)",
  852. "Jay s Diner",
  853. "24/07/09 (version 5)",
  854. "Warehouse3 ",
  855. "Michelle s Love Nest*",
  856. "Burglary House X14",
  857. "Sindacco Abatoir",
  858. "K.A.C.C. Military Fuels Depot",
  859. "Area69 ",
  860. "Burglary House X13",
  861. "Unused Safe House",
  862. "Millie s Bedroom",
  863. "Barber Shop",
  864. "Dirtbike Stadium",
  865. "Cobra Gym",
  866. "Los Santos Police Department",
  867. "Los Santos Airport",
  868. "Burglary House X15",
  869. "Burglary House X16",
  870. "Burglary House X17",
  871. "Bike School",
  872. "Francis International Airport",
  873. "Vice Stadium",
  874. "Burglary House X18",
  875. "Burglary House X19",
  876. "Zero s RC Shop",
  877. "Ammu-nation (version 4)",
  878. "Ammu-nation (version 5)",
  879. "Burglary House X20",
  880. "24/07/09 (version 6)",
  881. "Secret Valley Diner",
  882. "Rosenberg s Office in Caligulas",
  883. "Fanny Batter s Whore House",
  884. "Colonel Furhberger s",
  885. "Cluckin  Bell",
  886. "The Camel s Toe Safehouse",
  887. "Caligula s Roof",
  888. "Old Venturas Strip Casino",
  889. "Driving School",
  890. "Verdant Bluffs Safehouse",
  891. "Bike School",
  892. "Andromada",
  893. "Four Dragons  Janitor s Office",
  894. "Bar",
  895. "Burglary House X21",
  896. "Willowfield Safehouse",
  897. "Burglary House X22",
  898. "Burglary House X23",
  899. "Otto s Autos",
  900. "Wang Cars"
  901. };
  902.  
  903. enum saZone
  904. {
  905.     zID, zOwner, zOwnerUID, zAktywna
  906. };
  907.  
  908. new TypGrupy[26][32]={
  909.     " ", "Nieokreślony", "24/7", "Gastronomia", "Stacja benzynowa", "Siłownia", "Salon samochodowy", "Firma taksówkarska", "Sklep odzieżowy", "Warsztat", "Hotel", "Bank", "Ochrona",
  910.     "Police", "Government", "Medical", "Radio", "Armia", "Fire Department", "FBI", "Mafia", "Gang", "Rodzina", "Zmotoryzowana", "Szkoła jazdy", "Wypożyczalnia pojazdów"
  911. };
  912.  
  913. new KategorieZamowien[26][32] =
  914. {
  915.     " ", "Żywność / Napoje", "Sklep 24/7", "Bronie", "Akcesoria do pojazdów", "Sprzęt gaśniczy", "Akcesoria mafijne", "Używki", "Alkohole", "Sprzęt policyjny", "Sprzęt ochroniarski", "Sprzęd wojskowy", "Sprzęt reporterski",
  916.     "Komponenty: Felgi", "Komponenty: Progi", "Komponenty: Spoilery", "Komponenty: Zderzaki", "Komponenty: Wloty", "Komponenty: Wydechy", "Komponenty: Low-Ridery", "Medykamenty", "Dodatki", "Amunicja", "Części broni", "Sprzęt FBI", "Pojazdy: Standardowe"
  917. };
  918.  
  919. enum sampZamowienia
  920. {
  921.     Produkt_Kategoria, Produkt_Nazwa[64], Produkt_Owner, Produkt_OwnerUID, Produkt_Typ, Produkt_Wartosc1, Produkt_Wartosc2, Produkt_Wartosc3, Produkt_Waga, Produkt_Price,
  922.     Produkt_Flaga, Produkt_FlagaUID
  923. };
  924.  
  925. static const Zamowienia[][sampZamowienia] =
  926. {
  927.     //Produkt_Owner = 1 and Produkt_Owner = typ grupy -> przedmiot dostępny do grupy o danym typie
  928.     //Produkt_Owner = 2 and Produkt_Owner = grupa   -> przedmiot dostępny dla grupy o danym UID
  929.  
  930.     //oflagowanie -1 = dla grup
  931.     //produkt_owneruid = -1 / amunicja dla wybranych typów
  932.  
  933.     //Produkty do zamówień dla sklepów 24/7
  934.     {2,     "Telefon",              1,      2,      18,     1,      1,      1,      200,    75,     0,      0},
  935.     {2,     "Sony A330",            1,      2,      1,      50,     50,     0,      650,    750,    0,      0},
  936.     {1,     "Chipsy",               1,      2,      3,      5,      10,     0,      105,    25,     0,      0},
  937.  
  938.     //Produkty do zamówień dla gastronomii
  939.     {1,     "Hot-Dog",              1,      3,      3,      15,     -1,     -1,     250,    7,      0,      0},
  940.     {1,     "Frytki",               1,      3,      3,      15,     -1,     -1,     250,    6,      0,      0},
  941.     {1,     "Taco",                 1,      3,      3,      15,     -1,     -1,     250,    8,      0,      0},
  942.     {1,     "Hamburger",            1,      3,      3,      20,     -1,     -1,     250,    10,     0,      0},
  943.     {1,     "Pizza L",              1,      3,      3,      30,     -1,     -1,     250,    17,     0,      0},
  944.     {1,     "Pizza XL",             1,      3,      3,      40,     -1,     -1,     250,    23,     0,      0},
  945.     {1,     "Kebab",                1,      3,      3,      20,     -1,     -1,     250,    11,     0,      0},
  946.     {1,     "Zapiekanka",           1,      3,      3,      15,     -1,     -1,     250,    9,      0,      0},
  947.     {1,     "Kebab Rollo",          1,      3,      3,      15,     -1,     -1,     250,    12,     0,      0},
  948.     {1,     "Talarki",              1,      3,      3,      15,     -1,     -1,     250,    9,      0,      0},
  949.     {1,     "Sałatka Grecka",      1,      3,      3,      15,     -1,     -1,     250,    10,     0,      0},
  950.     {1,     "Sałatka Kurczak",         1,      3,      3,      15,     -1,     -1,     250,    11,     0,      0},
  951.     {1,     "Szarlotka",            1,      3,      3,      5,      -1,     -1,     250,    4,      0,      0},
  952.     {1,     "Pączek",              1,      3,      3,      5,      -1,     -1,     250,    4,      0,      0},
  953.     {1,     "Sernik",               1,      3,      3,      5,      -1,     -1,     250,    4,      0,      0},
  954.     {1,     "Ryba w cieście",      1,      3,      3,      25,     -1,     -1,     250,    15,     0,      0},
  955.     {1,     "Ryba wędzona",        1,      3,      3,      25,     -1,     -1,     250,    15,     0,      0},
  956.     {1,     "Kotlet schabowy",      1,      3,      3,      15,     -1,     -1,     250,    10,     0,      0},
  957.     {1,     "Skrzydełka",          1,      3,      3,      15,     -1,     -1,     250,    10,     0,      0},
  958.     {1,     "Coca Cola",            1,      3,      3,      15,     -1,     -1,     250,    10,     0,      0},
  959.     {1,     "Woda Mineralna",       1,      3,      3,      7,      -1,     -1,     250,    5,      0,      0},
  960.     {1,     "Pepsi",                1,      3,      3,      7,      -1,     -1,     250,    5,      0,      0},
  961.     {1,     "Kawa",                 1,      3,      3,      7,      -1,     -1,     250,    5,      0,      0},
  962.     {1,     "Herbata",              1,      3,      3,      7,      -1,     -1,     250,    5,      0,      0},
  963.  
  964.     {8,     "Whiskey",              1,      3,      3,      7,      -1,     -1,     250,    25,     0,      0},
  965.     {8,     "Wódka",               1,      3,      3,      7,      -1,     -1,     250,    17,     0,      0},
  966.     {8,     "Piwo Cytrynowe",       1,      3,      3,      7,      -1,     -1,     250,    9,      0,      0},
  967.     {8,     "Piwo Jabłkowe",       1,      3,      3,      7,      -1,     -1,     250,    9,      0,      0},
  968.     {8,     "Piwo Malinowe",        1,      3,      3,      7,      -1,     -1,     250,    9,      0,      0},
  969.     {8,     "Piwo Zwykłe",             1,      3,      3,      7,      -1,     -1,     250,    9,      0,      0},
  970.  
  971.     //Amunicja dla grup o typie "police"
  972.     {22,    "Amunicja Deagle",      1,      13,     15,     24,     25,     0,      150,    300,    0,      0},
  973.     {22,    "Amunicja Shotgun",     1,      13,     15,     25,     25,     0,      250,    400,    0,      0},
  974.     {22,    "Amunicja Glock",       1,      13,     15,     22,     50,     0,      150,    350,    0,      0},
  975.  
  976.     //amunicja dla grup o typie "Armia"
  977.     {22,    "Amunicja Deagle",      1,      17,     15,     24,     25,     0,      150,    300,    0,      0},
  978.     {22,    "Amunicja Shotgun",     1,      17,     15,     25,     25,     0,      250,    400,    0,      0},
  979.     {22,    "Amunicja Glock",       1,      17,     15,     22,     50,     0,      150,    350,    0,      0},
  980.     {22,    "Amunicja M4A1",        1,      17,     15,     31,     150,     0,     450,    750,    0,      0},
  981.  
  982.     //amunicja dla grup o typie "FBI"
  983.     {22,    "Amunicja Deagle",      1,      19,     15,     24,     25,     0,      150,    300,    0,      0},
  984.     {22,    "Amunicja Shotgun",     1,      19,     15,     25,     25,     0,      250,    400,    0,      0},
  985.     {22,    "Amunicja Glock",       1,      19,     15,     22,     50,     0,      150,    350,    0,      0},
  986.  
  987.     //amunicja dla grup o typie "zmotoryzowana"
  988.     {22,    "Amunicja Deagle",      1,      23,     15,     24,     25,     0,      150,    300,    0,      0},
  989.     {22,    "Amunicja Shotgun",     1,      23,     15,     25,     25,     0,      250,    400,    0,      0},
  990.     {22,    "Amunicja Glock",       1,      23,     15,     22,     50,     0,      150,    350,    0,      0},
  991.  
  992.     //Produkty do zamawiania przez LSPD
  993.     {3,     "(F) Desert Eagle",     2,      1,      1,      24,     20,     0,      950,    1250,   2,      1},
  994.     {3,     "(F) Shotgun",          2,      1,      1,      25,     20,     0,      950,    2250,   2,      1},
  995.     {3,     "(F) Glock",            2,      1,      1,      22,     40,     0,      950,    2250,   2,      1},
  996.     {3,     "(F) Tonfa",            2,      1,      1,      3,      1,      0,      450,    470,    2,      1},
  997.     {3,     "(F) Spadochron",       2,      1,      1,      46,     1,      0,      1500,   950,    2,      1},
  998.     {9,     "Kominiarka",           2,      1,      8,      5,      1,      0,      700,    250,    2,      1},
  999.     {9,     "Rękawiczki",           2,      1,      7,      5,      1,      0,      600,    250,    2,      1}
  1000.  
  1001. };
  1002.  
  1003. new Text:textdrawik;
  1004.  
  1005. #define TIME_BW             10
  1006.  
  1007. //Permy dla pracowników
  1008. #define PERM_OFFER          1       // Oferowanie (/o)
  1009. #define PERM_CARS           2       // Pojazdy
  1010. #define PERM_DOORS          4       // Drzwi
  1011. #define PERM_ORDER          8       // Zamawianie produktów
  1012. #define PERM_CHAT           16      // Korzystanie z czatu OOC
  1013. #define PERM_LEADER         32      // Lider
  1014. #define PERM_MAYOR          64      // Burmistrz / Gubernator
  1015. #define MAX_LEADER_PERM     127     // Maksymalna liczba
  1016.  
  1017. //Permy dla administracji
  1018. #define ADMIN_PERM_GM       1       // Ogólna maska uprawnień dla każdego Administratora
  1019. #define ADMIN_PERM_CHAT     2       // Maska uprawnień dla korzystania z czatu
  1020. #define ADMIN_PERM_VEHICLE  4       // Maska uprawnień do korzystania z komendy /av
  1021. #define ADMIN_PERM_GROUP    8       // Maska uprawnień do korzystania z komendy /ag
  1022. #define ADMIN_PERM_DOOR     16      // Maska uprawnień do korzystania z komendy /ad
  1023. #define ADMIN_PERM_ITEM     32      // Maska uprawnień do korzystania z komendy /ap
  1024. #define ADMIN_PERM_OBJECT   64      // Maska uprawnień do korzystania z systemu obiektów
  1025. #define ADMIN_PERM_ZONE     128
  1026. #define ADMIN_PERM_MAX      255     // Maksymalna liczba
  1027.  
  1028. //Permy dla grup
  1029. #define G_FLAG_IC           1       // Czat InCharacter
  1030. #define G_FLAG_OOC          2       // Czat Out Of Character
  1031. #define G_FLAG_COLOR        4       // Kolorowy nick na służbie
  1032. #define G_FLAG_DEPARTMENT   8       // Tag grupy pod nickiem
  1033. #define G_FLAG_SPAWN        16      // Spawn w budynku organizacji
  1034. #define G_FLAG_ARREST       32      // Aresztowanie / przetrzymywanie
  1035. #define G_FLAG_BLOCADE      64      // Stawianie blokad na drodze
  1036. #define G_FLAG_WEAPONS      128     // Używanie oflagowanych broni
  1037. #define G_FLAG_911          256     // Listowanie na 911
  1038. #define G_FLAG_RACE         512     // Tworzenie wyścigów
  1039. #define G_FLAG_LEAVE        1024    // Opuszczanie grupy
  1040. #define G_FLAG_TAX          2048    // Podatek
  1041. #define G_FLAG_MASK         4096    // Używanie kominiarek
  1042. #define G_FLAG_SEARCHING    8192    // Przeszukiwanie
  1043. #define G_FLAG_DRIVEBY      16384   // DriveBy
  1044.  
  1045. public OnGameModeInit()
  1046. {
  1047.     new tm[4];
  1048.     TimeFormat(3604 * 50, tm[0], tm[1], tm[2], tm[3]);
  1049.     printf("%d dni, %d godzin, %d minut, %d sekund", tm[0], tm[1], tm[2], tm[3]);
  1050.  
  1051.     textdrawik = TextDrawCreate(200.0, 220.0, "ArrowType2:MatArrows");
  1052.     TextDrawSetString(textdrawik, "ArrowType2:MatArrows");
  1053.     TextDrawFont(textdrawik, 4);
  1054.  
  1055.  
  1056.     ImagenGift = TextDrawCreate(-0.500, -0.500,"_");
  1057.     TextDrawFont(ImagenGift, 4);
  1058.     TextDrawTextSize(ImagenGift, 647.500, 457.000);
  1059.     TextDrawColor(ImagenGift, -1);
  1060.  
  1061.     for(new p = 0; p < MAX_PLAYERS; p++)
  1062.     {
  1063.    
  1064.     ItemTD0[p] = TextDrawCreate(18.000000, 133.000000, "~<~ Przedmioty (1) ~>~");
  1065.     TextDrawBackgroundColor(ItemTD0[p], 255);
  1066.     TextDrawFont(ItemTD0[p], 3);
  1067.     TextDrawLetterSize(ItemTD0[p], 0.649999, 1.800000);
  1068.     TextDrawColor(ItemTD0[p], -1);
  1069.     TextDrawSetOutline(ItemTD0[p], 1);
  1070.     TextDrawSetProportional(ItemTD0[p], 1);
  1071.  
  1072.     ItemTD1[p] = TextDrawCreate(42.000000, 158.000000, "01 Desert Eagle");
  1073.     TextDrawBackgroundColor(ItemTD1[p], 255);
  1074.     TextDrawFont(ItemTD1[p], 3);
  1075.     TextDrawLetterSize(ItemTD1[p], 0.290000, 0.899999);
  1076.     TextDrawColor(ItemTD1[p], -1);
  1077.     TextDrawSetOutline(ItemTD1[p], 1);
  1078.     TextDrawSetProportional(ItemTD1[p], 1);
  1079.  
  1080.     ItemTD2[p] = TextDrawCreate(42.000000, 169.000000, "02 ~g~Desert Eagle");
  1081.     TextDrawBackgroundColor(ItemTD2[p], 255);
  1082.     TextDrawFont(ItemTD2[p], 3);
  1083.     TextDrawLetterSize(ItemTD2[p], 0.290000, 0.899999);
  1084.     TextDrawColor(ItemTD2[p], -1);
  1085.     TextDrawSetOutline(ItemTD2[p], 1);
  1086.     TextDrawSetProportional(ItemTD2[p], 1);
  1087.  
  1088.     ItemTD3[p] = TextDrawCreate(42.000000, 180.000000, "03 Joint (1g)");
  1089.     TextDrawBackgroundColor(ItemTD3[p], 255);
  1090.     TextDrawFont(ItemTD3[p], 3);
  1091.     TextDrawLetterSize(ItemTD3[p], 0.290000, 0.899999);
  1092.     TextDrawColor(ItemTD3[p], -1);
  1093.     TextDrawSetOutline(ItemTD3[p], 1);
  1094.     TextDrawSetProportional(ItemTD3[p], 1);
  1095.  
  1096.     ItemTD4[p] = TextDrawCreate(42.000000, 191.000000, "04 Weksel (Walton)");
  1097.     TextDrawBackgroundColor(ItemTD4[p], 255);
  1098.     TextDrawFont(ItemTD4[p], 3);
  1099.     TextDrawLetterSize(ItemTD4[p], 0.290000, 0.899999);
  1100.     TextDrawColor(ItemTD4[p], -1);
  1101.     TextDrawSetOutline(ItemTD4[p], 1);
  1102.     TextDrawSetProportional(ItemTD4[p], 1);
  1103.  
  1104.     ItemTD5[p] = TextDrawCreate(42.000000, 202.000000, "05 Hamburger");
  1105.     TextDrawBackgroundColor(ItemTD5[p], 255);
  1106.     TextDrawFont(ItemTD5[p], 3);
  1107.     TextDrawLetterSize(ItemTD5[p], 0.290000, 0.899999);
  1108.     TextDrawColor(ItemTD5[p], -1);
  1109.     TextDrawSetOutline(ItemTD5[p], 1);
  1110.     TextDrawSetProportional(ItemTD5[p], 1);
  1111.  
  1112.     ItemTD6[p] = TextDrawCreate(42.000000, 213.000000, "06 ~g~Okulary (RED)");
  1113.     TextDrawBackgroundColor(ItemTD6[p], 255);
  1114.     TextDrawFont(ItemTD6[p], 3);
  1115.     TextDrawLetterSize(ItemTD6[p], 0.290000, 0.899999);
  1116.     TextDrawColor(ItemTD6[p], -1);
  1117.     TextDrawSetOutline(ItemTD6[p], 1);
  1118.     TextDrawSetProportional(ItemTD6[p], 1);
  1119.  
  1120.     ItemTD7[p] = TextDrawCreate(42.000000, 224.000000, "07 Glock");
  1121.     TextDrawBackgroundColor(ItemTD7[p], 255);
  1122.     TextDrawFont(ItemTD7[p], 3);
  1123.     TextDrawLetterSize(ItemTD7[p], 0.290000, 0.899999);
  1124.     TextDrawColor(ItemTD7[p], -1);
  1125.     TextDrawSetOutline(ItemTD7[p], 1);
  1126.     TextDrawSetProportional(ItemTD7[p], 1);
  1127.  
  1128.     ItemTD8[p] = TextDrawCreate(42.000000, 235.000000, "08 Dowod osobisty");
  1129.     TextDrawBackgroundColor(ItemTD8[p], 255);
  1130.     TextDrawFont(ItemTD8[p], 3);
  1131.     TextDrawLetterSize(ItemTD8[p], 0.290000, 0.899999);
  1132.     TextDrawColor(ItemTD8[p], -1);
  1133.     TextDrawSetOutline(ItemTD8[p], 1);
  1134.     TextDrawSetProportional(ItemTD8[p], 1);
  1135.  
  1136.     ItemTD9[p] = TextDrawCreate(42.000000, 246.000000, "09 Kajdanki");
  1137.     TextDrawBackgroundColor(ItemTD9[p], 255);
  1138.     TextDrawFont(ItemTD9[p], 3);
  1139.     TextDrawLetterSize(ItemTD9[p], 0.290000, 0.899999);
  1140.     TextDrawColor(ItemTD9[p], -1);
  1141.     TextDrawSetOutline(ItemTD9[p], 1);
  1142.     TextDrawSetProportional(ItemTD9[p], 1);
  1143.  
  1144.     ItemTD10[p] = TextDrawCreate(42.000000, 257.000000, "10 Megafon");
  1145.     TextDrawBackgroundColor(ItemTD10[p], 255);
  1146.     TextDrawFont(ItemTD10[p], 3);
  1147.     TextDrawLetterSize(ItemTD10[p], 0.290000, 0.899999);
  1148.     TextDrawColor(ItemTD10[p], -1);
  1149.     TextDrawSetOutline(ItemTD10[p], 1);
  1150.     TextDrawSetProportional(ItemTD10[p], 1);
  1151. /*
  1152.     Doors[p] = TextDrawCreate(324.000000, 325.000000, "Motel Idlewood~n~~n~~y~Aby wejsc, wcisnij jednoczesnie~n~~w~[~b~~h~~h~LALT + SHIFT~w~]");
  1153.     TextDrawAlignment(Doors[p], 2);
  1154.     TextDrawBackgroundColor(Doors[p], 255);
  1155.     TextDrawFont(Doors[p], 1);
  1156.     TextDrawLetterSize(Doors[p], 0.370000, 1.600000);
  1157.     TextDrawColor(Doors[p], -1);
  1158.     TextDrawSetOutline(Doors[p], 1);
  1159.     TextDrawSetProportional(Doors[p], 1);
  1160.     TextDrawUseBox(Doors[p], 1);
  1161.     TextDrawBoxColor(Doors[p], 50);
  1162.     TextDrawTextSize(Doors[p], 0.000000, 224.000000);
  1163. */
  1164.     Doors[p] = TextDrawCreate(326.000000, 330.000000, "_");
  1165.     TextDrawAlignment(Doors[p], 2);
  1166.     TextDrawBackgroundColor(Doors[p], 255);
  1167.     TextDrawFont(Doors[p], 1);
  1168.     TextDrawLetterSize(Doors[p], 0.379999, 1.299999);
  1169.     TextDrawColor(Doors[p], -1);
  1170.     TextDrawSetOutline(Doors[p], 1);
  1171.     TextDrawSetProportional(Doors[p], 1);
  1172.     TextDrawUseBox(Doors[p], 1);
  1173.     TextDrawBoxColor(Doors[p], 68);
  1174.     TextDrawTextSize(Doors[p], 490.000000, 221.000000);
  1175.  
  1176.     Informacja[p] = TextDrawCreate(324.000000, 325.000000, "_");
  1177.     TextDrawAlignment(Informacja[p], 2);
  1178.     TextDrawBackgroundColor(Informacja[p], 255);
  1179.     TextDrawFont(Informacja[p], 1);
  1180.     TextDrawLetterSize(Informacja[p], 0.300000, 1.299998);
  1181.     TextDrawColor(Informacja[p], -1);
  1182.     TextDrawSetOutline(Informacja[p], 1);
  1183.     TextDrawSetProportional(Informacja[p], 1);
  1184.  
  1185.     Tiper[p] = TextDrawCreate(522.000000, 343.000000, "_");
  1186.     TextDrawAlignment(Tiper[p], 2);
  1187.     TextDrawBackgroundColor(Tiper[p], 255);
  1188.     TextDrawFont(Tiper[p], 1);
  1189.     TextDrawLetterSize(Tiper[p], 0.270000, 1.200000);
  1190.     TextDrawColor(Tiper[p], -1);
  1191.     TextDrawSetOutline(Tiper[p], 0);
  1192.     TextDrawSetProportional(Tiper[p], 1);
  1193.     TextDrawSetShadow(Tiper[p], 1);
  1194.     TextDrawUseBox(Tiper[p], 1);
  1195.     TextDrawBoxColor(Tiper[p], 40);
  1196.     TextDrawTextSize(Tiper[p], 466.000000, 208.000000);
  1197.  
  1198.     Licznik0[p] = TextDrawCreate(552.000000, 105.000000, "_");
  1199.     TextDrawAlignment(Licznik0[p], 2);
  1200.     TextDrawBackgroundColor(Licznik0[p], 255);
  1201.     TextDrawFont(Licznik0[p], 3);
  1202.     TextDrawLetterSize(Licznik0[p], 0.480000, 2.699999);
  1203.     TextDrawColor(Licznik0[p], -1);
  1204.     TextDrawSetOutline(Licznik0[p], 1);
  1205.     TextDrawSetProportional(Licznik0[p], 1);
  1206.     TextDrawUseBox(Licznik0[p], 1);
  1207.     TextDrawBoxColor(Licznik0[p], 40);
  1208.     TextDrawTextSize(Licznik0[p], -4.000000, 107.000000);
  1209.  
  1210.     Licznik3[p] = TextDrawCreate(520.250000, 134.000000, "_");
  1211.     TextDrawAlignment(Licznik3[p], 2);
  1212.     TextDrawBackgroundColor(Licznik3[p], 255);
  1213.     TextDrawFont(Licznik3[p], 3);
  1214.     TextDrawLetterSize(Licznik3[p], 0.420000, 1.400000);
  1215.     TextDrawColor(Licznik3[p], -1);
  1216.     TextDrawSetOutline(Licznik3[p], 1);
  1217.     TextDrawSetProportional(Licznik3[p], 1);
  1218.     TextDrawUseBox(Licznik3[p], 1);
  1219.     TextDrawBoxColor(Licznik3[p], 40);
  1220.     TextDrawTextSize(Licznik3[p], 1.000000, 11.000000);
  1221.  
  1222.     Licznik1[p] = TextDrawCreate(504.000000, 134.000000, "_");
  1223.     TextDrawAlignment(Licznik1[p], 2);
  1224.     TextDrawBackgroundColor(Licznik1[p], 255);
  1225.     TextDrawFont(Licznik1[p], 3);
  1226.     TextDrawLetterSize(Licznik1[p], 0.420000, 1.400000);
  1227.     TextDrawColor(Licznik1[p], -1);
  1228.     TextDrawSetOutline(Licznik1[p], 1);
  1229.     TextDrawSetProportional(Licznik1[p], 1);
  1230.     TextDrawUseBox(Licznik1[p], 1);
  1231.     TextDrawBoxColor(Licznik1[p], 40);
  1232.     TextDrawTextSize(Licznik1[p], 1.000000, 11.000000);
  1233.  
  1234.     Licznik2[p] = TextDrawCreate(568.500000, 134.000000, "_");
  1235.     TextDrawAlignment(Licznik2[p], 2);
  1236.     TextDrawBackgroundColor(Licznik2[p], 255);
  1237.     TextDrawFont(Licznik2[p], 3);
  1238.     TextDrawLetterSize(Licznik2[p], 0.420000, 1.400000);
  1239.     TextDrawColor(Licznik2[p], -1);
  1240.     TextDrawSetOutline(Licznik2[p], 1);
  1241.     TextDrawSetProportional(Licznik2[p], 1);
  1242.     TextDrawUseBox(Licznik2[p], 1);
  1243.     TextDrawBoxColor(Licznik2[p], -8388353);
  1244.     TextDrawTextSize(Licznik2[p], -3.000000, 74.000000);
  1245.  
  1246.     PasekSanNews[p] = TextDrawCreate(1.000000, 433.000000, " ~y~~h~K-69 Radio~w~ ~>~ Aktualnie nic nie jest nadawane na antenie.~n~");
  1247.     TextDrawBackgroundColor(PasekSanNews[p], 255);
  1248.     TextDrawFont(PasekSanNews[p], 1);
  1249.     TextDrawLetterSize(PasekSanNews[p], 0.270000, 1.100000);
  1250.     TextDrawColor(PasekSanNews[p], -1);
  1251.     TextDrawSetOutline(PasekSanNews[p], 0);
  1252.     TextDrawSetProportional(PasekSanNews[p], 1);
  1253.     TextDrawSetShadow(PasekSanNews[p], 1);
  1254.     TextDrawUseBox(PasekSanNews[p], 1);
  1255.     TextDrawBoxColor(PasekSanNews[p], 40);
  1256.     TextDrawTextSize(PasekSanNews[p], 673.000000, 17.000000);
  1257.  
  1258.     TDOffe[p] = TextDrawCreate(138.000000, 417.000000, "_");
  1259.     TextDrawBackgroundColor(TDOffe[p], 255);
  1260.     TextDrawFont(TDOffe[p], 3);
  1261.     TextDrawLetterSize(TDOffe[p], 0.350000, 1.100000);
  1262.     TextDrawColor(TDOffe[p], -1);
  1263.     TextDrawSetOutline(TDOffe[p], 1);
  1264.     TextDrawSetProportional(TDOffe[p], 1);
  1265.  
  1266.     //tworzymy 3dtexty nicku i opisu dla graczy
  1267.     Player[p][pAme]         = CreateDynamic3DTextLabel(" ", COLOR_PURPLE, 0.0, 0.0, 0.3, 10.0, p, INVALID_VEHICLE_ID, 1);
  1268.     Player[p][pOpis]        = CreateDynamic3DTextLabel(" ", COLOR_DESC, 0.0, 0.0, -0.6, 10.0, p, INVALID_VEHICLE_ID, 1);
  1269.     Player[p][pNickName]    = CreateDynamic3DTextLabel(" ", KOL_NAME, 0.0, 0.0, 0.1, 10.0, p, INVALID_VEHICLE_ID, 1);
  1270.  
  1271.     }
  1272.     //tworzymy 3dtexty dla pojazdów
  1273.     for(new v = 0; v < MAX_VEHICLES; v++)
  1274.     {
  1275.         Veh3DText[v]        = CreateDynamic3DTextLabel(" ", COLOR_DESC, 0.0, 0.0, 1.0, 10.0, INVALID_PLAYER_ID, v, 1);
  1276.     }
  1277.  
  1278.     TDData = TextDrawCreate(492.000000, 417.000000, "_");
  1279.     TextDrawBackgroundColor(TDData, 255);
  1280.     TextDrawFont(TDData, 3);
  1281.     TextDrawLetterSize(TDData, 0.350000, 1.100000);
  1282.     TextDrawColor(TDData, 0xAAC5E3FF);
  1283.     TextDrawSetOutline(TDData, 1);
  1284.     TextDrawSetProportional(TDData, 1);
  1285.  
  1286.     TDKara = TextDrawCreate(36.000000, 267.000000, "_");
  1287.     TextDrawBackgroundColor(TDKara, 255);
  1288.     TextDrawFont(TDKara, 1);
  1289.     TextDrawLetterSize(TDKara, 0.380000, 1.400000);
  1290.     TextDrawColor(TDKara, -13815041);
  1291.     TextDrawSetOutline(TDKara, 1);
  1292.     TextDrawSetProportional(TDKara, 1);
  1293.  
  1294.     AllowInteriorWeapons(true);
  1295.     DisableInteriorEnterExits();
  1296.     EnableStuntBonusForAll(false);
  1297.     ShowPlayerMarkers(0);
  1298.     ShowNameTags(false);
  1299.     SetNameTagDrawDistance(10);
  1300.     LimitGlobalChatRadius(6.0);
  1301.     ManualVehicleEngineAndLights();
  1302.     AddPlayerClass(1, 444.6531,-1729.9272,9.9767,2.8579, 0, 0, 0, 0, 0, 0); //
  1303.     SetGameModeText(GAMEMODE_TEXT);
  1304.     //connection mysql
  1305.     mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
  1306.     if(mysql_ping(1) == 1)
  1307.         print("[MySQL]: Połączono z bazą!"), mysql_free_result(), mysql_query_ex("UPDATE `1postacie` SET `ingame` = 0");
  1308.     else
  1309.         return print("[MySQL]: Utracono połaczenie z bazą danych!"), SetGameModeText("[MySQL] Failed Connect");
  1310.     mysql_debug(1);
  1311.     SetTimer("AntyCheat", 500, true);
  1312.     SetTimer("Sekundnik", 1000, true);
  1313.     SetTimer("Minutnik", 60000, true);
  1314.     SetTimer("DziesiecioMinutnik", 60000*10, true);
  1315.     //moduły
  1316.     new obj = GetTickCount();
  1317.     Wczytaj_Obiekty();
  1318.     printf("Moduł obiektów wczytany.\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - obj, StatsObj);
  1319.     new door = GetTickCount();
  1320.     Wczytaj_Drzwi();
  1321.     printf("Moduł drzwi wczytany.\t\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - door, StatsDoor);
  1322.     new group = GetTickCount();
  1323.     Wczytaj_Grupy();
  1324.     printf("Moduł grup wczytany.\t\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - group, StatsGroup);
  1325.     new item = GetTickCount();
  1326.     Wczytaj_Przedmioty();
  1327.     printf("Moduł przedmiotów wczytany.\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - item, StatsItem);
  1328.     new veh = GetTickCount();
  1329.     Wczytaj_Pojazdy();
  1330.     printf("Moduł pojazdów wczytany.\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - veh, StatsVeh);
  1331.     new zone = GetTickCount();
  1332.     Wczytaj_Strefy();
  1333.     printf("Moduł stref wczytany.\t\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - zone, StatsZone);
  1334.     //dezaktywacja systemowych kar
  1335. /*  new LogUID, LogOwner, LogAdmin, LogAdd, LogTyp, LogText[128], LogExp, LogDez, LogChar, query[200], result[200], LogSys, LogAdm, LogAll;
  1336.     mysql_query_ex("SELECT * FROM `1logi`");
  1337.     mysql_store_result();
  1338.     while(mysql_fetch_row_format(result, "|") == 1)
  1339.     {
  1340.         sscanf(result,  "p<|>ddddds[128]ddd",   LogUID, LogOwner, LogAdmin, LogAdd, LogTyp, LogText, LogExp, LogDez, LogChar);
  1341.         if(LogExp < gettime())
  1342.         {
  1343.             if(LogDez != -1 && LogExp != -1 && LogExp != 999)
  1344.             {
  1345.                 LogAll++;
  1346.                 format(String, sizeof(query), "UPDATE `1logi` SET `expires`=-1, `dezprzez`=-1 WHERE `uid`=%d", LogUID);
  1347.                 mysql_query_ex(query);
  1348.  
  1349.                 if(LogAdmin == -1)
  1350.                     LogSys++;
  1351.                     else
  1352.                     LogAdm++;
  1353.  
  1354.                 if(LogTyp == 2)
  1355.                 {
  1356.                     format(query, sizeof(query), "UPDATE `members` SET `ban_time`=0, `ban_uid`=0 WHERE `member_id`=%d", LogOwner);
  1357.                     mysql_query_ex(query);
  1358.                 }
  1359.                 else if(LogTyp == 3)
  1360.                 {
  1361.                     format(query, sizeof(query), "UPDATE `1postacie` SET `konto`=1 WHERE `uid`=%d", LogChar);
  1362.                     mysql_query_ex(query);
  1363.                 }
  1364.             }
  1365.         }
  1366.     }
  1367.     mysql_free_result();
  1368.     if(LogAll)
  1369.         printf("[System] Dezaktywowano %d kar (Sys: %d, Adm: %d).", LogAll, LogSys, LogAdm);
  1370.  
  1371.     new test = GetTickCount(), itemoff, itemon;
  1372.     for(new p = 0; p < MAX_ITEM; p++)
  1373.     {
  1374.         if(Przedmiot[p][iAktywny] == 1)
  1375.         {
  1376.             itemon++;
  1377.         }
  1378.         else
  1379.         {
  1380.             itemoff++;
  1381.         }
  1382.     }
  1383.     printf("Czas wykonania pętli itemów: %dms (%d/%d)", GetTickCount() - test, itemon, itemoff);
  1384. */
  1385.     EnableVehicleFriendlyFire();
  1386.     LoadNPC("Policjant", "train_ls");
  1387.     return 1;
  1388. }
  1389.  
  1390. public OnGameModeExit()
  1391. {
  1392.     for(new p = 0; p < MAX_ITEM; p++)
  1393.     {
  1394.         if(Paczka[p][pAktywna] == 1)
  1395.         {
  1396.             new powtorzenia = 0;
  1397.             for(new nr = 1; nr < MAX_ITEM; nr++)
  1398.             {
  1399.                 if(Przedmiot[nr][iAktywny] == 0)
  1400.                 {
  1401.                     Przedmiot[nr][iAktywny]     = 1;
  1402.                     Przedmiot[nr][iTyp]         = Paczka[p][pTyp];
  1403.                     Przedmiot[nr][iWartosc1]    = Paczka[p][pValue1];
  1404.                     Przedmiot[nr][iWartosc2]    = Paczka[p][pValue2];
  1405.                     Przedmiot[nr][iWartosc3]    = Paczka[p][pValue3];
  1406.                     Przedmiot[nr][iOwner]       = Paczka[p][pOwner];
  1407.                     Przedmiot[nr][iOwnerUID]    = Paczka[p][pOwnerUID];
  1408.                     Przedmiot[nr][iWaga]        = Paczka[p][pWaga];
  1409.                     Przedmiot[nr][iUsed]        = 0;
  1410.                     Przedmiot[nr][iVir]         = 0;
  1411.                     Przedmiot[nr][iPrice]       = Paczka[p][pPrice];
  1412.                     Przedmiot[nr][iFlaga]       = Paczka[p][pFlaga];
  1413.                     Przedmiot[nr][iFlagaUID]    = Paczka[p][pFlagaUID];
  1414.                     strmid(Przedmiot[nr][iNazwa],  Paczka[p][pNazwa], 0, 64, 64);
  1415.                     ZapiszPrzedmiot(nr);
  1416.                     powtorzenia++;
  1417.                     if(powtorzenia == Paczka[p][pIlosc])
  1418.                     {
  1419.                         break;
  1420.                     }
  1421.                     Paczka[p][pAktywna] = 0;
  1422.                 }
  1423.             }
  1424.         }
  1425.     }
  1426.     for(new v = 0; v < MAX_VEHICLES; v++)
  1427.     {
  1428.         if(Pojazd[v][vSpawn] == 1)
  1429.         {
  1430.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  1431.             {
  1432.                 if(PojazdUID[veh] == v)
  1433.                 {
  1434.                     ZapiszPojazd(veh);
  1435.                 }
  1436.             }
  1437.         }
  1438.     }
  1439.     foreach(Player, p)
  1440.     {
  1441.         if(Login(p) == 1)
  1442.         {
  1443.             SavePlayerStats(p, SAVE_PLAYER_BASIC);
  1444.             SavePlayerStats(p, SAVE_PLAYER_POS);
  1445.             SavePlayerStats(p, SAVE_PLAYER_GROUP);
  1446.         }
  1447.     }
  1448.     for(new nr = 0; nr < MAX_OBIEKT; nr++){
  1449.         if(Obiekt[nr][oAktywny] == 1){
  1450.             ZapiszObiekt(nr);
  1451.         }
  1452.     }
  1453.     for(new nr = 0; nr < MAX_ITEM; nr++){
  1454.         if(Przedmiot[nr][iAktywny] == 1){
  1455.             ZapiszPrzedmiot(nr);
  1456.             if(Przedmiot[nr][iTyp] == 1 && Przedmiot[nr][iUsed] == 1)
  1457.             {
  1458.                 Przedmiot[nr][iUsed] = 0;
  1459.             }
  1460.         }
  1461.     }
  1462.     mysql_query_ex("UPDATE `1postacie` SET `ingame` = 0");
  1463.     DOF2_Exit();
  1464.     mysql_close();
  1465.     return 1;
  1466. }
  1467.  
  1468. public OnPlayerRequestClass(playerid, classid)
  1469. {
  1470.     if(IsPlayerNPC(playerid))
  1471.     {
  1472.         UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pNickName], KOL_NAME, CharName3DText(playerid));
  1473.         new playername[MAX_PLAYER_NAME];
  1474.         GetPlayerName(playerid, playername, sizeof(playername));
  1475.         if(!strcmp(playername, "Policjant", false))
  1476.         {
  1477.             setLogin(playerid, 1);
  1478.             SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
  1479.         }
  1480.         return 1;
  1481.  
  1482.     }
  1483.     SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
  1484.     return 1;
  1485. }
  1486.  
  1487. public OnPlayerConnect(playerid)
  1488. {
  1489.     if(IsPlayerNPC(playerid))
  1490.         return 1;
  1491.     Offer[playerid][oCustomerID]    = INVALID_PLAYER_ID;
  1492.     Offer[playerid][oBlock]         = 0;
  1493.     //zerowanie pamięci Player
  1494.     Player[playerid][pUID]          = 0;
  1495.     Player[playerid][pKonto]        = 0;
  1496.     Player[playerid][pOnline]       = 0;
  1497.     Player[playerid][pSkin]         = 0;
  1498.     Player[playerid][pLastSkin]     = 0;
  1499.     Player[playerid][pGID]          = 0;
  1500.     Player[playerid][pInGame]       = 0;
  1501.     Player[playerid][pGodziny]      = 0;
  1502.     Player[playerid][pLastLogin]    = 0;
  1503.     Player[playerid][pHP]           = 100.0;
  1504.     Player[playerid][pSex]          = 0;
  1505.     Player[playerid][pWiek]         = 0;
  1506.     Player[playerid][pSila]         = 0;
  1507.     Player[playerid][pInvisible]    = 0;
  1508.     Player[playerid][pDutyAll]      = 0;
  1509.     Player[playerid][pJob]          = 0;
  1510.     Player[playerid][pSpawnID]      = 0;
  1511.     Player[playerid][pKasa]         = 0;
  1512.     Player[playerid][pBank]         = 0;
  1513.     Player[playerid][pControl]      = 0;
  1514.     pGrupa[playerid][1]             = 0;
  1515.     pGrupa[playerid][2]             = 0;
  1516.     pGrupa[playerid][3]             = 0;
  1517.     pGrupa[playerid][4]             = 0;
  1518.     pGrupa[playerid][5]             = 0;
  1519.     pGrupaPerm[playerid][1]         = 0;
  1520.     pGrupaPerm[playerid][2]         = 0;
  1521.     pGrupaPerm[playerid][3]         = 0;
  1522.     pGrupaPerm[playerid][4]         = 0;
  1523.     pGrupaPerm[playerid][5]         = 0;
  1524.     pGrupaPayDay[playerid][1]       = 0;
  1525.     pGrupaPayDay[playerid][2]       = 0;
  1526.     pGrupaPayDay[playerid][3]       = 0;
  1527.     pGrupaPayDay[playerid][4]       = 0;
  1528.     pGrupaPayDay[playerid][5]       = 0;
  1529.     Player[playerid][pBW]           = 0;
  1530.     Player[playerid][pWyjezdzone]   = 0;
  1531.     Player[playerid][pInt]          = 0;
  1532.     Player[playerid][pVir]          = 0;
  1533.     Player[playerid][pPosX]         = 0;
  1534.     Player[playerid][pPosY]         = 0;
  1535.     Player[playerid][pPosZ]         = 0;
  1536.     Player[playerid][pQuit]         = 0;
  1537.     Player[playerid][pQuitTime]     = 0;
  1538.     Player[playerid][pAJ]           = 0;
  1539.     Player[playerid][pJail]         = 0;
  1540.     Player[playerid][pSpawn]        = 0;
  1541.     Player[playerid][pSpawnTyp]     = 0;
  1542.     Player[playerid][pPayDayGame]   = 0;
  1543.     Player[playerid][pTelefon]      = 0;
  1544.     //zerowanie pamięci Global
  1545.     IPB[playerid][ipb_Grupa]        = 0;
  1546.     IPB[playerid][ipb_GameScore]    = 0, SetPlayerScore(playerid, 0);
  1547.     IPB[playerid][ipb_Premium]      = 0;
  1548.     IPB[playerid][ipb_NoRUN]        = 0;
  1549.     IPB[playerid][ipb_NoVEH]        = 0;
  1550.     IPB[playerid][ipb_NoOOC]        = 0;
  1551.     IPB[playerid][ipb_NoGUN]        = 0;
  1552.     IPB[playerid][ipb_Ban]          = 0;
  1553.     IPB[playerid][ipb_PremiumScore] = 0;
  1554.  
  1555.  
  1556.     SetPVarInt(playerid, "Death", 0);
  1557.     for(new zero = 0; zero < 44; zero++)
  1558.     {
  1559.         Player[playerid][zPlayer:zero] = 0;
  1560.     }
  1561.     Statystyki[0]++;
  1562.     //offe
  1563.     SetPVarInt(playerid, "rpOffeClient",    INVALID_PLAYER_ID);
  1564.     SetPVarInt(playerid, "rpOffePlayer",    INVALID_PLAYER_ID);
  1565.     SetPVarInt(playerid, "rpOffeDoor",      INVALID_PLAYER_ID);
  1566.     SetPVarInt(playerid, "rpOffeGroup",     INVALID_PLAYER_ID);
  1567.     //
  1568.     DrzwiTimer[playerid] = SetTimerEx("GiftImage", 500, 0, "d", playerid);
  1569.     SetPVarInt(playerid, "GroupUID", INVALID_PLAYER_ID);
  1570.     SetPVarInt(playerid, "KomuOferuje", INVALID_PLAYER_ID);
  1571.     SetPVarInt(playerid, "KtoOferuje", INVALID_PLAYER_ID);
  1572.     //kasacja attachedobject
  1573.     for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  1574.     {
  1575.         if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
  1576.     }
  1577.     SetPVarInt(playerid, "ReplayPriv", -1);
  1578.     Serwer[0]++;
  1579.     new hour, minute, second;
  1580.     gettime(hour, minute, second);
  1581.     SetWorldTime(hour);
  1582.     TogglePlayerSpectating(playerid, true);
  1583.     for(new nr = 0; nr < 1024; nr++)
  1584.     {
  1585.         TextDrawHideForPlayer(playerid, Text:nr);
  1586.     }
  1587.     DeathInfo[playerid][time0] = 0;
  1588.     DeathInfo[playerid][killed] = 0;
  1589.     SetPlayerHealth(playerid, 100);
  1590.     new query[128];
  1591.     format(query, sizeof(query), "SELECT * FROM `1postacie` WHERE `nick` ='%s'", NickSAMP(playerid));
  1592.     mysql_query_ex(query);
  1593.     mysql_store_result();
  1594.     if(mysql_num_rows() == 0)
  1595.     {
  1596.         dShowPlayerDialog(playerid, 50, DIALOG_STYLE_MSGBOX, ""ServName"Logowanie", "Postać, na którą próbujesz się zalogować nie istnieje.\nCzy chcesz ją utworzyć oraz podpisać pod konto globalne?", "Tak", "Nie");
  1597.     }
  1598.     else
  1599.     {
  1600.         dShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_PASSWORD, ""ServName"Logowanie", "Witaj na serwerze RolePlay!\n\nPostać została odnaleziona w bazie danych,\ndokonaj autoryzacji wpisując hasło.", "Dalej", "Anuluj");
  1601.         SetPlayerColor(playerid, 0x000000FF);
  1602.     }
  1603.     return mysql_free_result();
  1604. }
  1605.  
  1606. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1607. {
  1608.     new veh;
  1609.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1610.     {
  1611.         veh = GetPlayerVehicleID(playerid);
  1612.         GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
  1613.     }
  1614.     if(newkeys == 1032 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1615.     {
  1616.         if(Player[playerid][pBW] != 0)
  1617.             return 1;
  1618.         for(new p = 0; p < MAX_DRZWI; p++)
  1619.         {
  1620.             if(Drzwi[p][dAktywne] == 1)
  1621.             {
  1622.                 if(IsPlayerInRangeOfPoint(playerid, 2.0, Drzwi[p][dZewPosX], Drzwi[p][dZewPosY], Drzwi[p][dZewPosZ]) && Drzwi[p][dZewVir] == GetPlayerVirtualWorld(playerid))
  1623.                 {
  1624.                     if(Drzwi[p][dStatus] == 1)
  1625.                         return InfoBoxShow(2, playerid, "Drzwi do ~y~budynku~w~ sa ~r~zamkniete~w~.", 3);
  1626.                     SetPVarInt(playerid, "rpDoorEnterExit", gettime()+3);
  1627.                     SetPVarInt(playerid, "Teleport", 1);
  1628.                     TogglePlayerControllable(playerid, false);
  1629.                     SetPlayerInterior(playerid, Drzwi[p][dIntWew]);
  1630.                     SetPlayerVirtualWorld(playerid, Drzwi[p][dWewVir]);
  1631.                     SetPlayerPos(playerid, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]);
  1632.                     SetPlayerFacingAngle(playerid, Drzwi[p][dWewRot]);
  1633.                     break;
  1634.                 }
  1635.                 if(IsPlayerInRangeOfPoint(playerid, 2.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
  1636.                 {
  1637.                     if(Drzwi[p][dStatus] == 1)
  1638.                         return InfoBoxShow(2, playerid, "Drzwi do ~y~budynku~w~ sa ~r~zamkniete~w~.", 3);
  1639.                     SetPVarInt(playerid, "rpDoorEnterExit", gettime()+3);
  1640.                     SetPVarInt(playerid, "Teleport", 1);
  1641.                     TogglePlayerControllable(playerid, false);
  1642.                     SetPlayerInterior(playerid, Drzwi[p][dIntZew]);
  1643.                     SetPlayerVirtualWorld(playerid, Drzwi[p][dZewVir]);
  1644.                     SetPlayerPos(playerid, Drzwi[p][dZewPosX], Drzwi[p][dZewPosY], Drzwi[p][dZewPosZ]);
  1645.                     SetPlayerFacingAngle(playerid, Drzwi[p][dZewRot]);
  1646.                     break;
  1647.                 }
  1648. /*              foreach(Player, player)
  1649.                 {
  1650.                     if(GetPVarInt(player, "rpSpec") == playerid)
  1651.                     {
  1652.                         PlayerSpectateVehicle(player, playerid, SPECTATE_MODE_SIDE);
  1653.                     }
  1654.                 }
  1655. */
  1656.             }
  1657.         }
  1658.     }
  1659.     else if(newkeys == 5 || newkeys == 13)
  1660.     {
  1661.         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPVarInt(playerid, "Odpala") == 0 && pPojazd(playerid, veh) != 0)
  1662.         {
  1663.             if(Pojazd[CarUID(veh)][vHP] <= 350.0)
  1664.                 return InfoBoxShow(2, playerid, "Silnik ~y~pojazdu~w~ jest doszczetnie ~r~zniszczony~w~.~n~Udaj sie do mechanika, aby go naprawic.", 3);
  1665.             if(Pojazd[CarUID(veh)][vPaliwo] <= 0.0)
  1666.                 return InfoBoxShow(2, playerid, "W pojezdzie ~r~zabraklo~w~ paliwa.", 3);
  1667.             SetPVarInt(playerid, "Odpala", 1);
  1668.             if(engine == 1)
  1669.                 SetEngine(veh, playerid, 0);
  1670.             else
  1671.                 SetTimerEx("SetEngine", 3000, 0, "ddd", veh, playerid, 1), InfoBoxShow(2, playerid, "Odpalanie ~y~silnika~w~ moze potrwac kilka sekund...", 3);
  1672.         }
  1673.     }
  1674.     else if(newkeys == KEY_FIRE + 8 || newkeys == KEY_FIRE)
  1675.     {
  1676.         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1677.         {
  1678.             if(lights == 1)
  1679.                 SetVehicleParamsEx(veh, engine, 0, alarm, doors, bonnet, boot, objective);
  1680.                 else
  1681.                 SetVehicleParamsEx(veh, engine, 1, alarm, doors, bonnet, boot, objective);
  1682.         }
  1683.     }
  1684.     new Float:vPos[3];
  1685.     if(newkeys == 65536 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1686.     {
  1687.         for(new v = 0; v < MAX_VEHICLES; v++)
  1688.         {
  1689.             GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
  1690.             if(IsPlayerInRangeOfPoint(playerid, 4.0, vPos[0], vPos[1], vPos[2]) && GetVehicleVirtualWorld(v) == GetPlayerVirtualWorld(playerid))
  1691.             {
  1692.                 SetVehicleParamsEx(v, engine, lights, alarm, 1, bonnet, boot, objective);
  1693.                 break;
  1694.             }
  1695.         }
  1696.     }
  1697.     if(newkeys == 131072 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1698.     {
  1699.         new info[128];
  1700.         for(new v = 0; v < MAX_VEHICLES; v++)
  1701.         {
  1702.             GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
  1703.             if(IsPlayerInRangeOfPoint(playerid, 4.0, vPos[0], vPos[1], vPos[2]) && GetVehicleVirtualWorld(v) == GetPlayerVirtualWorld(playerid) && pPojazd(playerid, v) != 0)
  1704.             {
  1705.                 GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
  1706.                 if(doors == 1)
  1707.                 {
  1708.                     format(info, sizeof(info), "~y~Drzwi~w~ pojazdu ~y~%s~w~ (UID: %d) sa ~r~zamkniete~w~.~n~Nie mozesz ~g~otworzyc~y~ bagaznika~w~.", GetVehicleName(CarUID(v)), CarUID(v));
  1709.                 }
  1710.                 if(GetPVarInt(playerid, "rpBoot") > gettime())
  1711.                     return InfoBoxShow(2, playerid, "Zastosowano ~r~zabezpieczenie~w~, ktore nie pozwoli Ci naduzywac tej opcji.~n~Sprobuj ponownie za kilka sekund.", 3);
  1712.                 if(boot == 1 && doors != 1)
  1713.                 {
  1714.                     SetPVarInt(playerid, "rpBoot", gettime()+3);
  1715.                     format(info, sizeof(info), "~y~Bagaznik~w~ pojazdu ~y~%s~w~ (UID: %d) zostal ~r~zamkniety~w~.", GetVehicleName(CarUID(v)), CarUID(v));
  1716.                     SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 0, objective);
  1717.                 }
  1718.                 else
  1719.                 {
  1720.                     if(doors != 1)
  1721.                     {
  1722.                         SetPVarInt(playerid, "rpBoot", gettime()+3);
  1723.                         format(info, sizeof(info), "~y~Bagaznik~w~ pojazdu ~y~%s~w~ (UID: %d) zostal ~g~otwarty~w~.", GetVehicleName(CarUID(v)), CarUID(v));
  1724.                         SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 1, objective);
  1725.                     }
  1726.                 }
  1727.                 InfoBoxShow(2, playerid, info, 3);
  1728.                 break;
  1729.             }
  1730.         }
  1731.     }
  1732.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1733.     {
  1734.         if(newkeys == 128 || newkeys == 136 || newkeys == 160)
  1735.         {
  1736.             TextDrawSetString(Licznik3[playerid], "~r~~h~!");
  1737.         }
  1738.         else
  1739.         {
  1740.             TextDrawSetString(Licznik3[playerid], "~w~!");
  1741.         }
  1742.     }
  1743.     if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && newkeys == 2)
  1744.     {
  1745.         if(GetPlayerWeaponInData(playerid) != INVALID_WEAPON_DATA)
  1746.         {
  1747.             if(!(Grupa[Sluzba(playerid)][gFlagPerm] & G_FLAG_DRIVEBY))
  1748.             {
  1749.                 Kara(0, playerid, -1, "Attempt Force DriveBy.", 0);
  1750.                 return 1;
  1751.             }
  1752.         }
  1753.     }
  1754.     return 1;
  1755. }
  1756.  
  1757. public OnPlayerUpdate(playerid)
  1758. {
  1759.     if(GetPlayerSpeed(playerid) > 600 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1760.     {
  1761.         new ACS[128], v = GetPlayerVehicleID(playerid);
  1762.         format(ACS, sizeof(ACS), "Warp: %dkm/h (%s).", GetPlayerSpeed(playerid), GetVehicleName(CarUID(GetPlayerVehicleID(playerid)))), Kara(2, playerid, -1, ACS, 7);
  1763.         SetVehicleVirtualWorld(v, v+2);
  1764.         SetVehicleToRespawn(v);
  1765.     }
  1766.     SetPVarInt(playerid, "AFK", 0);
  1767.     if(GetPVarInt(playerid, "rpBron") != 0)
  1768.     {
  1769.         new bron[13],ammo[13];
  1770.         for(new slot=0;slot<13;slot++)
  1771.         {
  1772.             GetPlayerWeaponData(playerid, slot, bron[slot], ammo[slot]);
  1773.         }
  1774.         new weapon=GetPlayerWeapon(playerid);
  1775.         if(bron[1]&&ammo[1]>0)
  1776.         {
  1777.             if(bron[1]==weapon){
  1778.                 RemovePlayerAttachedObject(playerid, ATTACH_SLOT_1);
  1779.             }
  1780.             if(bron[1]!=weapon)
  1781.             {
  1782.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_1,GetWeaponModel(bron[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  1783.             }
  1784.         }
  1785.         if(bron[2]&&ammo[2]>0)
  1786.         {
  1787.             if(bron[2]==weapon){
  1788.                 RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
  1789.             }
  1790.             if(bron[2]!=weapon)
  1791.             {
  1792.                 SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[2]),8, -0.079999, -0.15, 0.009999, 180.100006, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  1793.             }
  1794.         }
  1795.         if(bron[3]&&ammo[3]>0)
  1796.         {
  1797.             if(bron[3]==weapon){
  1798.                 RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
  1799.             }
  1800.             if(bron[3]!=weapon)
  1801.             {
  1802.                 SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[3]),1,-0.25, -0.19, -0.1, 0.399932, 13.000000, 10.000000, 1.099999, 1.000000, 1.000000);
  1803.             }
  1804.         }
  1805.         if(bron[4]&&ammo[4]>0)
  1806.         {
  1807.             if(bron[4]==weapon){
  1808.                 RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
  1809.             }
  1810.             if(bron[4]!=weapon)
  1811.             {
  1812.                 SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, 90.000000, 6.000000, 1.000000, 1.000000, 1.00000);
  1813.             }
  1814.         }
  1815.         if(bron[5]&&ammo[5]>0)
  1816.         {
  1817.             if(bron[5]==weapon){
  1818.                 RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
  1819.             }
  1820.             if(bron[5]!=weapon)
  1821.             {
  1822.                 SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[5]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  1823.             }
  1824.         }
  1825.         if(bron[6]&&ammo[6]>0)
  1826.         {
  1827.             if(bron[6]==weapon){
  1828.                 RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
  1829.             }
  1830.             if(bron[6]!=weapon)
  1831.             {
  1832.                 SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[6]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  1833.             }
  1834.         }
  1835.     }
  1836.     return 1;
  1837. }
  1838.  
  1839. public OnPlayerSpawn(playerid)
  1840. {
  1841.     SetPlayerTeam(playerid, NO_TEAM);
  1842.     SetPlayerHealth(playerid, 100);
  1843.     TextDrawHideForPlayer(playerid, ImagenGift);
  1844.     if(Login(playerid) == 1)
  1845.     {
  1846.         SetPVarInt(playerid, "Teleport", 1);
  1847.         GameTextForPlayer(playerid, "~g~Pomyslnie zespawnowano.", 1500, 5);
  1848.         for(new nr = 0; nr < 11; nr++)
  1849.         {
  1850.             SetPlayerSkillLevel(playerid, nr, 1);
  1851.         }
  1852.         SetPlayerSkillLevel(playerid, 3, 999);
  1853.         SetPlayerSkillLevel(playerid, 7, 999);
  1854.         SetPlayerSkillLevel(playerid, 8, 999);
  1855.         SetPlayerSkillLevel(playerid, 9, 999);
  1856.         setHP(playerid, Player[playerid][pHP]);
  1857.         if(GetPVarInt(playerid, "rpBronUID") == 0)
  1858.         {
  1859.             ResetPlayerWeapons(playerid);
  1860.         }
  1861.         SetPlayerSkin(playerid, Player[playerid][pSkin]);
  1862.         SetPlayerHealth(playerid, Player[playerid][pHP]);
  1863.         //Spawn AdminJail
  1864.         if(Player[playerid][pAJ] != 0)
  1865.         {
  1866.             SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+2222);
  1867.             return 1;
  1868.         }
  1869.         //Nadawanie BW
  1870.         if(GetPVarInt(playerid, "Death") == 1)
  1871.         {
  1872.             Player[playerid][pBW] = 10;
  1873.             SetPVarInt(playerid, "Death", 0);
  1874.         }
  1875.         //spawn BW
  1876.         if(Player[playerid][pBW] > 0)
  1877.         {
  1878.             SetPVarInt(playerid, "Teleport", 1);
  1879.             SetPVarInt(playerid, "SpawnBW", gettime()+5);
  1880.             format(String, sizeof(String), "Twoja postać została pobita do stanu BW.\nMusisz odczekać jeszcze %d minut, aby móc normalnie funkcjonować.", Player[playerid][pBW]), Info(playerid, String);
  1881.             SetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
  1882.             SetPlayerVirtualWorld(playerid, Player[playerid][pVir]);
  1883.             return SetPlayerInterior(playerid, Player[playerid][pInt]);
  1884.         }
  1885.         //wchodzenie po /qs, crash, timeout
  1886.         if(Player[playerid][pQuit] == 1)
  1887.         {
  1888.             if(gettime() < Player[playerid][pQuitTime]+600)
  1889.             {
  1890.                 SetPVarInt(playerid, "Teleport", 1);
  1891.                 InfoBoxShow(2, playerid, "W wyniku ~y~crashu~w~ lub ~y~wyjscia z gry~w~ za pomoca komendy ~y~/qs~w~ zostajesz przywrocony do poprzedniej pozycji.", 3);
  1892.                 SetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
  1893.                 SetPlayerVirtualWorld(playerid, Player[playerid][pVir]);
  1894.                 SetPlayerInterior(playerid, Player[playerid][pInt]), Player[playerid][pQuit] = 0;
  1895.             }
  1896.             else
  1897.             {
  1898.                 SetPVarInt(playerid, "Teleport", 1);
  1899.                 Player[playerid][pQuit] = 0, InfoBoxShow(2, playerid, "Od poprzedniej wyjscia z gry w wyniku ~y~crashu~w~ lub uzycia ~y~/qs~w~ minelo wiecej niz ~r~10 minut~w~.~n~Zostajesz zespawnowany na spawnie Twojej postaci.", 3);
  1900.             }
  1901.             return 1;
  1902.         }
  1903.         //spawn normalny
  1904.         if(Player[playerid][pSpawn] == 0)
  1905.         {
  1906.             SetPVarInt(playerid, "Teleport", 1);
  1907.             SetPlayerPos(playerid, 444.6531,-1729.9272,9.9767);
  1908.         }
  1909.         else if(Player[playerid][pSpawn] == 1)
  1910.         {
  1911.             SetPVarInt(playerid, "Teleport", 1);
  1912.             if(Drzwi[Player[playerid][pSpawnID]][dAktywne] == OWNER_PLAYER && Drzwi[Player[playerid][pSpawnID]][dOwner] == 1)
  1913.             {
  1914.                 new d = Player[playerid][pSpawnID];
  1915.                 SetPlayerInterior(playerid, Drzwi[d][dIntWew]);
  1916.                 SetPlayerVirtualWorld(playerid, Drzwi[d][dWewVir]);
  1917.                 SetPlayerPos(playerid, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]);
  1918.             }
  1919.             else
  1920.             {
  1921.                 Player[playerid][pSpawn] = 0;
  1922.                 Player[playerid][pSpawnID] = 0;
  1923.                 OnPlayerSpawn(playerid);
  1924.             }
  1925.         }
  1926.         else if(Player[playerid][pSpawn] == 2)
  1927.         {
  1928.             SetPVarInt(playerid, "Teleport", 1);
  1929.             if(Player[playerid][pSpawnTyp] == 1)
  1930.             {
  1931.                 SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
  1932.                 SetPlayerInterior(playerid, IntArray2[49][0]);
  1933.                 SetPlayerPos(playerid, IntArray[49][0], IntArray[49][1], IntArray[49][2]);
  1934.                 return SetPlayerFacingAngle(playerid, IntArray[49][3]);
  1935.             }
  1936.             else if(Player[playerid][pSpawnTyp] == 2)
  1937.             {
  1938.                 SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
  1939.                 SetPlayerInterior(playerid, IntArray2[58][0]);
  1940.                 SetPlayerPos(playerid, IntArray[58][0], IntArray[58][1], IntArray[58][2]);
  1941.                 return SetPlayerFacingAngle(playerid, IntArray[58][3]);
  1942.             }
  1943.             return 1;
  1944.         }
  1945.         return 1;
  1946.     }
  1947.     return 1;
  1948. }
  1949.  
  1950. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  1951. {
  1952.     if(fScaleX > 2 || fScaleX < 0 || fScaleY > 2 || fScaleY < 0 || fScaleZ > 2 || fScaleZ < 0)
  1953.         return InfoBoxShow(2, playerid, "Skalowanie ~y~obiektu~w~ przekroczylo ~r~dopuszczalne~w~ rozmiary.", 3), RemovePlayerAttachedObject(playerid, index);
  1954.     InfoBoxShow(2, playerid, "Skalowanie ~y~obiektu~w~ zostalo zakonczone ~g~sukcesem~w~.", 3);
  1955.     return SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  1956. }
  1957.  
  1958. public OnPlayerDisconnect(playerid, reason)
  1959. {
  1960.     //zerowanie ofert
  1961.     if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  1962.     {
  1963.         if(Offer[playerid][oType] == 7)
  1964.         {
  1965.             UpdateDynamic3DTextLabelText(Text3D:Veh3DText[Offer[playerid][oItemUID]], KOL_NAME, " ");
  1966.         }
  1967.         foreach(Player, p)
  1968.         {
  1969.             if(p != playerid && Offer[p][oCustomerID] == Offer[playerid][oCustomerID])
  1970.             {
  1971.                 Offer[playerid][oCustomerID] = INVALID_PLAYER_ID;
  1972.                 Offer[p][oCustomerID] = INVALID_PLAYER_ID;
  1973.             }
  1974.             else
  1975.             {
  1976.                 Offer[playerid][oCustomerID] = INVALID_PLAYER_ID;
  1977.             }
  1978.         }
  1979.     }
  1980.     //kasowanie dostarczania paczek
  1981.     if(GetPVarInt(playerid, "rpPaczka") != 0)
  1982.     {
  1983.         Paczka[GetPVarInt(playerid, "rpPaczka")][pDostarcza] = 0;
  1984.     }
  1985.     //koniec
  1986.     Player[playerid][pInGame] = 0;
  1987.     if(Login(playerid) == 1)
  1988.     {
  1989.         //dodawanie sesji
  1990.         new query[256];
  1991.         format(query, sizeof(query), "INSERT INTO `1sesje` (`data`,`char`,`online`,`global`) VALUES ('%d', %d, '%d', '%d')", gettime(), Player[playerid][pUID], gettime() - Player[playerid][pSesja], Player[playerid][pGID]);
  1992.         mysql_query_ex(query);
  1993.         //koniec zapisu sesji
  1994.         for(new nr = 0; nr < MAX_ITEM; nr++)
  1995.         {
  1996.             if(Przedmiot[nr][iAktywny] == 1 && Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
  1997.             {
  1998.                 if(Przedmiot[nr][iTyp] != 2)
  1999.                 {
  2000.                     Przedmiot[nr][iUsed] = 0;
  2001.                 }
  2002.             }
  2003.         }
  2004.         if(GetPVarInt(playerid, "rpBronUID") != 0)
  2005.         {
  2006.             new bron[13], amunicja[13];
  2007.             for (new i = 0; i < 13; i++)
  2008.             {
  2009.                 GetPlayerWeaponData(playerid, i, bron[i], amunicja[i]);
  2010.                 if(bron[i] == GetPVarInt(playerid, "rpBron"))
  2011.                 {
  2012.                     ResetPlayerWeapons(playerid);
  2013.                     Przedmiot[GetPVarInt(playerid, "rpBronUID")][iUsed] = 0;
  2014.                     Przedmiot[GetPVarInt(playerid, "rpBronUID")][iWartosc2] = amunicja[i];
  2015.                 }
  2016.             }
  2017.         }
  2018.         Data();
  2019.         new h, m, s, Time[3];
  2020.         FullTime(gettime() - Player[playerid][pSesja], Time[0], Time[1], Time[2]);
  2021.         gettime(h, m, s);
  2022.         SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
  2023.         SavePlayerStats(playerid, SAVE_PLAYER_POS);
  2024.         SavePlayerStats(playerid, SAVE_PLAYER_GROUP);
  2025.     }
  2026.     UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pNickName], KOL_NAME, " ");
  2027.     UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pOpis], COLOR_DESC, " ");
  2028.     return SetPVarInt(playerid, "Teleport", 1);
  2029. }
  2030.  
  2031.  
  2032.  
  2033. public OnPlayerDeath(playerid, killerid, reason)
  2034. {
  2035.     new ACS[128];
  2036.     if(Login(playerid) == 1)
  2037.     {
  2038.         dHP[playerid] = 75;
  2039.         SetPVarInt(playerid, "Death", 1);
  2040.         if((gettime() - DeathInfo[playerid][time0]) < 1)
  2041.         {
  2042.             DeathInfo[playerid][killed]++;
  2043.             if(DeathInfo[playerid][killed] == KILL_LIMIT)
  2044.             {
  2045.                 format(ACS, sizeof(ACS), "FakeKill na graczu %s.", CharName(killerid)), Kara(0, playerid, -1, ACS, 0);
  2046.             }
  2047.         }
  2048.         else DeathInfo[playerid][killed] = 0;
  2049.         DeathInfo[playerid][time0] = gettime();
  2050.         if(GetPVarInt(playerid, "rpBronUID") != 0)
  2051.         {
  2052.             new bron[13], amunicja[13];
  2053.             for (new i = 0; i < 13; i++)
  2054.             {
  2055.                 GetPlayerWeaponData(playerid, i, bron[i], amunicja[i]);
  2056.                 if(bron[i] == GetPVarInt(playerid, "rpBron"))
  2057.                 {
  2058.                     ResetPlayerWeapons(playerid);
  2059.                     Przedmiot[GetPVarInt(playerid, "rpBronUID")][iUsed] = 0;
  2060.                     Przedmiot[GetPVarInt(playerid, "rpBronUID")][iWartosc2] = amunicja[i];
  2061.                     SetPVarInt(playerid, "rpBron", 0);
  2062.                     SetPVarInt(playerid, "rpAmmo", 0);
  2063.                     SetPVarInt(playerid, "rpBronAC", gettime()+8);
  2064.                     SetPVarInt(playerid, "rpBronUID", 0);
  2065.                 }
  2066.             }
  2067.         }
  2068.         GetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
  2069.     }
  2070.     return 1;
  2071. }
  2072.  
  2073. public OnVehicleDeath(vehicleid, killerid)
  2074. {
  2075.     foreach(Player, p)
  2076.     {
  2077.         if(GetPVarInt(p, "OffeVeh") == vehicleid)
  2078.         {
  2079.             SetPVarInt(p, "OffeVeh", 0);
  2080.             SetPVarInt(p, "OffeVehTime", 0);
  2081.             Tip(p, "Naprawa pojazdu została anulowana, pojazd został zniszczony.");
  2082.             TextDrawHideForPlayer(p, TDOffe[p]);
  2083.             Offer[p][oBlock] = 0;
  2084.         }
  2085.     }
  2086.     UpdateDynamic3DTextLabelText(Text3D:Veh3DText[vehicleid], KOL_NAME, " ");
  2087.     new panels1, doors1, lights1, tires1;
  2088.     GetVehicleDamageStatus(vehicleid, panels1, doors1, lights1, tires1);
  2089.     new veh = CarUID(vehicleid);
  2090.     if(Pojazd[veh][vPanels] < panels1)
  2091.     {
  2092.         Pojazd[veh][vPanels] = panels1;
  2093.     }
  2094.     if(Pojazd[veh][vDoors] < doors1)
  2095.     {
  2096.         Pojazd[veh][vDoors] = doors1;
  2097.     }
  2098.     if(Pojazd[veh][vLights] < lights1)
  2099.     {
  2100.         Pojazd[veh][vLights] = lights1;
  2101.     }
  2102.     if(Pojazd[veh][vTires] < tires1)
  2103.     {
  2104.         Pojazd[veh][vTires] = tires1;
  2105.     }
  2106.     ZapiszPojazd(vehicleid);
  2107.     Pojazd[veh][vHP] = 300;
  2108.     SetVehicleHealth(vehicleid, 300);
  2109.     return ZapiszPojazd(vehicleid);
  2110. }
  2111.  
  2112. public OnVehicleSpawn(vehicleid)
  2113. {
  2114.     return UstawParametryPojazdu(vehicleid);
  2115. }
  2116.  
  2117. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2118. {
  2119.     new succes = 0, Float:Pos[3];
  2120.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  2121.     //Zabezpieczenie
  2122.     if(pPojazd(playerid, vehicleid) == 0 && Player[playerid][pOnline] <= 10800)
  2123.     {
  2124.         foreach(Player, p)
  2125.         {
  2126.             if(GetPlayerVehicleID(p) == vehicleid && GetPlayerState(p) == PLAYER_STATE_DRIVER)
  2127.             {
  2128.                 succes = 1;
  2129.             }
  2130.         }
  2131.         if(succes == 0)
  2132.         {
  2133.             return SetPlayerPos(playerid, Pos[0]+0.05, Pos[1]+0.05, Pos[2]+0.01), Info(playerid, "Nie możesz wejść do pojazdu, gdy nie ma w nim kierowcy.\nTa informacja przestanie się pojawiać po przegraniu 3 godzin.");
  2134.         }
  2135.     }
  2136.  
  2137.     GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2138.     if(doors == 1)
  2139.         return SetPlayerPos(playerid, Pos[0]+0.05, Pos[1]+0.05, Pos[2]+0.01);
  2140.     if(!ispassenger)
  2141.     {
  2142.         if(pPojazd(playerid, vehicleid) == 0)
  2143.         {
  2144.             return SetPlayerPos(playerid, Pos[0]+0.05, Pos[1]+0.05, Pos[2]+0.01);
  2145.         }
  2146.         SetPVarInt(playerid, "EnterVehicle", 1);
  2147.         return printf("[cars] %s wsiadł do pojazdu %s (UID: %d) jako kierowca.", cName(playerid), GetVehicleName(CarUID(vehicleid)), CarUID(vehicleid));
  2148.     }
  2149.     SetPVarInt(playerid, "EnterVehicle", 2);
  2150.     return printf("[cars] %s wsiadł do pojazdu %s (UID: %d) jako pasażer.", cName(playerid), GetVehicleName(CarUID(vehicleid)), CarUID(vehicleid));
  2151. }
  2152.  
  2153. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  2154. {
  2155.     return 1;
  2156. }
  2157.  
  2158. public OnPlayerStateChange(playerid, newstate, oldstate)
  2159. {
  2160.     new string[128];
  2161.     if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
  2162.     {
  2163.         if(GetPVarInt(playerid, "EnterVehicle") == 0)
  2164.         {
  2165.             format(string, sizeof(string), "Nieautoryzowane wejscie do pojazdu (%d:%s).", CarUID(GetPlayerVehicleID(playerid)), GetVehicleName(CarUID(GetPlayerVehicleID(playerid)))), Kara(0, playerid, -1, string, 0);
  2166.         }
  2167.         else
  2168.         {
  2169.             SetPVarInt(playerid, "EnterVehicle", 0);
  2170.         }
  2171.     }
  2172.     if(newstate == PLAYER_STATE_DRIVER)
  2173.     {
  2174.         TextDrawShowForPlayer(playerid, Licznik0[playerid]);
  2175.         TextDrawShowForPlayer(playerid, Licznik1[playerid]);
  2176.         TextDrawShowForPlayer(playerid, Licznik2[playerid]);
  2177.         TextDrawShowForPlayer(playerid, Licznik3[playerid]);
  2178.         if(pPojazd(playerid, GetPlayerVehicleID(playerid)) == 0)
  2179.         {
  2180.             format(string, sizeof(string), "Nieautoryzowane wejscie do pojazdu (%d:%s).", CarUID(GetPlayerVehicleID(playerid)), GetVehicleName(CarUID(GetPlayerVehicleID(playerid)))), Kara(0, playerid, -1, string, 0);
  2181.         }
  2182.         return 1;
  2183.     }
  2184.     if(oldstate == PLAYER_STATE_DRIVER)
  2185.     {
  2186.         SetPVarInt(playerid, "rpPasy", 0);
  2187.         TextDrawHideForPlayer(playerid, Licznik0[playerid]);
  2188.         TextDrawHideForPlayer(playerid, Licznik1[playerid]);
  2189.         TextDrawHideForPlayer(playerid, Licznik2[playerid]);
  2190.         TextDrawHideForPlayer(playerid, Licznik3[playerid]);
  2191.         if(GetPVarInt(playerid, "LastVehicleID") != 0)
  2192.         {
  2193.             if(pPojazd(playerid, GetPVarInt(playerid, "LastVehicleID")) != 0)
  2194.             {
  2195.                 GetVehiclePos(GetPVarInt(playerid, "LastVehicleID"), VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][0], VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][1], VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][2]);
  2196.                 GetVehicleZAngle(GetPVarInt(playerid, "LastVehicleID"), VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][3]);
  2197.             }
  2198.         }
  2199.     }
  2200.     return 1;
  2201. }
  2202.  
  2203. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2204. {
  2205.     if(Login(playerid) == 1)
  2206.     {
  2207.         printf("[dial] %s: [%s] (%d, %d, %d)", cName(playerid), inputtext, dialogid, response, listitem);
  2208.     }
  2209.     if(dialogid == 0)
  2210.         return 1;
  2211.     else if(dialogid == DIALOG_ID)
  2212.     {
  2213.         if(!response) return Kick(playerid);
  2214.         new str[312];
  2215.         new hash[256];
  2216.         new salt[256];
  2217.         mysql_real_escape_string(inputtext, str);
  2218.         format(str, sizeof str, "SELECT 1postacie.owneruid, 1postacie.uid, members.members_pass_salt FROM 1postacie JOIN members ON members.member_id = 1postacie.owneruid WHERE 1postacie.nick = '%s' LIMIT 1", NickSAMP(playerid));
  2219.         mysql_query_ex(str);
  2220.         mysql_store_result();
  2221.         if(mysql_num_rows() != 0)
  2222.         {
  2223.             mysql_fetch_row_format(str);
  2224.             sscanf(str, "p<|>dds[256]", globaluid[playerid], playeruid[playerid], salt);
  2225.             Player[playerid][pUID]      = playeruid[playerid];
  2226.             SetPVarInt(playerid, "pGID", globaluid[playerid]);
  2227.         }
  2228.         mysql_free_result();
  2229.         format(hash, sizeof(hash), "%s%s", MD5_Hash(salt), MD5_Hash(inputtext));
  2230.         mysql_real_escape_string(hash, hash);
  2231.         format(str, sizeof(str), "SELECT 1postacie.*, members.name FROM 1postacie JOIN members ON members.members_pass_hash = md5('%s') WHERE 1postacie.uid = %d LIMIT 1", hash, playeruid[playerid]);
  2232.         mysql_query_ex(str);
  2233.         mysql_store_result();
  2234.         if(mysql_num_rows())
  2235.         {
  2236.             mysql_free_result();
  2237.             format(String, sizeof(String), "[info] Pomyslnie zalogowano (%s).", inputtext), PlayerLog(playerid, String);
  2238.             setLogin(playerid, 1), OnPlayerLoginIC(playerid, NickSAMP(playerid));
  2239.         }
  2240.         else
  2241.         {
  2242.             mysql_free_result();
  2243.             SetPVarInt(playerid, "BledneLogowanie", GetPVarInt(playerid, "BledneLogowanie") +1);
  2244.             if(GetPVarInt(playerid, "BledneLogowanie") == 2)
  2245.             {
  2246.                 Kick(playerid);
  2247.             }
  2248.             new query[200];
  2249.             GetPlayerIp(playerid, Player[playerid][pIP], 16);
  2250.             format(query, sizeof(query), "INSERT INTO `1sesje_log` (`data`,`char`,`global`,`status`,`IP`) VALUES (%d, %d, %d, %d, '%s')", gettime(), playeruid[playerid], globaluid[playerid], 0, Player[playerid][pIP]);
  2251.             mysql_query_ex(query);
  2252.             dShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_PASSWORD, ""ServName"Logowanie", "Witaj na serwerze RolePlay!\n\nPostać została odnaleziona w Naszej bazie danych,\ndokonaj autoryzacji wpisując hasło.", "Dalej", "Anuluj");
  2253.             InfoBoxShow(2, playerid, "Podane haslo jest ~r~nieprawidlowe~w~.", 3);
  2254.         }
  2255.     }
  2256.     else if(dialogid == 2)
  2257.     {
  2258.         new iteminfo[128];
  2259.         if(!response)
  2260.         {
  2261.             SetPVarInt(playerid, "ItemList", ListItem[playerid][listitem]);
  2262.             format(iteminfo, sizeof(iteminfo), "{AAC5E3}Zarządzanie {B3D341}»{AAC5E3} %s", Przedmiot[ListItem[playerid][listitem]][iNazwa]);
  2263.             return dShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, iteminfo, "1\tOdłóż przedmiot\n2\tOddaj za darmo osobie w pobliżu\n3\tSprzedaj osobie w pobliżu\n4\tWłóż do torby\n5\tWłóż do szafy\n6\tPokaż informacje", "Wybierz", "Anuluj");
  2264.         }
  2265.         return UseItem(playerid, ListItem[playerid][listitem]);
  2266.     }
  2267.     else if(dialogid == 3)
  2268.     {
  2269.         if(!response) return 1;
  2270.         switch(listitem)
  2271.         {
  2272.             case 0:
  2273.             {
  2274.                 if(Przedmiot[GetPVarInt(playerid, "ItemList")][iAktywny] == 1 && Przedmiot[GetPVarInt(playerid, "ItemList")][iOwner] == 1 && Przedmiot[GetPVarInt(playerid, "ItemList")][iOwnerUID] == Player[playerid][pUID])
  2275.                 {
  2276.                     if(Przedmiot[GetPVarInt(playerid, "ItemList")][iUsed] == 1)
  2277.                         return Info(playerid, "Przedmiot jest aktualnie używany przez Twoją postać.");
  2278.                     if(!IsPlayerInAnyVehicle(playerid))
  2279.                     {
  2280.                         new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  2281.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iPosX]      = Pos[0];
  2282.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iPosY]      = Pos[1];
  2283.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iPosZ]      = Pos[2]-0.95;
  2284.                         ItemObiekt[GetPVarInt(playerid, "ItemList")] = CreateObject(GetItemModel(GetPVarInt(playerid, "ItemList")), Przedmiot[GetPVarInt(playerid, "ItemList")][iPosX], Przedmiot[GetPVarInt(playerid, "ItemList")][iPosY], Przedmiot[GetPVarInt(playerid, "ItemList")][iPosZ], ItemRotX(GetPVarInt(playerid, "ItemList")), 0, 0, GetPlayerVirtualWorld(playerid));
  2285.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iOwner]     = 7;
  2286.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iOwnerUID]  = 0;
  2287.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iVir]       = GetPlayerVirtualWorld(playerid);
  2288.                         format(String, sizeof(String), "* %s odkłada przedmiot na ziemię.", CharName(playerid));
  2289.                     }
  2290.                     else
  2291.                     {
  2292.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iOwner]     = 2;
  2293.                         Przedmiot[GetPVarInt(playerid, "ItemList")][iOwnerUID]  = CarUID(GetPlayerVehicleID(playerid));
  2294.                         format(String, sizeof(String), "* %s odkłada przedmiot w pojeździe.", CharName(playerid));
  2295.                     }
  2296.                     ZapiszPrzedmiot(GetPVarInt(playerid, "ItemList"));
  2297.                     return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  2298.                 }
  2299.                 return InfoBoxShow(2, playerid, "Ten ~y~przedmiot~w~ nie jest Twoja wlasnoscia.", 3);
  2300.             }
  2301.             case 5:
  2302.             {
  2303.                 new id = GetPVarInt(playerid, "ItemList"), status[16], iteminfo[64], waga[64], flaga[32];
  2304.                 if(Przedmiot[id][iAktywny] == 1)
  2305.                 {
  2306.                     format(iteminfo, sizeof(iteminfo), "{AAC5E3}Informacje {B3D341}»{AAC5E3} %s", Przedmiot[id][iNazwa]);
  2307.                     if(Przedmiot[id][iUsed] == 1)
  2308.                     status = "Aktywny";
  2309.                     else
  2310.                     status = "Nieaktywny";
  2311.                     if(Przedmiot[id][iTyp] == 1)
  2312.                     {
  2313.                         format(waga, sizeof(waga), "(%dg)", Przedmiot[id][iWartosc2] * 3);
  2314.                     }
  2315.                     if(Przedmiot[id][iFlaga] == 0)
  2316.                     flaga = "Brak oflagowania";
  2317.                     else
  2318.                     format(flaga, sizeof(flaga), "%d", Przedmiot[id][iFlaga]);
  2319.                     format(String, sizeof(String), "Identyfikator:\t\t%d\nTyp:\t\t\t%s\n\nStatus:\t\t\t%s\nWaga:\t\t\t%dg %s\n\nWartość 1:\t\t%d\nWartość 2:\t\t%d\nFlaga dla grupy:\t%s", id, PrzedmiotTyp(id), status, Przedmiot[id][iWaga], waga, Przedmiot[id][iWartosc1], Przedmiot[id][iWartosc2], flaga);
  2320.                     return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, iteminfo, String, "Rozumiem", "");
  2321.                 }
  2322.                 return InfoBoxShow(2, playerid, "Ten ~y~przedmiot~w~ nie jest Twoja wlasnoscia.", 3);
  2323.             }
  2324.         }
  2325.         return 1;
  2326.     }
  2327.     else if(dialogid == 4)
  2328.     {
  2329.         if(!response) return 1;
  2330.         new uid;
  2331.         if(sscanf(inputtext, "d", uid))
  2332.             return dShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj UID przedmiotu, którym chcesz zarządzać.\nBłąd: Tylko liczby.", "Dalej", "Anuluj");
  2333.         SetPVarInt(playerid, "rpItemEdit", uid);
  2334.         if(Przedmiot[uid][iAktywny] == 0)
  2335.             return Info(playerid, "Taki przedmiot nie jest aktywny, nie możesz go w żaden sposób edytować.");
  2336.         return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2337.     }
  2338.     else if(dialogid == DIALOG_ITEM_EDIT)
  2339.     {
  2340.         if(!response) return 1;
  2341.         switch(listitem)
  2342.         {
  2343.             case 0:  return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+1, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Aby dodać nowy przedmiot, uzupełnij poniżesze pola.\n[typ] [wartość 1] [wartość 2] [owner] [owner UID] [waga] [nazwa]", "Dalej", "Anuluj");
  2344.             case 1:  return dShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj UID przedmiotu, którym chcesz zarządzać.", "Dalej", "Anuluj");
  2345.         }
  2346.     }
  2347.     else if(dialogid == DIALOG_ITEM_EDIT+1)
  2348.     {
  2349.         if(!response) return 1;
  2350.         new Nazwa[256], Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga;
  2351.         if(sscanf(inputtext, "dddddds[256]", Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga, Nazwa))
  2352.             return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+1, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Aby dodać nowy przedmiot, uzupełnij poniżesze pola.\n[typ] [wartość 1] [wartość 2] [owner] [owner UID] [waga] [nazwa]", "Dalej", "Anuluj");
  2353.         Tip(playerid, "Przedmiot został stworzony pomyślnie.");
  2354.         return DodajPrzedmiot(playerid, Nazwa, Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga);
  2355.     }
  2356.     else if(dialogid == DIALOG_ITEM_EDIT+2)
  2357.     {
  2358.         if(!response) return 1;
  2359.         switch(listitem)
  2360.         {
  2361.             case 0: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+3, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową nazwę dla tego przedmiotu", "Dalej", "Anuluj");
  2362.             case 1: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
  2363.             case 2: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+5, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tBroń\n2\tUbranie\n3\tŻywność\n4\tBrak typu\n5\tKomponenty zewnętrzne\n6\tNarkotyki\n7\tRękawiczki\n8\tMaska\n9\tMedykamenty\n10\tMegafon\n11\tKajdanki\n12\tCzęści / Akcesoria dające pojazdom HP\n13\tKomponenty wewnętrzne", "Dalej", "Anuluj");
  2364.             case 3: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+6, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości właściciela dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
  2365.             case 4:
  2366.             {
  2367.                 new id = GetPVarInt(playerid, "rpItemEdit"), status[16], iteminfo[64], flaga[32];
  2368.                 format(iteminfo, sizeof(iteminfo), "{AAC5E3}Informacje {B3D341}»{AAC5E3} %s", Przedmiot[id][iNazwa]);
  2369.                 if(Przedmiot[id][iUsed] == 1)
  2370.                 status = "Aktywny";
  2371.                 else
  2372.                 status = "Nieaktywny";
  2373.                 if(Przedmiot[id][iFlaga] == 0)
  2374.                 flaga = "Brak oflagowania";
  2375.                 else
  2376.                 format(flaga, sizeof(flaga), "%d", Przedmiot[id][iFlaga]);
  2377.                 format(String, sizeof(String), "Identyfikator:\t\t%d\nTyp:\t\t\t%s\n\nStatus:\t\t\t%s\nWaga:\t\t\t%dg\n\nWartość 1:\t\t%d\nWartość 2:\t\t%d\nFlaga dla grupy:\t%s", id, PrzedmiotTyp(id), status, Przedmiot[id][iWaga], Przedmiot[id][iWartosc1], Przedmiot[id][iWartosc2], flaga);
  2378.                 return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, iteminfo, String, "Rozumiem", "");
  2379.             }
  2380.             case 5:
  2381.             {
  2382.                 if(Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iAktywny] == 1)
  2383.                 {
  2384.                     Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iAktywny] = 0;
  2385.                     ZapiszPrzedmiot(GetPVarInt(playerid, "rpItemEdit"));
  2386.                     return Tip(playerid, "Przedmiot został usunięty.");
  2387.                 }
  2388.                 else
  2389.                 {
  2390.                     return Info(playerid, "Taki przedmiot nie istnieje.");
  2391.                 }
  2392.             }
  2393.             case 6: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+7, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową wagę przedmiotu:\n[waga]", "Dalej", "Anuluj");
  2394.             case 7: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+8, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości oflagowania:\n[typ {1 - gracz} {2 - grupa}][identyfikator]", "Dalej", "Anuluj");
  2395.         }
  2396.     }
  2397.     else if(dialogid == DIALOG_ITEM_EDIT+3)
  2398.     {
  2399.         if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2400.         new nazwa[256];
  2401.         if(sscanf(inputtext, "s[256]", nazwa))
  2402.             return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+3, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową nazwę dla tego przedmiotu", "Dalej", "Anuluj");
  2403.         strmid(Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iNazwa], nazwa, 0, 32, 32);
  2404.         dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2405.         return Tip(playerid, "Nazwa przedmiotu została zmieniona.");
  2406.     }
  2407.     else if(dialogid == DIALOG_ITEM_EDIT+4)
  2408.     {
  2409.         if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2410.         new wartosc1, wartosc2;
  2411.         if(sscanf(inputtext, "dd", wartosc1, wartosc2))
  2412.             return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
  2413.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iWartosc1] = wartosc1;
  2414.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iWartosc2] = wartosc2;
  2415.         dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2416.         return Tip(playerid, "Wartości przedmiotu zostały zmienione.");
  2417.     }
  2418.     else if(dialogid == DIALOG_ITEM_EDIT+5)
  2419.     {
  2420.         if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2421.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iTyp] = listitem+1;
  2422.         dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie", "Dalej", "Anuluj");
  2423.         return Tip(playerid, "Typ przedmiotu został zmieniony.");
  2424.     }
  2425.     else if(dialogid == DIALOG_ITEM_EDIT+6)
  2426.     {
  2427.         if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2428.         new wartosc1, wartosc2;
  2429.         if(sscanf(inputtext, "dd", wartosc1, wartosc2))
  2430.             return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+6, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości właściciela dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
  2431.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iOwner] = wartosc1;
  2432.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iOwnerUID] = wartosc2;
  2433.         dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie", "Dalej", "Anuluj");
  2434.         return Tip(playerid, "Właściciel przedmiotu został zmieniony.");
  2435.     }
  2436.     else if(dialogid == DIALOG_ITEM_EDIT+7)
  2437.     {
  2438.         if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2439.         new wartosc1;
  2440.         if(sscanf(inputtext, "d", wartosc1))
  2441.             return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+7, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową wagę przedmiotu:\n[waga]", "Dalej", "Anuluj");
  2442.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iWaga] = wartosc1;
  2443.         dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2444.         return Tip(playerid, "Waga przedmiotu została zmieniona.");
  2445.     }
  2446.     else if(dialogid == DIALOG_ITEM_EDIT+8)
  2447.     {
  2448.         if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
  2449.         new wartosc1, wartosc2;
  2450.         if(sscanf(inputtext, "dd", wartosc1, wartosc2))
  2451.             return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+8, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości oflagowania:\n[typ {1 - gracz} {2 - grupa}][identyfikator]", "Dalej", "Anuluj");
  2452.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iFlaga] = wartosc1;
  2453.         Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iFlagaUID] = wartosc2;
  2454.         dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie", "Dalej", "Anuluj");
  2455.         return Tip(playerid, "Flagi przedmiotu zostały zmienione.");
  2456.     }
  2457.     //tworzenie postaci
  2458.     else if(dialogid == 50)
  2459.     {
  2460.         if(response)
  2461.         {
  2462.             dShowPlayerDialog(playerid, 51, DIALOG_STYLE_INPUT, ""ServName"Tworzenie postaci", "Znajdujesz się w kreatorze tworzenia postaci oraz podpisywania jej pod konto globalne na forum.\nPodaj identyfikator (UID) konta globalnego, do którego chcesz przypisać tą postać.", "Dalej", "Anuluj");
  2463.         }
  2464.         else
  2465.         {
  2466.             Kick(playerid);
  2467.         }
  2468.         return 1;
  2469.     }
  2470.     else if(dialogid == 51)
  2471.     {
  2472.         new idenfytikator = 0;
  2473.         if(!response) return Kick(playerid);
  2474.         if(sscanf(inputtext, "d", idenfytikator))
  2475.             return dShowPlayerDialog(playerid, 51, DIALOG_STYLE_INPUT, ""ServName"Tworzenie postaci", "Podany przez Ciebie identyfikator postaci jest błędny.\nPodaj identyfikator (UID) konta globalnego, do którego chcesz przypisać tą postać.", "Dalej", "Anuluj");
  2476.         new query[128], query2[128];
  2477.         format(query, sizeof(query), "SELECT `member_id`,`members_display_name`,`members_pass_salt` FROM `members` WHERE `member_id` =%d", idenfytikator);
  2478.         mysql_query_ex(query);
  2479.         mysql_store_result();
  2480.         if(mysql_num_rows() == 0)
  2481.         {
  2482.             dShowPlayerDialog(playerid, 51, DIALOG_STYLE_INPUT, ""ServName"Tworzenie postaci", "Takie konto nie istnieje.\nPodaj identyfikator (UID) konta globalnego, do którego chcesz przypisać tą postać.", "Dalej", "Anuluj");
  2483.         }
  2484.         else
  2485.         {
  2486.             mysql_fetch_row_format(query2);
  2487.             sscanf(query2, "p<|>ds[64]s[64]", Player[playerid][pGID], Player[playerid][pName], Player[playerid][pSalt]);
  2488.             format(String, sizeof(String), "Aby podpisać tą postać pod konto globalne %s, podaj hasło.", Player[playerid][pName]), dShowPlayerDialog(playerid, 52, DIALOG_STYLE_PASSWORD, ""ServName"Tworzenie postaci", String, "Dalej", "Anuluj");
  2489.         }
  2490.         mysql_free_result();
  2491.         return 1;
  2492.     }
  2493.     else if(dialogid == 52)
  2494.     {
  2495.         if(response)
  2496.         {
  2497.             new password[64], data[128], hashex[100], query[512];
  2498.             format(password, sizeof(password), "%s", inputtext);
  2499.             format(hashex, sizeof(hashex), "%s%s", MD5_Hash(Player[playerid][pSalt]), MD5_Hash(password));
  2500.  
  2501.             format(query, sizeof(query), "SELECT `gamescore`,`premium`,`ban_uid`,`member_group_id`,`ban_time` FROM `members` WHERE members_pass_hash = md5('%s') AND member_id = '%d' LIMIT 1", hashex, Player[playerid][pGID]);
  2502.             mysql_query_ex(query);
  2503.             mysql_store_result();
  2504.             if(mysql_fetch_row_format(data, "|"))
  2505.             {
  2506.                 sscanf(data, "p<|>ddddd", IPB[playerid][ipb_GameScore], IPB[playerid][ipb_Premium], IPB[playerid][ipb_Ban], IPB[playerid][ipb_Grupa], IPB[playerid][ipb_BanTime]);
  2507.                 SetPlayerScore(playerid, IPB[playerid][ipb_GameScore]);
  2508.                 printf("%d, %d", IPB[playerid][ipb_Ban], IPB[playerid][ipb_BanTime]);
  2509.                 mysql_free_result();
  2510.                 if(IPB[playerid][ipb_Grupa] == 5 || IPB[playerid][ipb_Ban] != 0 && gettime() < IPB[playerid][ipb_BanTime])
  2511.                 {
  2512.                     SendClientMessage(playerid, -1, "Konto globalne, na które właśnie się zalogowałeś posiada status osoby {BB0000}zbanowanej{FFFFFF}.");
  2513.                     format(String, sizeof(String), "Z powyższego powodu proces tworzenia nowej postaci dla konta globalnego %s (UID: %d) zostaje przerwany.", Player[playerid][pName], Player[playerid][pGID]);
  2514.                     SendClientMessage(playerid, -1, String);
  2515.                     return KickWithMessage(playerid, -1, "Jeżeli nie zgadzasz się z nałożoną na Ciebie karą, napisz odwołanie na forum (page-rp.pl).");
  2516.                 }
  2517.                 dShowPlayerDialog(playerid, 53, DIALOG_STYLE_LIST, ""ServName"Tworzenie postaci (1/3)", "Mężczyzna\nKobieta", "Dalej", "Anuluj");
  2518.             }
  2519.             else
  2520.             {
  2521.                 mysql_free_result();
  2522.                 format(String, sizeof(String), "Aby podpisać tą postać pod konto globalne %s, podaj poprawne hasło.", Player[playerid][pName]), dShowPlayerDialog(playerid, 52, DIALOG_STYLE_PASSWORD, ""ServName"Tworzenie postaci", String, "Dalej", "Anuluj");
  2523.             }
  2524.         }
  2525.         return 1;
  2526.     }
  2527.     else if(dialogid == 53)
  2528.     {
  2529.         if(!response) return Kick(playerid);
  2530.         switch(listitem)
  2531.         {
  2532.             case 0:
  2533.             {
  2534.                 SetPVarInt(playerid, "CharCreate1", CHAR_SEX_MALE);
  2535.             }
  2536.             case 1:
  2537.             {
  2538.                 SetPVarInt(playerid, "CharCreate1", CHAR_SEX_FEMALE);
  2539.             }
  2540.         }
  2541.         return dShowPlayerDialog(playerid, 54, DIALOG_STYLE_LIST, ""ServName"Tworzenie postaci (2/3)", "{AAC5E3}Przedmioty startowe I{FFFFFF}\n\t$250\n\tTelefon komórkowy\n{AAC5E3}Przedmioty startowe II{FFFFFF}\n\t$100\n\tDokumenty postaci\n{AAC5E3}Przedmioty startowe III{FFFFFF}\n\t350$", "Dalej", "Anuluj");
  2542.     }
  2543.     else if(dialogid == 54)
  2544.     {
  2545.         new query[256];
  2546.         SetPVarInt(playerid, "CharCreate2", 0);
  2547.         if(!response) return Kick(playerid);
  2548.         if(listitem == 0)
  2549.         {
  2550.             SetPVarInt(playerid, "CharCreate2", 1);
  2551.         }
  2552.         else if(listitem == 3)
  2553.         {
  2554.             SetPVarInt(playerid, "CharCreate2", 2);
  2555.         }
  2556.         else if(listitem == 6)
  2557.         {
  2558.             SetPVarInt(playerid, "CharCreate2", 3);
  2559.         }
  2560.         else
  2561.         {
  2562.             dShowPlayerDialog(playerid, 54, DIALOG_STYLE_LIST, ""ServName"Tworzenie postaci (2/3)", "{F8E394}Przedmioty startowe I{FFFFFF}\n\t$250\n\tTelefon komórkowy\n{F8E394}Przedmioty startowe II{FFFFFF}\n\t$100\n\tDokumenty postaci\n{F8E394}Przedmioty startowe III{FFFFFF}\n\t350$", "Dalej", "Anuluj");
  2563.         }
  2564.         if(GetPVarInt(playerid, "CharCreate2") != 0)
  2565.         {
  2566.             if(GetPVarInt(playerid, "CharCreate1") == CHAR_SEX_MALE)
  2567.             {
  2568.                 format(query, sizeof(query), "INSERT INTO `1postacie` (`nick`,`skin`,`owneruid`,`plec`) VALUES ('%s', '%d', '%d', '%d')", NickSAMP(playerid), Random_Skin_Male[random(sizeof(Random_Skin_Male))], Player[playerid][pGID], GetPVarInt(playerid, "CharCreate1"));
  2569.             }
  2570.             else
  2571.             {
  2572.                 format(query, sizeof(query), "INSERT INTO `1postacie` (`nick`,`skin`,`owneruid`,`plec`) VALUES ('%s', '%d', '%d', '%d')", NickSAMP(playerid), Random_Skin_Female[random(sizeof(Random_Skin_Female))], Player[playerid][pGID], GetPVarInt(playerid, "CharCreate1"));
  2573.             }
  2574.         }
  2575.         mysql_query_ex(query);
  2576.         //ostatnia postać `members`
  2577.         format(query, sizeof(query), "UPDATE `members` SET `lastchar`=%d WHERE member_id = '%d'", mysql_insert_id(), Player[playerid][pGID]);
  2578.         mysql_query_ex(query);
  2579.         return OnPlayerConnect(playerid), Player[playerid][pPakiet] = GetPVarInt(playerid, "CharCreate2");
  2580.     }
  2581.     else if(dialogid == 55)
  2582.     {
  2583.         if(!response) return 1;
  2584.  
  2585.         new query[256];
  2586.  
  2587.         switch(listitem)
  2588.         {
  2589.             case 0://Konto premium 7 dni
  2590.             {
  2591.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_1))
  2592.                     return Info(playerid, "Na twoim koncie jest już aktywna usługa {B3D341}Konto premium (7 dni){AAC5E3}.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2593.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_1)
  2594.                 {
  2595.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2596.                 }
  2597.                 else
  2598.                 {
  2599.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_1;
  2600.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_1;
  2601.                     Global_Data_Save(playerid);
  2602.                     Info(playerid, "Zakup usługi {B3D341}Konto premium (7 dni){AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2603.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 1, Player[playerid][pIP]);
  2604.                     mysql_query_ex(query);
  2605.                 }
  2606.                 return 1;
  2607.             }
  2608.             case 1://konto premium 14 dni
  2609.             {
  2610.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_2))
  2611.                     return Info(playerid, "Na twoim koncie jest już aktywna usługa {B3D341}Konto premium (14 dni){AAC5E3}.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2612.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_2)
  2613.                 {
  2614.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2615.                 }
  2616.                 else
  2617.                 {
  2618.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_2;
  2619.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_2;
  2620.                     Global_Data_Save(playerid);
  2621.                     Info(playerid, "Zakup usługi {B3D341}Konto premium (14 dni){AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2622.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 2, Player[playerid][pIP]);
  2623.                     mysql_query_ex(query);
  2624.                 }
  2625.                 return 1;
  2626.             }
  2627.             case 2://Konto premium 31 dni
  2628.             {
  2629.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_3))
  2630.                     return Info(playerid, "Na twoim koncie jest już aktywna usługa {B3D341}Konto premium (31 dni){AAC5E3}.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2631.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_3)
  2632.                 {
  2633.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2634.                 }
  2635.                 else
  2636.                 {
  2637.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_3;
  2638.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_3;
  2639.                     Global_Data_Save(playerid);
  2640.                     Info(playerid, "Zakup usługi {B3D341}Konto premium (31 dni){AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2641.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 3, Player[playerid][pIP]);
  2642.                     mysql_query_ex(query);
  2643.                 }
  2644.                 return 1;
  2645.             }
  2646.             case 3://Przedmiot
  2647.             {
  2648.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_4))
  2649.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2650.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_4)
  2651.                 {
  2652.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2653.                 }
  2654.                 else
  2655.                 {
  2656.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_4;
  2657.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_4;
  2658.                     Global_Data_Save(playerid);
  2659.                     Info(playerid, "Zakup usługi {B3D341}Stworzenie przedmiotu{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2660.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 4, Player[playerid][pIP]);
  2661.                     mysql_query_ex(query);
  2662.                 }
  2663.                 return 1;
  2664.             }
  2665.             case 4://Blokada postaci
  2666.             {
  2667.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_5))
  2668.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2669.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_5)
  2670.                 {
  2671.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2672.                 }
  2673.                 else
  2674.                 {
  2675.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_5;
  2676.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_5;
  2677.                     Global_Data_Save(playerid);
  2678.                     Info(playerid, "Zakup usługi {B3D341}Blokada postaci{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2679.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 5, Player[playerid][pIP]);
  2680.                     mysql_query_ex(query);
  2681.                 }
  2682.                 return 1;
  2683.             }
  2684.             case 5://Edycja profilu
  2685.             {
  2686.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_6))
  2687.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2688.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_6)
  2689.                 {
  2690.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2691.                 }
  2692.                 else
  2693.                 {
  2694.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_6;
  2695.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_6;
  2696.                     Global_Data_Save(playerid);
  2697.                     Info(playerid, "Zakup usługi {B3D341}Edycja profilu CSS i HTML{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2698.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 6, Player[playerid][pIP]);
  2699.                     mysql_query_ex(query);
  2700.                 }
  2701.                 return 1;
  2702.             }
  2703.             case 6://Nowa grupa
  2704.             {
  2705.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_7))
  2706.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2707.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_7)
  2708.                 {
  2709.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2710.                 }
  2711.                 else
  2712.                 {
  2713.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_7;
  2714.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_7;
  2715.                     Global_Data_Save(playerid);
  2716.                     Info(playerid, "Zakup usługi {B3D341}Stworzenie nowej grupy{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2717.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 7, Player[playerid][pIP]);
  2718.                     mysql_query_ex(query);
  2719.                 }
  2720.                 return 1;
  2721.             }
  2722.             case 7://Etykiety
  2723.             {
  2724.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_8))
  2725.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2726.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_8)
  2727.                 {
  2728.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2729.                 }
  2730.                 else
  2731.                 {
  2732.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_8;
  2733.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_8;
  2734.                     Global_Data_Save(playerid);
  2735.                     Info(playerid, "Zakup usługi {B3D341}10 etykiet tekstowych{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2736.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 8, Player[playerid][pIP]);
  2737.                     mysql_query_ex(query);
  2738.                 }
  2739.                 return 1;
  2740.             }
  2741.             case 8://Zmiana tożsamości
  2742.             {
  2743.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_9))
  2744.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2745.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_9)
  2746.                 {
  2747.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2748.                 }
  2749.                 else
  2750.                 {
  2751.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_9;
  2752.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_9;
  2753.                     Global_Data_Save(playerid);
  2754.                     Info(playerid, "Zakup usługi {B3D341}Zmiana tożsamości{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2755.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 9, Player[playerid][pIP]);
  2756.                     mysql_query_ex(query);
  2757.                 }
  2758.                 return 1;
  2759.             }
  2760.             case 9://Kasacja postaci
  2761.             {
  2762.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_10))
  2763.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2764.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_10)
  2765.                 {
  2766.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2767.                 }
  2768.                 else
  2769.                 {
  2770.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_10;
  2771.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_10;
  2772.                     Global_Data_Save(playerid);
  2773.                     Info(playerid, "Zakup usługi {B3D341}Usunięcie postaci{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2774.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 10, Player[playerid][pIP]);
  2775.                     mysql_query_ex(query);
  2776.                 }
  2777.                 return 1;
  2778.             }
  2779.             case 10://Własny interior
  2780.             {
  2781.                 if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_11))
  2782.                     return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
  2783.                 if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_11)
  2784.                 {
  2785.                     Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
  2786.                 }
  2787.                 else
  2788.                 {
  2789.                     IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_11;
  2790.                     IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_11;
  2791.                     Global_Data_Save(playerid);
  2792.                     Info(playerid, "Zakup usługi {B3D341}Własny interior{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
  2793.                     format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 11, Player[playerid][pIP]);
  2794.                     mysql_query_ex(query);
  2795.                 }
  2796.                 return 1;
  2797.             }
  2798.         }
  2799.         return 1;
  2800.     }
  2801.     else if(dialogid == 56)
  2802.     {
  2803.         if(!response) return 1;
  2804.         new pakiet = 0, query[512];
  2805.         if(sscanf(inputtext, "d", pakiet))
  2806.             return Info(playerid, "Taki pakiet nie istnieje.\nTransakcja zostaje przerwana.");
  2807.         if(pakiet == 1)
  2808.         {
  2809.             if(IPB[playerid][ipb_GameScore] < 300)
  2810.                 return Info(playerid, "Nie posiadasz wystarczającej ilości punktów GameScore.\nZakup wirtualnych € zostaje przerwany.");
  2811.             IPB[playerid][ipb_PremiumScore] += 10;
  2812.             IPB[playerid][ipb_GameScore] -= 300;
  2813.             format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], -1, Player[playerid][pIP]);
  2814.             mysql_query_ex(query);
  2815.             return Info(playerid, "Transakcja zakończona sukcesem.\nNa Twoje konto trafiło 10 wirtualnych €."), Global_Data_Save(playerid);
  2816.         }
  2817.         else if(pakiet == 2)
  2818.         {
  2819.             if(IPB[playerid][ipb_GameScore] < 600)
  2820.                 return Info(playerid, "Nie posiadasz wystarczającej ilości punktów GameScore.\nZakup wirtualnych € zostaje przerwany.");
  2821.             IPB[playerid][ipb_PremiumScore] += 25;
  2822.             IPB[playerid][ipb_GameScore] -= 600;
  2823.             format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], -2, Player[playerid][pIP]);
  2824.             mysql_query_ex(query);
  2825.             return Info(playerid, "Transakcja zakończona sukcesem.\nNa Twoje konto trafiło 25 wirtualnych €."), Global_Data_Save(playerid);
  2826.         }
  2827.         else if(pakiet == 3)
  2828.         {
  2829.             if(IPB[playerid][ipb_GameScore] < 110)
  2830.                 return Info(playerid, "Nie posiadasz wystarczającej ilości punktów GameScore.\nZakup wirtualnych € zostaje przerwany.");
  2831.             IPB[playerid][ipb_PremiumScore] += 50;
  2832.             IPB[playerid][ipb_GameScore] -= 1100;
  2833.             format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], -3, Player[playerid][pIP]);
  2834.             mysql_query_ex(query);
  2835.             return Info(playerid, "Transakcja zakończona sukcesem.\nNa Twoje konto trafiło 50 wirtualnych €."), Global_Data_Save(playerid);
  2836.         }
  2837.         return Info(playerid, "Taki pakiet nie istnieje.\nTransakcja zostaje przerwana.");
  2838.     }
  2839.     else if(dialogid == 57)
  2840.     {
  2841.         if(!response) return 1;
  2842.         if(!strcmp(inputtext, "»   Konto premium (7 dni)", true))
  2843.         {
  2844.             if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_1))
  2845.             {
  2846.                 if(IPB[playerid][ipb_Premium] == 0 || IPB[playerid][ipb_Premium] < gettime())
  2847.                 {
  2848.                     IPB[playerid][ipb_Premium] = gettime() + (7 * DAY_SECOND);
  2849.                 }
  2850.                 else
  2851.                 {
  2852.                     IPB[playerid][ipb_Premium] += (7 * DAY_SECOND);
  2853.                 }
  2854.                 IPB[playerid][ipb_PremiumService] -= SERVICE_B_PREMIUM_1;
  2855.                 Info(playerid, "Aktywacja usługi {B3D341}Konto premium (7 dni){AAC5E3} przebiegła pomyślnie."), Global_Data_Save(playerid);
  2856.             }
  2857.             else
  2858.             {
  2859.                 Info(playerid, "Usługa {B3D341}Konto premium (7 dni){AAC5E3} nie została jeszcze zakupiona.");
  2860.             }
  2861.             return 1;
  2862.         }
  2863.         else if(!strcmp(inputtext, "»  Konto premium (14 dni)", true))
  2864.         {
  2865.             if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_2))
  2866.             {
  2867.                 if(IPB[playerid][ipb_Premium] == 0 || IPB[playerid][ipb_Premium] < gettime())
  2868.                 {
  2869.                     IPB[playerid][ipb_Premium] = gettime() + (14 * DAY_SECOND);
  2870.                 }
  2871.                 else
  2872.                 {
  2873.                     IPB[playerid][ipb_Premium] += (14 * DAY_SECOND);
  2874.                 }
  2875.                 IPB[playerid][ipb_PremiumService] -= SERVICE_B_PREMIUM_2;
  2876.                 Info(playerid, "Aktywacja usługi {B3D341}Konto premium (14 dni){AAC5E3} przebiegła pomyślnie."), Global_Data_Save(playerid);
  2877.             }
  2878.             else
  2879.             {
  2880.                 Info(playerid, "Usługa {B3D341}Konto premium (14 dni){AAC5E3} nie została jeszcze zakupiona.");
  2881.             }
  2882.             return 1;
  2883.         }
  2884.         else if(!strcmp(inputtext, "»  Konto premium (31 dni)", true))
  2885.         {
  2886.             if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_3))
  2887.             {
  2888.                 if(IPB[playerid][ipb_Premium] == 0 || IPB[playerid][ipb_Premium] < gettime())
  2889.                 {
  2890.                     IPB[playerid][ipb_Premium] = gettime() + (31 * DAY_SECOND);
  2891.                 }
  2892.                 else
  2893.                 {
  2894.                     IPB[playerid][ipb_Premium] += (31 * DAY_SECOND);
  2895.                 }
  2896.                 IPB[playerid][ipb_PremiumService] -= SERVICE_B_PREMIUM_3;
  2897.                 Info(playerid, "Aktywacja usługi {B3D341}Konto premium (31 dni){AAC5E3} przebiegła pomyślnie."), Global_Data_Save(playerid);
  2898.             }
  2899.             else
  2900.             {
  2901.                 Info(playerid, "Usługa {B3D341}Konto premium (31 dni){AAC5E3} nie została jeszcze zakupiona.");
  2902.             }
  2903.             return 1;
  2904.         }
  2905.         return 1;
  2906.     }
  2907.     else if(dialogid == 100)
  2908.     {
  2909.         if(!response) return 1;
  2910.         if(Przedmiot[ListItem[playerid][listitem+1]][iAktywny] == 1 && Przedmiot[ListItem[playerid][listitem+1]][iOwner] == 7)
  2911.         {
  2912.             if(ItemWaga(playerid) + Przedmiot[ListItem[playerid][listitem+1]][iWaga] > ItemUdzwig(playerid))
  2913.                 return Info(playerid, "Nie masz wystarczającej siły, aby podnieść ten przedmiot.");
  2914.             Przedmiot[ListItem[playerid][listitem+1]][iOwner] = 1;
  2915.             Przedmiot[ListItem[playerid][listitem+1]][iOwnerUID] = Player[playerid][pUID];
  2916.             ZapiszPrzedmiot(ListItem[playerid][listitem+1]);
  2917.             format(String, sizeof(String), "* %s podnosi przedmiot %s.", CharName(playerid), Przedmiot[ListItem[playerid][listitem+1]][iNazwa]);
  2918.             DestroyObject(ItemObiekt[ListItem[playerid][listitem+1]]);
  2919.             return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  2920.         }
  2921.         return 1;
  2922.     }
  2923.     else if(dialogid == 101)
  2924.     {
  2925.         if(!response) return 1;
  2926.         if(listitem == 0) return 1;
  2927.         if(Przedmiot[ListItem[playerid][listitem+1]][iAktywny] == 1 && Przedmiot[ListItem[playerid][listitem+1]][iOwner] == 1 && Przedmiot[ListItem[playerid][listitem+1]][iOwnerUID] == Player[playerid][pUID])
  2928.         {
  2929.             Przedmiot[ListItem[playerid][listitem+1]][iWartosc2] += Przedmiot[GetPVarInt(playerid, "AmunicjaUID")][iWartosc2];
  2930.             Przedmiot[GetPVarInt(playerid, "AmunicjaUID")][iAktywny] = 0;
  2931.             ZapiszPrzedmiot(GetPVarInt(playerid, "AmunicjaUID"));
  2932.             ZapiszPrzedmiot(ListItem[playerid][listitem+1]);
  2933.             format(String, sizeof(String), "* %s uzupełnia przedmiot %s.", CharName(playerid), Przedmiot[ListItem[playerid][listitem+1]][iNazwa]);
  2934.             return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  2935.         }
  2936.         return 1;
  2937.     }
  2938.     else if(dialogid == 110)
  2939.     {
  2940.         if(!response) return 1;
  2941.         if(pDrzwiOwner(playerid, GetPVarInt(playerid, "rpDrzwi")) == 0)
  2942.             return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  2943.         Drzwi[GetPVarInt(playerid, "rpDrzwi")][dOwner]      = OWNER_GROUP;
  2944.         Drzwi[GetPVarInt(playerid, "rpDrzwi")][dOwnerUID]   = ListItem[playerid][listitem];
  2945.         return Info(playerid, "Drzwi zostały pomyślnie podpisane pod grupę."), ZapiszDrzwi(GetPVarInt(playerid, "rpDrzwi"));
  2946.     }
  2947.     else if(dialogid == 200)
  2948.     {
  2949.         if(!response) return 1;
  2950.         switch(listitem)
  2951.         {
  2952.             case 0: return dShowPlayerDialog(playerid, 201, DIALOG_STYLE_INPUT, ""ServName"Logi", "Podaj UID wpisu w celu jego dezaktywacji:", "Dalej", "Anuluj");
  2953.         }
  2954.         return 1;
  2955.     }
  2956.     else if(dialogid == 201)
  2957.     {
  2958.         new log, typ, char0, query[256], owner;
  2959.         if(!response) return 1;
  2960.         if(sscanf(inputtext, "d", log))
  2961.         {
  2962.  
  2963.             return 1;//błąd
  2964.         }
  2965.         format(query, sizeof(query), "SELECT `typ`,`char`,`owner` FROM `1logi` WHERE `uid`=%d", log);
  2966.         mysql_query_ex(query);
  2967.         mysql_store_result();
  2968.         if(mysql_num_rows() != 0)
  2969.         {
  2970.             mysql_fetch_row_format(query);
  2971.             sscanf(query, "p<|>ddd", typ, char0, owner);
  2972.         }
  2973.         mysql_free_result();
  2974.         if(typ == 2)
  2975.         {
  2976.             format(query, sizeof(query), "UPDATE `members` SET `ban_time`=0 WHERE `member_id`=%d", owner);
  2977.             mysql_query_ex(query);
  2978.         }
  2979.         else if(typ == 3 || typ == 7)
  2980.         {
  2981.             format(query, sizeof(query), "UPDATE `1postacie` SET `konto`=1 WHERE `uid`=%d", char0);
  2982.             mysql_query_ex(query);
  2983.         }
  2984.         format(query, sizeof(query), "UPDATE `1logi` SET `expires`=0, `dezprzez`=%d WHERE `uid`=%d", Player[playerid][pGID], log);
  2985.         mysql_query_ex(query);
  2986.         return 1;
  2987.     }
  2988.     else if(dialogid == 202)
  2989.     {
  2990.         if(!response) return 1;
  2991.         new nr = GetPVarInt(playerid, "rpDoorPickUp");
  2992.         switch(listitem)
  2993.         {
  2994.             case 0: Drzwi[nr][dPickup] = 1240;
  2995.             case 1: Drzwi[nr][dPickup] = 1242;
  2996.             case 2: Drzwi[nr][dPickup] = 1239;
  2997.             case 3: Drzwi[nr][dPickup] = 1272;
  2998.             case 4: Drzwi[nr][dPickup] = 1273;
  2999.             case 5: Drzwi[nr][dPickup] = 1212;
  3000.             case 6: Drzwi[nr][dPickup] = 1241;
  3001.             case 7: Drzwi[nr][dPickup] = 1247;
  3002.             case 8: Drzwi[nr][dPickup] = 1274;
  3003.             case 9: Drzwi[nr][dPickup] = 1275;
  3004.             case 10: Drzwi[nr][dPickup] = 1314;
  3005.             case 11: Drzwi[nr][dPickup] = 1318;
  3006.         }
  3007.         ZapiszDrzwi(nr);
  3008.         DestroyDynamicPickup(DrzwiPickup[nr]);
  3009.         return CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
  3010.     }
  3011.     else if(dialogid == 250)
  3012.     {
  3013.         if(!response) return 1;
  3014.         new d = GetPVarInt(playerid, "rpDrzwi");
  3015.         if(!strcmp(inputtext, "1    Zmień nazwę drzwi", true))
  3016.         {
  3017.             if(pDrzwiOwner(playerid, d) == 0)
  3018.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3019.             return dShowPlayerDialog(playerid, 251, DIALOG_STYLE_INPUT, ""ServName"Drzwi", "W poniższym polu możesz zmienić nazwę wyświetlaną drzwi.\nPamiętaj jednak, że zmiana kosztować Cię będzie $50.", "Dalej", "Anuluj");
  3020.         }
  3021.         else if(!strcmp(inputtext, "2   Pokaż informacje o drzwiach", true))
  3022.             return DoorInfo(playerid, d);
  3023.         else if(!strcmp(inputtext, "3   Przekaż budynek dla gracza", true))
  3024.         {
  3025.             if(pDrzwiOwner(playerid, d) == 0)
  3026.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3027.             return Tip(playerid, "Aby zaoferować komuś kupno budynku użyj komendy /o drzwi.");
  3028.         }
  3029.         else if(!strcmp(inputtext, "4   Przypisz budynek pod grupę", true))
  3030.         {
  3031.             if(pDrzwiOwner(playerid, d) == 0)
  3032.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3033.             new grupai[64], grupy[256], grupyx;
  3034.             for(new slot = 1; slot < 6; slot++)
  3035.             {
  3036.                 if(pGrupa[playerid][slot] != 0 && Grupa[pGrupa[playerid][slot]][gAktywna] == 1 && (pGrupaPerm[playerid][slot] & PERM_LEADER))
  3037.                 {
  3038.                     format(grupai, sizeof(grupai), "%d\t{FFFFFF}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
  3039.                     format(grupy, sizeof(grupy), "%s%s\n", grupy, grupai);
  3040.                     ListItem[playerid][grupyx] = pGrupa[playerid][slot];
  3041.                     grupyx ++;
  3042.                 }
  3043.             }
  3044.             if(!grupyx) return InfoBoxShow(2, playerid, "Twoja postac nie jest liderem zadnej grupy.", 3);
  3045.             return dShowPlayerDialog(playerid, 110, DIALOG_STYLE_LIST, ""ServName"Grupy", grupy, "Wybierz", "Anuluj");
  3046.         }
  3047.         else if(!strcmp(inputtext, "5   Przypisz budynek pod postać", true))
  3048.         {
  3049.             if(pDrzwiOwner(playerid, d) == 0)
  3050.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3051.             return Tip(playerid, "Ta funkcja została tymczasowo wyłączona.");
  3052.         }
  3053.         else if(!strcmp(inputtext, "6   Zmień pozycję wewnętrzną", true))
  3054.         {
  3055.             if(pDrzwiOwner(playerid, d) == 0)
  3056.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3057.             if(InDoor(playerid) != d)
  3058.                 return Info(playerid, "Musisz być we wnętrzu budynku, w którym chciałeś edytować pozycję.");
  3059.             GetPlayerPos(playerid, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]);
  3060.             GetPlayerFacingAngle(playerid, Drzwi[d][dWewRot]);
  3061.             return Info(playerid, "Pozycja wewnętrzna budynku została pomyślnie zmieniona.");
  3062.         }
  3063.         else if(!strcmp(inputtext, "7   Przypisz obiekty do drzwi", true))
  3064.         {
  3065.             if(pDrzwiOwner(playerid, d) == 0)
  3066.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3067.             return 1;
  3068.         }
  3069.         else if(!strcmp(inputtext, "8   Przypisz etykiety do drzwi", true))
  3070.         {
  3071.             if(pDrzwiOwner(playerid, d) == 0)
  3072.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3073.             return 1;
  3074.         }
  3075.         else if(!strcmp(inputtext, "9   Zmień interior (widoczność na świat)", true))
  3076.         {
  3077.             if(pDrzwiOwner(playerid, d) == 0)
  3078.                 return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
  3079.             return 1;
  3080.         }
  3081.         return 1;
  3082.     }
  3083.     else if(dialogid == 300)
  3084.     {
  3085.         if(!response) return 1;
  3086.         new zone = GetPVarInt(playerid, "rpAreaZone"), owner[128];
  3087.         if(!strcmp(inputtext, "1    Pokaż informacje o strefie", true))
  3088.         {
  3089.             if(GangZoneInfo[zone][gOwner] == OWNER_GROUP && Grupa[GangZoneInfo[zone][gOwnerUID]][gAktywna] == 1)
  3090.             {
  3091.                 format(owner, 128, "%s (UID: %d)", Grupa[GangZoneInfo[zone][gOwnerUID]][gNazwa], GangZoneInfo[zone][gOwnerUID]);
  3092.             }
  3093.             else
  3094.             {
  3095.                 format(owner, 128, "Brak właściciela, strefę można przejąć.");
  3096.             }
  3097.             format(String, sizeof(String), "Strefa:\t\t%s (UID: %d)\nWłaściciel:\t%s", GangZoneInfo[zone][gNazwa], zone, owner);
  3098.             return Info(playerid, String);
  3099.         }
  3100.         if(!strcmp(inputtext, "2    Przejmij strefę", true))
  3101.         {
  3102.             new grupai[64], grupy[256], grupyx;
  3103.             for(new slot = 1; slot < 6; slot++)
  3104.             {
  3105.                 if(pGrupa[playerid][slot] != 0 && Grupa[pGrupa[playerid][slot]][gAktywna] == 1 && (pGrupaPerm[playerid][slot] & PERM_LEADER))
  3106.                 {
  3107.                     if(GroupDoorInArea(pGrupa[playerid][slot], zone) > 1)
  3108.                     {
  3109.                         format(grupai, sizeof(grupai), "%d\t{FFFFFF}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
  3110.                         format(grupy, sizeof(grupy), "%s%s\n", grupy, grupai);
  3111.                         ListItem[playerid][grupyx] = pGrupa[playerid][slot];
  3112.                         grupyx ++;
  3113.                     }
  3114.                 }
  3115.             }
  3116.             if(!grupyx) return InfoBoxShow(2, playerid, "Twoja postac nie jest liderem zadnej grupy lub ta nie posiada wymaganej ilosci budynkow.", 3);
  3117.             return dShowPlayerDialog(playerid, 301, DIALOG_STYLE_LIST, "{AAC5E3}Wybierz grupę, dla której chcesz przejąć strefę.", grupy, "Wybierz", "Anuluj");
  3118.         }
  3119.         if(GangZoneInfo[zone][gOwner] == 2 && Grupa[GangZoneInfo[zone][gOwnerUID]][gAktywna] == 1)
  3120.         {
  3121.             if((pGrupaPerm[playerid][GrupaSlot(playerid, GangZoneInfo[zone][gOwnerUID])] & PERM_LEADER))
  3122.             {
  3123.                 if(!strcmp(inputtext, "3    Widoczność strefy", true))
  3124.                 {
  3125.                     //
  3126.                     return 1;
  3127.                 }
  3128.             }
  3129.             else
  3130.             {
  3131.                 Info(playerid, "Brak uprawnień do podglądu strefy.");
  3132.             }
  3133.         }
  3134.         return 1;
  3135.     }
  3136.     else if(dialogid == 301)
  3137.     {
  3138.         if(!response) return 1;
  3139.         if(GroupDoorInArea(ListItem[playerid][listitem], GetPVarInt(playerid, "rpAreaZone")) > 1)
  3140.         {
  3141.             GangZoneInfo[GetPVarInt(playerid, "rpAreaZone")][gOwner]        = OWNER_GROUP;
  3142.             GangZoneInfo[GetPVarInt(playerid, "rpAreaZone")][gOwnerUID]     = ListItem[playerid][listitem];
  3143.             Info(playerid, "Stefa została pomyślnie przejęta."), Zapisz_Strefe(GetPVarInt(playerid, "rpAreaZone"));
  3144.         }
  3145.         else
  3146.         {
  3147.             Info(playerid, "Aby przejąć daną strefę, grupa musi posiadać minimum dwa budynki na jej terenie.");
  3148.         }
  3149.         return 1;
  3150.     }
  3151.     else if(dialogid == 500)
  3152.     {
  3153.         if(!response) return 1;
  3154.         new v = ListItem[playerid][listitem];
  3155.         if(Pojazd[v][vAktywny] == 1)
  3156.         {
  3157.             if(Pojazd[v][vSpawn] == 1)
  3158.             {
  3159.                 foreach(Player, p)
  3160.                 {
  3161.                     if(GetPlayerVehicleID(p) == PojazdModel[v])
  3162.                     {
  3163.                         return InfoBoxShow(2, playerid, "Nie mozesz odspawnowac tego ~y~pojazdu~w~, poniewaz ktos znajduje sie w srodku.", 3);
  3164.                     }
  3165.                     if(GetPVarInt(p, "OffeVeh") == PojazdModel[v])
  3166.                     {
  3167.                         SetPVarInt(p, "OffeVeh", 0);
  3168.                         SetPVarInt(p, "OffeVehTime", 0);
  3169.                         Tip(playerid, "Naprawa pojazdu została anulowana, pojazd został odspawnowany.");
  3170.                         TextDrawHideForPlayer(p, TDOffe[p]);
  3171.                         Offer[p][oBlock] = 0;
  3172.                     }
  3173.                 }
  3174.                 format(String, sizeof(String), "Odspawnowano pojazd ~y~%s~w~ (UID: %d).", GetVehicleName(v), v);
  3175.                 InfoBoxShow(2, playerid, String, 3);
  3176.                 UpdateDynamic3DTextLabelText(Text3D:Veh3DText[PojazdModel[v]], KOL_NAME, " ");
  3177.                 ZapiszPojazd(PojazdModel[v]);
  3178.                 DestroyVehicle(PojazdModel[v]);
  3179.                 Pojazd[v][vSpawn] = 0;
  3180.                 if(Pojazd[v][vOwner] == 1)
  3181.                 {
  3182.                     if(GetPVarInt(playerid, "VehicleSpawn") > 0)
  3183.                     {
  3184.                         SetPVarInt(playerid, "VehicleSpawn", GetPVarInt(playerid, "VehicleSpawn")-1);
  3185.                     }
  3186.                 }
  3187.                 else if(Pojazd[v][vOwner] == 2)
  3188.                 {
  3189.                     if(Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] > 0)
  3190.                     {
  3191.                         Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] = Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn]-1;
  3192.                     }
  3193.                 }
  3194.             }
  3195.             else
  3196.             {
  3197.                 if(Pojazd[v][vOwner] == 1)
  3198.                 {
  3199.                     if(GetPVarInt(playerid, "VehicleSpawn") == 4)
  3200.                         return InfoBoxShow(2, playerid, "Posiadasz maksymalna ilosc jednoczesnie zespawnowanych ~y~pojazdow~w~.", 3);
  3201.                 }
  3202.                 else if(Pojazd[v][vOwner] == 2)
  3203.                 {
  3204.                     if(Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] >= Grupa[Pojazd[v][vOwnerUID]][gVehLimit])
  3205.                         return InfoBoxShow(2, playerid, "Grupa posiada maksymalna ilosc jednoczesnie zespawnowanych ~y~pojazdow~w~.", 3);
  3206.                 }
  3207.                 PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
  3208.                 GetVehiclePos(PojazdModel[v], VehicleLastPos[PojazdModel[v]][0], VehicleLastPos[PojazdModel[v]][1], VehicleLastPos[PojazdModel[v]][2]);
  3209.                 GetVehicleZAngle(PojazdModel[v], VehicleLastPos[PojazdModel[v]][3]);
  3210.                 Pojazd[v][vSpawn] = 1;
  3211.                 PojazdUID[PojazdModel[v]] = v;
  3212.                 if(Pojazd[v][vReje] == 0)
  3213.                 {
  3214.                     SetVehicleNumberPlate(PojazdModel[v], " ");
  3215.                 }
  3216.                 else if(Pojazd[v][vReje] == 1)
  3217.                 {
  3218.                     format(String, sizeof(String), "SA %04d", v);
  3219.                     SetVehicleNumberPlate(PojazdModel[v], String);
  3220.                 }
  3221.                 SetVehicleToRespawn(PojazdModel[v]);
  3222.                 UstawParametryPojazdu(PojazdModel[v]);
  3223.                 format(String, sizeof(String), "Zespawnowano pojazd ~y~%s~w~ (UID: %d).", GetVehicleName(v), v);
  3224.                 InfoBoxShow(2, playerid, String, 3);
  3225.                 SetPVarInt(playerid, "VehicleSpawn", GetPVarInt(playerid, "VehicleSpawn")+1);
  3226.             }
  3227.         }
  3228.         return 1;
  3229.     }
  3230.     else if(dialogid == 997)
  3231.     {
  3232.         if(!response) return 1;
  3233.         switch(listitem)
  3234.         {
  3235.             case 0:
  3236.             {
  3237.                 if(Player[playerid][pJob] == 1)
  3238.                     return Info(playerid, "Aktualnie jesteś zatrudniony jako mechanik, nie możesz ponownie wziąć tej pracy.");
  3239.                 Player[playerid][pJob] = 1, InfoBoxShow(2, playerid, "Gratulacje!~n~Podjadles sie pracy ~y~Mechanika~w~.", 3);
  3240.             }
  3241.             case 1:
  3242.             {
  3243.                 if(Player[playerid][pJob] == 2)
  3244.                     return Info(playerid, "Aktualnie jesteś zatrudniony jako kurier, nie możesz ponownie wziąć tej pracy.");
  3245.                 Player[playerid][pJob] = 2, InfoBoxShow(2, playerid, "Gratulacje!~n~Podjadles sie pracy ~y~Kuriera~w~.", 3);
  3246.             }
  3247.             case 2:
  3248.             {
  3249.                 if(Player[playerid][pJob] == 3)
  3250.                     return Info(playerid, "Aktualnie jesteś zatrudniony jako rybak, nie możesz ponownie wziąć tej pracy.");
  3251.                 Player[playerid][pJob] = 3, InfoBoxShow(2, playerid, "Gratulacje!~n~Podjadles sie pracy ~y~Rybaka~w~.", 3);
  3252.             }
  3253.         }
  3254.         return 1;
  3255.     }
  3256.     else if(dialogid == 998)
  3257.     {
  3258.         if(!response) return 1;
  3259.         new interior = listitem + 1;
  3260.         SetPVarInt(playerid, "Teleport", 1);
  3261.         SetPlayerInterior(playerid, IntArray2[interior][0]);
  3262.         SetPlayerPos(playerid, IntArray[interior][0], IntArray[interior][1], IntArray[interior][2]);
  3263.         return SetPlayerFacingAngle(playerid, IntArray[interior][3]);
  3264.     }
  3265.     else if(dialogid == 999)
  3266.     {
  3267.         if(!response) return 1;
  3268.         format(String, sizeof(String), "Typ grupy ~y~%s~w~ (UID: %d) zostal zmieniony na ~y~%s~w~.", Grupa[GetPVarInt(playerid, "GroupType")][gNazwa], GetPVarInt(playerid, "GroupType"), TypGrupy[listitem+1]);
  3269.         InfoBoxShow(2, playerid, String, 3);
  3270.         if(Grupa[GetPVarInt(playerid, "GroupType")][gAktywna] == 0) return 1;
  3271.         Grupa[GetPVarInt(playerid, "GroupType")][gTyp] = listitem+1;
  3272.         return ZapiszGrupe(GetPVarInt(playerid, "GroupType"));
  3273.     }
  3274.     else if(dialogid == 1000)
  3275.     {
  3276.         if(!response) return 1;
  3277.         //opcje wyciągania produktu, zmiany cen i tak dalej
  3278.  
  3279.         return 1;
  3280.     }
  3281.     else if(dialogid == 1001)
  3282.     {
  3283.         new powtorzenia = 0, typ, w1, w2, w3, waga, cena, ilosc, nazwa[64];
  3284.         if(!response) return 1;
  3285.         if(sscanf(inputtext, "ddddddds[64]", typ, w1, w2, w3, waga, cena, ilosc, nazwa))
  3286.             return dShowPlayerDialog(playerid, 1001, DIALOG_STYLE_INPUT, ""ServName"Dodawanie produktów", "[typ] [w 1] [w 2] [w 3] [waga] [cena] [ilość] [nazwa]", "Dodaj", "Anuluj");
  3287.         if(ilosc < 1 || ilosc > 100)
  3288.             return Tip(playerid, "Błędna ilość dodawanych przedmiotów."), dShowPlayerDialog(playerid, 1001, DIALOG_STYLE_INPUT, ""ServName"Dodawanie produktów", "[typ] [w 1] [w 2] [w 3] [waga] [cena] [ilość] [nazwa]", "Dodaj", "Anuluj");
  3289.         for(new nr = 1; nr < MAX_ITEM; nr++)
  3290.         {
  3291.             if(Przedmiot[nr][iAktywny] == 0)
  3292.             {
  3293.                 Przedmiot[nr][iAktywny] = 1;
  3294.                 Przedmiot[nr][iTyp] = typ;
  3295.                 Przedmiot[nr][iWartosc1] = w1;
  3296.                 Przedmiot[nr][iWartosc2] = w2;
  3297.                 Przedmiot[nr][iWartosc3] = w3;
  3298.                 Przedmiot[nr][iOwner] = 3;
  3299.                 Przedmiot[nr][iOwnerUID] = GetPVarInt(playerid, "GrupaDodajProdukt");
  3300.                 Przedmiot[nr][iWaga] = waga;
  3301.                 Przedmiot[nr][iUsed] = 0;
  3302.                 Przedmiot[nr][iVir] = 0;
  3303.                 Przedmiot[nr][iPrice] = cena;
  3304.                 strmid(Przedmiot[nr][iNazwa], nazwa, 0, 64, 64);
  3305.                 ZapiszPrzedmiot(nr);
  3306.                 powtorzenia++;
  3307.                 if(powtorzenia == ilosc)
  3308.                 {
  3309.                     break;
  3310.                 }
  3311.             }
  3312.         }
  3313.         return 1;
  3314.     }
  3315.     else if(dialogid == 1002)
  3316.     {
  3317.         //skladanie oferty
  3318.         return 1;
  3319.     }
  3320.     else if(dialogid == 1003)
  3321.     {
  3322.         new item = ListItem[playerid][listitem], infopay[128], info[1024];
  3323.         SetPVarInt(playerid, "rpListItemShop", item);
  3324.         strcat(infopay, "1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", sizeof(infopay));
  3325.         if(Przedmiot[item][iPremiumPrice] != 0)
  3326.         {
  3327.             strcat(infopay, "3\tZapłać za pomocą wirtualnych €\n", sizeof(infopay));
  3328.         }
  3329.         format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d)\nSkładający:\t\t%s (UID: %d)\nKoszt oferty:\t\t$%d (€%d)\n----\n%s", "Kupno przedmiotu", Przedmiot[item][iNazwa], item, Grupa[Przedmiot[item][iOwnerUID]][gNazwa], Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice], Przedmiot[item][iPremiumPrice], infopay);
  3330.         return dShowPlayerDialog(playerid, 1004, DIALOG_STYLE_LIST, ""ServName"Sklep", info, "Akceptuj", "Odrzuć");
  3331.     }
  3332.     else if(dialogid == 1004)//sklep 24/7
  3333.     {
  3334.         if(!response) return 1;
  3335.         new item = GetPVarInt(playerid, "rpListItemShop"), itemOwner = Przedmiot[item][iOwnerUID];
  3336.         if(Przedmiot[item][iOwner] == 3)
  3337.         {
  3338.             if(!strcmp(inputtext, "1    Zapłać za pomocą gotówki", true))
  3339.             {
  3340.                 if(dKasa(playerid) < Przedmiot[item][iPrice])
  3341.                     return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zakupic produkt.", 3);
  3342.                 gKasa(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
  3343.                 sKasa(playerid, -Przedmiot[item][iPrice]);
  3344.                 format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za kwote ~g~$~y~%d~w~ w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPrice], Grupa[itemOwner][gNazwa]);
  3345.                 InfoBoxShow(2, playerid, String, 3);
  3346.             }
  3347.             else if(!strcmp(inputtext, "3   Płacę w wirtualnych €", true) && Przedmiot[item][iPremiumPrice] != 0)
  3348.             {
  3349.                 if(IPB[playerid][ipb_PremiumScore] < Przedmiot[item][iPremiumPrice])
  3350.                     return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacej ilosci ~y~wirtualnych~w~ pieniedzy, aby moc zakupic produkt.", 3);
  3351.                 Grupa[Przedmiot[item][iOwnerUID]][gWirCash] += Przedmiot[item][iPremiumPrice];
  3352.                 format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za ~g~%d~w~ wirtualnych pieniedzy w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPremiumPrice], Grupa[itemOwner][gNazwa]);
  3353.                 InfoBoxShow(2, playerid, String, 3);
  3354.                 IPB[playerid][ipb_PremiumScore] -= Przedmiot[item][iPremiumPrice];
  3355.                 Global_Data_Save(playerid);
  3356.             }
  3357.             else if(!strcmp(inputtext, "2   Zapłać za pomocą karty płatniczej", true))
  3358.             {
  3359.                 if(Player[playerid][pBank] < Przedmiot[item][iPrice])
  3360.                     return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zakupic produkt.", 3);
  3361.                 gKasa(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
  3362.                 Player[playerid][pBank] -= Przedmiot[item][iPrice];
  3363.                 format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za kwote ~g~$~y~%d~w~ w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPrice], Grupa[itemOwner][gNazwa]);
  3364.                 InfoBoxShow(2, playerid, String, 3);
  3365.             }
  3366.             else
  3367.             {
  3368.                 if(dKasa(playerid) < Przedmiot[item][iPrice])
  3369.                     return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zakupic produkt.", 3);
  3370.                 gKasa(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
  3371.                 sKasa(playerid, -Przedmiot[item][iPrice]);
  3372.                 format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za kwote ~g~$~y~%d~w~ w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPrice], Grupa[itemOwner][gNazwa]);
  3373.                 InfoBoxShow(2, playerid, String, 3);
  3374.             }
  3375.             AddPoints(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
  3376.             Przedmiot[item][iOwner] = 1;
  3377.             Przedmiot[item][iOwnerUID] = Player[playerid][pUID];
  3378.             ZapiszPrzedmiot(item);
  3379.             if(Przedmiot[item][iTyp] == 18)
  3380.             {
  3381.                 new numer = item+random(999999);
  3382.                 Przedmiot[item][iWartosc1] = numer;
  3383.             }
  3384.         }
  3385.         else
  3386.         {
  3387.             InfoBoxShow(2, playerid, "Wystapil ~r~blad~w~. Sprobuj ponownie zakupic ~y~produkt~w~.", 3);
  3388.         }
  3389.         return 1;
  3390.     }
  3391.     else if(dialogid == 2000)
  3392.     {
  3393.         if(!response) return 1;
  3394.         new Items[2048], Item[128], Itemy = 0;
  3395.         if(Sluzba(playerid) == 0)
  3396.             return Info(playerid, "Wejdź na służbę grupy, dla której chcesz zamówić produkty.\nW przeciwnym razie nie możesz skorzytać opcji zamawiania.");
  3397.         for(new i = 0; i < sizeof(Zamowienia); i++)
  3398.         {
  3399.             if(Zamowienia[i][Produkt_Kategoria] == listitem+1)
  3400.             {
  3401.                 if(Zamowienia[i][Produkt_Owner] == 1 && Zamowienia[i][Produkt_OwnerUID] == Grupa[Sluzba(playerid)][gTyp])//wczytywanie wedle typu
  3402.                 {
  3403.                     format(Item, sizeof(Item), "%d\t$%d\t%s", i, Zamowienia[i][Produkt_Price], Zamowienia[i][Produkt_Nazwa]);
  3404.                     format(Items, sizeof(Items), "%s%s\n", Items, Item);
  3405.                     ListItem[playerid][Itemy] = i;
  3406.                     Itemy++;
  3407.                 }
  3408.                 if(Zamowienia[i][Produkt_Owner] == 2 && Zamowienia[i][Produkt_OwnerUID] == Sluzba(playerid))//wczytywanie wedle UniqueID grupy
  3409.                 {
  3410.                     format(Item, sizeof(Item), "%d\t$%d\t%s", i, Zamowienia[i][Produkt_Price], Zamowienia[i][Produkt_Nazwa]);
  3411.                     format(Items, sizeof(Items), "%s%s\n", Items, Item);
  3412.                     ListItem[playerid][Itemy] = i;
  3413.                     Itemy++;
  3414.                 }
  3415.             }
  3416.         }
  3417.         if(!Itemy)
  3418.             return Info(playerid, "Nie możesz zamówić żadnego przedmiotu z tej kategorii.");
  3419.         SendClientMessage(playerid, 0xFFF000, "Hurtownia (telefon): Witaj w Hurtowni. Wybierz produkt, który chciałbyś zamówić.");
  3420.         return dShowPlayerDialog(playerid, 2001, DIALOG_STYLE_LIST, ""ServName"Zamówienia", Items, "Wybierz", "Anuluj");
  3421.     }
  3422.     else if(dialogid == 2001)//rozpoczęcie zamówień
  3423.     {
  3424.         if(!response) return ShowOrderCat(playerid);
  3425.         if(Sluzba(playerid) == 0)
  3426.             return InfoBoxShow(2, playerid, "Wejdz na sluzbe ~y~grupy~w~, dla ktorej chcesz zamowic produkty.", 3);
  3427.         SetPVarInt(playerid, "rpZamowienie", ListItem[playerid][listitem]);
  3428.         format(String, sizeof(String),"%s (przez telefon): %s", CharName(playerid), Zamowienia[ListItem[playerid][listitem]][Produkt_Nazwa]);
  3429.         PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  3430.         format(String, sizeof(String), "Poniżej podaj ilość produktów, które mają zostać zamówione dla Twojej grupy.\nKoszt jednego produktu to $%d.", Zamowienia[ListItem[playerid][listitem]][Produkt_Price]);
  3431.         return dShowPlayerDialog(playerid, 2002, DIALOG_STYLE_INPUT, ""ServName"Zamówienia", String, "Zamów", "Anuluj");
  3432.     }
  3433.     else if(dialogid == 2002)
  3434.     {
  3435.         new ilosc = 0, item = GetPVarInt(playerid, "rpZamowienie");
  3436.         if(sscanf(inputtext, "d", ilosc))
  3437.         {
  3438.             format(String, sizeof(String), "Poniżej podaj ilość produktów, które mają zostać zamówione dla Twojej grupy.\nKoszt jednego produktu to $%d.", Zamowienia[GetPVarInt(playerid, "rpZamowienie")][Produkt_Price]);
  3439.             return dShowPlayerDialog(playerid, 2002, DIALOG_STYLE_INPUT, ""ServName"Zamówienia", String, "Zamów", "Anuluj");
  3440.         }
  3441.         if(ilosc > 10 || ilosc <= 0)
  3442.             return Tip(playerid, "Podana ilośc przedmiotów jest błędna.");
  3443.         if(Zamowienia[item][Produkt_Price] * ilosc > Grupa[Sluzba(playerid)][gBank])
  3444.             return Tip(playerid, "Grupa nie posiada wystarczających środków, aby zamówić taką ilość produktów.");
  3445.         for(new p = 1; p < MAX_ITEM; p++)
  3446.         {
  3447.             if(Paczka[p][pAktywna] == 0)
  3448.             {
  3449.                 Paczka[p][pAktywna]     = 1;
  3450.                 strmid(Paczka[p][pNazwa], Zamowienia[item][Produkt_Nazwa], 0, 64, 64);
  3451.                 Paczka[p][pTyp]         = Zamowienia[item][Produkt_Typ];
  3452.                 Paczka[p][pValue1]      = Zamowienia[item][Produkt_Wartosc1];
  3453.                 if(Zamowienia[item][Produkt_Typ] == 3)
  3454.                 {
  3455.                     Paczka[p][pValue2]      = gettime();
  3456.                     Paczka[p][pValue3]      = gettime();
  3457.                 }
  3458.                 else
  3459.                 {
  3460.                     Paczka[p][pValue2]      = Zamowienia[item][Produkt_Wartosc2];
  3461.                     Paczka[p][pValue3]      = Zamowienia[item][Produkt_Wartosc3];
  3462.                 }
  3463.                 Paczka[p][pPrice]       = Zamowienia[item][Produkt_Price];
  3464.                 Paczka[p][pWaga]        = Zamowienia[item][Produkt_Waga];
  3465.                 Paczka[p][pIlosc]       = ilosc;
  3466.                 Paczka[p][pOwner]       = 3;
  3467.                 if(Zamowienia[item][Produkt_Owner] == 2)
  3468.                 {
  3469.                     Paczka[p][pOwnerUID]    = Zamowienia[item][Produkt_OwnerUID];
  3470.                 }
  3471.                 else
  3472.                 {
  3473.                     Paczka[p][pOwnerUID]    = Sluzba(playerid);
  3474.                 }
  3475.                 Paczka[p][pDoor]        = InDoor(playerid);
  3476.                 Paczka[p][pFlaga]       = Zamowienia[item][Produkt_Flaga];
  3477.                 Paczka[p][pFlagaUID]    = Zamowienia[item][Produkt_FlagaUID];
  3478.                 Grupa[Paczka[p][pOwnerUID]][gBank] -= Paczka[p][pPrice]*ilosc;
  3479.                 ZapiszGrupe(Paczka[p][pOwnerUID]);
  3480.                 format(String, sizeof(String), "Hurtownia (telefon): Zamówiłeś x%d %s za kwotę $%d, pozostała kwota na koncie grupy to $%d.", ilosc, Paczka[p][pNazwa], Paczka[p][pPrice]*ilosc, Grupa[Paczka[p][pOwnerUID]][gBank]);
  3481.                 SendClientMessage(playerid, 0xFFF000, String);
  3482.                 break;
  3483.             }
  3484.         }
  3485.         return 1;
  3486.     }
  3487.     else if(dialogid == 2501)//odbiór paczki
  3488.     {
  3489.         if(!response) return 1;
  3490.         new p = ListItem[playerid][listitem];
  3491.         if(Paczka[p][pDostarcza] == 0)
  3492.         {
  3493.             new typ = Paczka[p][pTyp];
  3494.             if(typ == 1 || typ == 6 || typ == 9 || typ == 14 || typ == 15)
  3495.             {
  3496.                 if(Grupa[Sluzba(playerid)][gTyp] != 7)
  3497.                     return Info(playerid, "Paczki specjalne może przewozić tylko i wyłącznie firma kurierska.");
  3498.                 SetPVarInt(playerid, "rpSpecialPack", Sluzba(playerid));
  3499.             }
  3500.             else
  3501.             {
  3502.                 SetPVarInt(playerid, "rpSpecialPack", 0);
  3503.             }
  3504.             Paczka[p][pDostarcza] = Player[playerid][pUID];
  3505.             SetPVarInt(playerid, "rpPaczka", p);
  3506.             InfoBoxShow(2, playerid, "~y~Paczka~w~ zostala ~g~odebrana~w~. Dostarcz ja do ~y~budynku~w~, z ktorego ja zamowiono.", 3);
  3507.             SetPlayerMapIcon(playerid, 0, Drzwi[Paczka[p][pDoor]][dZewPosX], Drzwi[Paczka[p][pDoor]][dZewPosY], Drzwi[Paczka[p][pDoor]][dZewPosZ], 51, 0, MAPICON_GLOBAL_CHECKPOINT);
  3508.         }
  3509.         else
  3510.         {
  3511.             Info(playerid, "Ta paczka jest aktualnie dostarczana przez innego kuriera.");
  3512.         }
  3513.         return 1;
  3514.     }
  3515.     else if(dialogid == 8888)
  3516.     {
  3517.         new gracz = Offer[playerid][oCustomerID];
  3518.         if(Offer[playerid][oCustomerID] == INVALID_PLAYER_ID || Offer[gracz][oCustomerID] == INVALID_PLAYER_ID)
  3519.             return 1;
  3520.         if(response)
  3521.         {
  3522.             new paytype = 0;
  3523.             if(!strcmp(inputtext, "1    Zapłać za pomocą gotówki", true))
  3524.             {
  3525.                 if(dKasa(playerid) < Offer[gracz][oPrice])
  3526.                 {
  3527.                     paytype = 1;
  3528.                     Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
  3529.                     format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
  3530.                     InfoBoxShow(2, gracz, String, 3);
  3531.                     return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zaakceptowac oferte.", 3);
  3532.                 }
  3533.             }
  3534.             else if(!strcmp(inputtext, "2   Zapłać za pomocą karty płatniczej", true))
  3535.             {
  3536.                 if(Player[playerid][pBank] < Offer[gracz][oPrice])
  3537.                 {
  3538.                     paytype = 2;
  3539.                     Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
  3540.                     format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
  3541.                     InfoBoxShow(2, gracz, String, 3);
  3542.                     return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zaakceptowac oferte.", 3);
  3543.                 }
  3544.             }
  3545.             else
  3546.             {
  3547.                 Tip(playerid, "Nie wybrałeś środka płatniczego, transakcja przerwana.");
  3548.                 Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
  3549.                 format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
  3550.                 return InfoBoxShow(2, gracz, String, 3);
  3551.             }
  3552.  
  3553.             format(String, sizeof(String), "Gracz ~y~%s~w~ ~g~zaakceptowal~w~ Twoja oferte.", CharName(playerid));
  3554.             InfoBoxShow(2, gracz, String, 3);
  3555.             format(String, sizeof(String), "~g~Zaakceptowales ~w~oferte gracza ~y~%s~w~.", CharName(gracz));
  3556.             InfoBoxShow(2, playerid, String, 3);
  3557.             if(Offer[gracz][oType] == OFFER_VEHICLE)
  3558.             {
  3559.                 if(paytype == 1)
  3560.                 {
  3561.                     sKasa(playerid, -Offer[gracz][oPrice]), sKasa(gracz, Offer[gracz][oPrice]);
  3562.                 }
  3563.                 else if(paytype == 2)
  3564.                 {
  3565.                     Player[playerid][pBank] -= Offer[gracz][oPrice], Player[gracz][pBank] += Offer[gracz][oPrice];
  3566.                     format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3567.                     SendClientMessage(playerid, 0xFFF000FF, String);
  3568.                     format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3569.                     SendClientMessage(gracz, 0xFFF000FF, String);
  3570.                 }
  3571.                 Offer[gracz][oBlock] = 0;
  3572.                 printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Kupno pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID], Offer[gracz][oPrice]);
  3573.                 RemovePlayerFromVehicle(gracz);
  3574.                 Pojazd[Offer[gracz][oItemUID]][vOwnerUID] = Player[playerid][pUID];
  3575.                 Info(playerid, "Świetnie!\nZakupiłeś pojazd, od teraz możesz nim zarządzać poprzez komendę /v.");
  3576.             }
  3577.             else if(Offer[gracz][oType] == OFFER_DOORS)
  3578.             {
  3579.                 if(paytype == 1)
  3580.                 {
  3581.                     sKasa(playerid, -Offer[gracz][oPrice]), sKasa(gracz, Offer[gracz][oPrice]);
  3582.                 }
  3583.                 else if(paytype == 2)
  3584.                 {
  3585.                     Player[playerid][pBank] -= Offer[gracz][oPrice], Player[gracz][pBank] += Offer[gracz][oPrice];
  3586.                     format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3587.                     SendClientMessage(playerid, 0xFFF000FF, String);
  3588.                     format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3589.                     SendClientMessage(gracz, 0xFFF000FF, String);
  3590.                 }
  3591.                 Offer[gracz][oBlock] = 0;
  3592.                 printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Kupno drzwi, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), Drzwi[Offer[gracz][oItemUID]][dNazwa], Offer[gracz][oItemUID], Offer[gracz][oPrice]);
  3593.                 Drzwi[Offer[gracz][oItemUID]][dOwnerUID] = Player[playerid][pUID], ZapiszDrzwi(Offer[gracz][oItemUID]);
  3594.                 Info(playerid, "Świetnie!\nZakupiłeś budynek, od teraz możesz nim zarządzać poprzez komendę /drzwi.");
  3595.             }
  3596.             else if(Offer[gracz][oType] == OFFER_WELCOME)
  3597.             {
  3598.                 //witamy postacie
  3599.             }
  3600.             else if(Offer[gracz][oType] == OFFER_REPAIR)
  3601.             {
  3602.                 if(paytype == 1)
  3603.                 {
  3604.                     sKasa(playerid, -Offer[gracz][oPrice]), Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), sKasa(gracz, (Offer[gracz][oPrice]/15));
  3605.                 }
  3606.                 else if(paytype == 2)
  3607.                 {
  3608.                     Player[playerid][pBank] -= Offer[gracz][oPrice], Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), Player[gracz][pBank] += (Offer[gracz][oPrice]/15);
  3609.                     format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3610.                     SendClientMessage(playerid, 0xFFF000FF, String);
  3611.                     format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3612.                     SendClientMessage(gracz, 0xFFF000FF, String);
  3613.                 }
  3614.                 printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Naprawa pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID], Offer[gracz][oPrice]);
  3615.                 SetPVarInt(gracz, "OffeVeh", GetPlayerVehicleID(playerid));
  3616.                 SetPVarInt(gracz, "OffeVehTime", 120);
  3617.                 SetPVarInt(gracz, "OffeVehType", OFFER_REPAIR);
  3618.                 format(String, sizeof(String), "Proces naprawy pojazdu %s (UID: %d) rozpoczął się.\nPamiętaj, by silnik pojazdu był zgaszony.", GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID]);
  3619.                 Info(playerid, String);
  3620.             }
  3621.             else if(Offer[gracz][oType] == OFFER_REGISTER)
  3622.             {
  3623.                 if(paytype == 1)
  3624.                 {
  3625.                     sKasa(playerid, -Offer[gracz][oPrice]), Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), sKasa(gracz, (Offer[gracz][oPrice]/15));
  3626.                 }
  3627.                 else if(paytype == 2)
  3628.                 {
  3629.                     Player[playerid][pBank] -= Offer[gracz][oPrice], Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), Player[gracz][pBank] += (Offer[gracz][oPrice]/15);
  3630.                     format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3631.                     SendClientMessage(playerid, 0xFFF000FF, String);
  3632.                     format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
  3633.                     SendClientMessage(gracz, 0xFFF000FF, String);
  3634.                 }
  3635.                 Pojazd[Offer[gracz][oItemUID]][vReje] = 1;
  3636.                 Offer[gracz][oBlock] = 0;
  3637.                 printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Rejestracja pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID], Offer[gracz][oPrice]);
  3638.                 Info(playerid, "Świetnie!\nUdało Ci się zarejestrować swój pojazd, od teraz możesz bezpiecznie poruszać się po drogach.\nPamiętaj, aby pojazd zrespawnować.");
  3639.             }
  3640.             else if(Offer[gracz][oType] == OFFER_MONTAGE)
  3641.             {
  3642.  
  3643.             }
  3644.             else
  3645.             {
  3646.                 //nieznana usługa
  3647.             }
  3648.             //koniec wykonywania oferty
  3649.         }
  3650.         else
  3651.         {
  3652.             Offer[gracz][oBlock] = 0;
  3653.             format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
  3654.             InfoBoxShow(2, gracz, String, 3);
  3655.             format(String, sizeof(String), "~r~Odrzuciles ~w~oferte gracza ~y~%s~w~.", CharName(gracz));
  3656.             InfoBoxShow(2, playerid, String, 3);
  3657.         }
  3658.         return Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
  3659.     }
  3660.     else if(dialogid == 9950)
  3661.     {
  3662.         new listid = ListItem[playerid][listitem], ItemA[128], ItemB[1024], grup = 0;
  3663.         if(!response) return 1;
  3664.         if(Grupa[listid][gAktywna] == 1)
  3665.         {
  3666.             format(ItemA, sizeof(ItemA), "{AAC5E3}UID\tNazwa{FFFFFF}");
  3667.             for(new nr = 1; nr < MAX_GRUPY; nr++)
  3668.             {
  3669.                 if(Grupa[nr][gAktywna] == 1 && Grupa[nr][gOwner] == listid)
  3670.                 {
  3671.                     format(ItemA, sizeof(ItemA), "%d\t%s", nr, Grupa[nr][gNazwa]);
  3672.                     format(ItemB, sizeof(ItemB), "%s%s\n", ItemB, ItemA);
  3673.                     grup++;
  3674.                 }
  3675.             }
  3676.             if(grup == 0) return format(String, sizeof(String), "Do grupy ~y~%s~w~ (UID: %d) nie sa przepisane zadne podgrupy.", Grupa[listid][gNazwa], listid), InfoBoxShow(2, playerid, String, 3);
  3677.         }
  3678.         return dShowPlayerDialog(playerid, 9950, DIALOG_STYLE_LIST, ""ServName"Podgrupy", ItemB, "Wybierz", "");
  3679.     }
  3680.     else if(dialogid == 9990)
  3681.     {
  3682.         if(!response) return 1;
  3683.         if(!strcmp(inputtext, "1    Ukrywanie postaci", true))
  3684.         {
  3685.             if(IPB[playerid][ipb_Premium] < gettime())
  3686.                 return InfoBoxShow(2, playerid, "Nie posiadasz ~y~konta premium~w~, aby moc skorzystac z tej opcji.", 3);
  3687.             if(Player[playerid][pInvisible] == 0)
  3688.             {
  3689.                 InfoBoxShow(2, playerid, "Postac zostala ~y~ukryta~w~ pomyslnie.", 3);
  3690.                 Player[playerid][pInvisible] = 1;
  3691.             }
  3692.             else
  3693.             {
  3694.                 InfoBoxShow(2, playerid, "Postac zostala ~y~odkryta~w~ pomyslnie.", 3);
  3695.                 Player[playerid][pInvisible] = 0;
  3696.             }
  3697.             return 1;
  3698.         }
  3699.         else if(!strcmp(inputtext, "6   Stacja radiowa", true))
  3700.         {
  3701.             new rekord = 0, grupy[1024];
  3702.             for(new g = 1; g < MAX_GRUPY; g++)
  3703.             {
  3704.                 if(Grupa[g][gAktywna] == 1 && Grupa[g][gTyp] == 16)
  3705.                 {
  3706.                     new players, grupa[75];
  3707.                     ListItem[playerid][rekord] = g;
  3708.                     rekord++;
  3709.                     foreach(Player, p)
  3710.                     {
  3711.                         if(Sluzba(p) == g)
  3712.                         {
  3713.                             players++;
  3714.                         }
  3715.                     }
  3716.                     format(grupa, sizeof(grupa), "%d\t%s\t(Służba: %d)", g, Grupa[g][gNazwa], players);
  3717.                     format(grupy, sizeof(grupy), "%s%s\n", grupy, grupa);
  3718.                 }
  3719.             }
  3720.             if(rekord == 0)
  3721.                 Info(playerid, "Aktualnie nie istnieje żadna grupa o typie radio.");
  3722.                 else
  3723.                 dShowPlayerDialog(playerid, 9991, DIALOG_STYLE_LIST, ""ServName"Radio", grupy, "Wybierz", "Anuluj");
  3724.             return 1;
  3725.         }
  3726.         else if(!strcmp(inputtext, "7   Wyświetlanie stref", true))
  3727.         {
  3728.             if(IPB[playerid][ipb_ZoneShow] == 0)
  3729.             {
  3730.                 IPB[playerid][ipb_ZoneShow] = 1;
  3731.                 Info(playerid, "Strefy od tego momentu będą wyświetlane na mapie.\nPamiętaj, że to jest ustawienie globalne dla wszystkich Twoich postaci.");
  3732.             }
  3733.             else
  3734.             {
  3735.                 IPB[playerid][ipb_ZoneShow] = 0;
  3736.                 Info(playerid, "Strefy od tego momentu nie będą wyświetlane na mapie.\nPamiętaj, że to jest ustawienie globalne dla wszystkich Twoich postaci.");
  3737.             }
  3738.             return 1;
  3739.         }
  3740.         return 1;
  3741.     }
  3742.     else if(dialogid == 9991)
  3743.     {
  3744.         if(!response) return 1;
  3745.         if(Grupa[ListItem[playerid][listitem]][gAktywna] == 1 && Grupa[ListItem[playerid][listitem]][gTyp] == 16)
  3746.         {
  3747.             Player[playerid][pRadio] = ListItem[playerid][listitem];
  3748.             format(String, sizeof(String), "Pomyślnie zmieniłeś stację radiową, której będzie słuchać Twoja postać.\nNowa stacja to %s.", Grupa[ListItem[playerid][listitem]][gNazwa]), Info(playerid, String);
  3749.         }
  3750.         else
  3751.         {
  3752.             Info(playerid, "Grupa nie jest aktywna lub nie działa jako radio.");
  3753.         }
  3754.         return 1;
  3755.     }
  3756.     else if(dialogid == 9992)
  3757.     {
  3758.         switch(listitem)
  3759.         {
  3760.             case 0: return 1;
  3761.             case 1: return 1;
  3762.             case 2: return 1;
  3763.             case 3: return 1;
  3764.             case 4: return 1;
  3765.         }
  3766.         return 1;
  3767.     }
  3768.     return 1;
  3769. }
  3770.  
  3771. public OnPlayerCommandReceived(playerid, cmdtext[])//zcmd
  3772. {
  3773.     printf("[cmmd] %s: %s", cName(playerid), cmdtext);
  3774.     Statystyki[2]++;
  3775.     if(Login(playerid) == 0)
  3776.     {
  3777.         PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  3778.         return 0;
  3779.     }
  3780.     return 1;
  3781. }
  3782.  
  3783. public OnPlayerCommandPerformed(playerid, cmdtext[], success)//zcmd
  3784. {
  3785.     if(!success)
  3786.     {
  3787.         PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  3788.     }
  3789.     return 1;
  3790. }
  3791.  
  3792. public OnPlayerText(playerid, text[])
  3793. {
  3794.     if(Login(playerid) != 1)
  3795.         return 0;
  3796.     if(Player[playerid][pBW] != 0)
  3797.     {
  3798.         Info(playerid, "Podczas stanu BW nie możesz używać czatu.");
  3799.         return 0;
  3800.     }
  3801.     if(GetPVarInt(playerid, "ItemTDPage") != 0 && text[0] == '>')
  3802.     {
  3803.             if(GetPVarInt(playerid, "ItemTDPage") >= 5)
  3804.                 return 0;
  3805.             SetPVarInt(playerid, "ItemTDPage", GetPVarInt(playerid, "ItemTDPage")+1);
  3806.             if(GetPVarInt(playerid, "ItemTDPage") == 2)
  3807.             {
  3808.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (2) ~>~");
  3809.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  3810.                 new rekord = 1, StringItem[64];
  3811.                 for(new i = 10; i < 20; i ++)
  3812.                 {
  3813.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  3814.                     {
  3815.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3816.                     }
  3817.                     else
  3818.                     {
  3819.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3820.                     }
  3821.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  3822.                     {
  3823.                         StringItem = "Brak przedmiotu";
  3824.                     }
  3825.                     if(rekord == 1)
  3826.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  3827.                     else if(rekord == 2)
  3828.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  3829.                     else if(rekord == 3)
  3830.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  3831.                     else if(rekord == 4)
  3832.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  3833.                     else if(rekord == 5)
  3834.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  3835.                     else if(rekord == 6)
  3836.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  3837.                     else if(rekord == 7)
  3838.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  3839.                     else if(rekord == 8)
  3840.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  3841.                     else if(rekord == 9)
  3842.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  3843.                     else if(rekord == 10)
  3844.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  3845.                     if(rekord < 10)
  3846.                     {
  3847.                         rekord++;
  3848.                     }
  3849.                 }
  3850.             }
  3851.             else if(GetPVarInt(playerid, "ItemTDPage") == 3)
  3852.             {
  3853.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (3) ~>~");
  3854.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  3855.                 new rekord = 1, StringItem[64];
  3856.                 for(new i = 20; i < 30; i ++)
  3857.                 {
  3858.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  3859.                     {
  3860.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3861.                     }
  3862.                     else
  3863.                     {
  3864.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3865.                     }
  3866.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  3867.                     {
  3868.                         StringItem = "Brak przedmiotu";
  3869.                     }
  3870.                     if(rekord == 1)
  3871.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  3872.                     else if(rekord == 2)
  3873.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  3874.                     else if(rekord == 3)
  3875.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  3876.                     else if(rekord == 4)
  3877.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  3878.                     else if(rekord == 5)
  3879.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  3880.                     else if(rekord == 6)
  3881.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  3882.                     else if(rekord == 7)
  3883.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  3884.                     else if(rekord == 8)
  3885.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  3886.                     else if(rekord == 9)
  3887.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  3888.                     else if(rekord == 10)
  3889.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  3890.                     if(rekord < 10)
  3891.                     {
  3892.                         rekord++;
  3893.                     }
  3894.                 }
  3895.             }
  3896.             else if(GetPVarInt(playerid, "ItemTDPage") == 4)
  3897.             {
  3898.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (4) ~>~");
  3899.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  3900.                 new rekord = 1, StringItem[64];
  3901.                 for(new i = 30; i < 40; i ++)
  3902.                 {
  3903.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  3904.                     {
  3905.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3906.                     }
  3907.                     else
  3908.                     {
  3909.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3910.                     }
  3911.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  3912.                     {
  3913.                         StringItem = "Brak przedmiotu";
  3914.                     }
  3915.                     if(rekord == 1)
  3916.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  3917.                     else if(rekord == 2)
  3918.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  3919.                     else if(rekord == 3)
  3920.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  3921.                     else if(rekord == 4)
  3922.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  3923.                     else if(rekord == 5)
  3924.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  3925.                     else if(rekord == 6)
  3926.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  3927.                     else if(rekord == 7)
  3928.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  3929.                     else if(rekord == 8)
  3930.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  3931.                     else if(rekord == 9)
  3932.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  3933.                     else if(rekord == 10)
  3934.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  3935.                     if(rekord < 10)
  3936.                     {
  3937.                         rekord++;
  3938.                     }
  3939.                 }
  3940.             }
  3941.             else if(GetPVarInt(playerid, "ItemTDPage") == 5)
  3942.             {
  3943.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (5) ~>~");
  3944.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  3945.                 new rekord = 1, StringItem[64];
  3946.                 for(new i = 40; i < 50; i ++)
  3947.                 {
  3948.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  3949.                     {
  3950.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3951.                     }
  3952.                     else
  3953.                     {
  3954.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  3955.                     }
  3956.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  3957.                     {
  3958.                         StringItem = "Brak przedmiotu";
  3959.                     }
  3960.                     if(rekord == 1)
  3961.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  3962.                     else if(rekord == 2)
  3963.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  3964.                     else if(rekord == 3)
  3965.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  3966.                     else if(rekord == 4)
  3967.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  3968.                     else if(rekord == 5)
  3969.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  3970.                     else if(rekord == 6)
  3971.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  3972.                     else if(rekord == 7)
  3973.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  3974.                     else if(rekord == 8)
  3975.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  3976.                     else if(rekord == 9)
  3977.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  3978.                     else if(rekord == 10)
  3979.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  3980.                     if(rekord < 10)
  3981.                     {
  3982.                         rekord++;
  3983.                     }
  3984.                 }
  3985.             }
  3986.             return 0;
  3987.     }
  3988.     if(GetPVarInt(playerid, "ItemTDPage") != 0 && text[0] == '<')
  3989.     {
  3990.             SetPVarInt(playerid, "ItemTDPage", GetPVarInt(playerid, "ItemTDPage")-1);
  3991.             if(GetPVarInt(playerid, "ItemTDPage") == 0)
  3992.             {
  3993.                 TextDrawHideForPlayer(playerid, ItemTD0[playerid]);
  3994.                 TextDrawHideForPlayer(playerid, ItemTD1[playerid]);
  3995.                 TextDrawHideForPlayer(playerid, ItemTD2[playerid]);
  3996.                 TextDrawHideForPlayer(playerid, ItemTD3[playerid]);
  3997.                 TextDrawHideForPlayer(playerid, ItemTD4[playerid]);
  3998.                 TextDrawHideForPlayer(playerid, ItemTD5[playerid]);
  3999.                 TextDrawHideForPlayer(playerid, ItemTD6[playerid]);
  4000.                 TextDrawHideForPlayer(playerid, ItemTD7[playerid]);
  4001.                 TextDrawHideForPlayer(playerid, ItemTD8[playerid]);
  4002.                 TextDrawHideForPlayer(playerid, ItemTD9[playerid]);
  4003.                 TextDrawHideForPlayer(playerid, ItemTD10[playerid]);
  4004.                 return 0;
  4005.             }
  4006.             if(GetPVarInt(playerid, "ItemTDPage") == 1)
  4007.             {
  4008.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (1) ~>~");
  4009.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  4010.                 new rekord = 1, StringItem[64];
  4011.                 for(new i = 0; i < 10; i ++)
  4012.                 {
  4013.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  4014.                     {
  4015.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4016.                     }
  4017.                     else
  4018.                     {
  4019.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4020.                     }
  4021.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  4022.                     {
  4023.                         StringItem = "Brak przedmiotu";
  4024.                     }
  4025.                     if(rekord == 1)
  4026.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  4027.                     else if(rekord == 2)
  4028.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  4029.                     else if(rekord == 3)
  4030.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  4031.                     else if(rekord == 4)
  4032.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  4033.                     else if(rekord == 5)
  4034.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  4035.                     else if(rekord == 6)
  4036.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  4037.                     else if(rekord == 7)
  4038.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  4039.                     else if(rekord == 8)
  4040.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  4041.                     else if(rekord == 9)
  4042.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  4043.                     else if(rekord == 10)
  4044.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  4045.                     if(rekord < 10)
  4046.                     {
  4047.                         rekord++;
  4048.                     }
  4049.                 }
  4050.             }
  4051.             else if(GetPVarInt(playerid, "ItemTDPage") == 2)
  4052.             {
  4053.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (2) ~>~");
  4054.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  4055.                 new rekord = 1, StringItem[64];
  4056.                 for(new i = 10; i < 20; i ++)
  4057.                 {
  4058.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  4059.                     {
  4060.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4061.                     }
  4062.                     else
  4063.                     {
  4064.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4065.                     }
  4066.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  4067.                     {
  4068.                         StringItem = "Brak przedmiotu";
  4069.                     }
  4070.                     if(rekord == 1)
  4071.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  4072.                     else if(rekord == 2)
  4073.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  4074.                     else if(rekord == 3)
  4075.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  4076.                     else if(rekord == 4)
  4077.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  4078.                     else if(rekord == 5)
  4079.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  4080.                     else if(rekord == 6)
  4081.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  4082.                     else if(rekord == 7)
  4083.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  4084.                     else if(rekord == 8)
  4085.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  4086.                     else if(rekord == 9)
  4087.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  4088.                     else if(rekord == 10)
  4089.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  4090.                     if(rekord < 10)
  4091.                     {
  4092.                         rekord++;
  4093.                     }
  4094.                 }
  4095.             }
  4096.             else if(GetPVarInt(playerid, "ItemTDPage") == 3)
  4097.             {
  4098.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (3) ~>~");
  4099.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  4100.                 new rekord = 1, StringItem[64];
  4101.                 for(new i = 20; i < 30; i ++)
  4102.                 {
  4103.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  4104.                     {
  4105.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4106.                     }
  4107.                     else
  4108.                     {
  4109.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4110.                     }
  4111.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  4112.                     {
  4113.                         StringItem = "Brak przedmiotu";
  4114.                     }
  4115.                     if(rekord == 1)
  4116.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  4117.                     else if(rekord == 2)
  4118.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  4119.                     else if(rekord == 3)
  4120.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  4121.                     else if(rekord == 4)
  4122.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  4123.                     else if(rekord == 5)
  4124.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  4125.                     else if(rekord == 6)
  4126.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  4127.                     else if(rekord == 7)
  4128.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  4129.                     else if(rekord == 8)
  4130.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  4131.                     else if(rekord == 9)
  4132.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  4133.                     else if(rekord == 10)
  4134.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  4135.                     if(rekord < 10)
  4136.                     {
  4137.                         rekord++;
  4138.                     }
  4139.                 }
  4140.             }
  4141.             else if(GetPVarInt(playerid, "ItemTDPage") == 4)
  4142.             {
  4143.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (4) ~>~");
  4144.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  4145.                 new rekord = 1, StringItem[64];
  4146.                 for(new i = 30; i < 40; i ++)
  4147.                 {
  4148.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  4149.                     {
  4150.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4151.                     }
  4152.                     else
  4153.                     {
  4154.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4155.                     }
  4156.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  4157.                     {
  4158.                         StringItem = "Brak przedmiotu";
  4159.                     }
  4160.                     if(rekord == 1)
  4161.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  4162.                     else if(rekord == 2)
  4163.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  4164.                     else if(rekord == 3)
  4165.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  4166.                     else if(rekord == 4)
  4167.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  4168.                     else if(rekord == 5)
  4169.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  4170.                     else if(rekord == 6)
  4171.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  4172.                     else if(rekord == 7)
  4173.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  4174.                     else if(rekord == 8)
  4175.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  4176.                     else if(rekord == 9)
  4177.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  4178.                     else if(rekord == 10)
  4179.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  4180.                     if(rekord < 10)
  4181.                     {
  4182.                         rekord++;
  4183.                     }
  4184.                 }
  4185.             }
  4186.             else if(GetPVarInt(playerid, "ItemTDPage") == 5)
  4187.             {
  4188.                 TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (5) ~>~");
  4189.                 TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  4190.                 new rekord = 1, StringItem[64];
  4191.                 for(new i = 40; i < 50; i ++)
  4192.                 {
  4193.                     if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  4194.                     {
  4195.                         format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4196.                     }
  4197.                     else
  4198.                     {
  4199.                         format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  4200.                     }
  4201.                     if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  4202.                     {
  4203.                         StringItem = "Brak przedmiotu";
  4204.                     }
  4205.                     if(rekord == 1)
  4206.                         TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  4207.                     else if(rekord == 2)
  4208.                         TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  4209.                     else if(rekord == 3)
  4210.                         TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  4211.                     else if(rekord == 4)
  4212.                         TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  4213.                     else if(rekord == 5)
  4214.                         TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  4215.                     else if(rekord == 6)
  4216.                         TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  4217.                     else if(rekord == 7)
  4218.                         TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  4219.                     else if(rekord == 8)
  4220.                         TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  4221.                     else if(rekord == 9)
  4222.                         TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  4223.                     else if(rekord == 10)
  4224.                         TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  4225.                     if(rekord < 10)
  4226.                     {
  4227.                         rekord++;
  4228.                     }
  4229.                 }
  4230.             }
  4231.             return 0;
  4232.     }
  4233.     if(text[0] == '!')
  4234.     {
  4235.         new wiadomosc[256], slot;
  4236.         if(sscanf(text[1], "ds[256]", slot, wiadomosc))
  4237.         {
  4238.             Tip(playerid, "Czat IC: ![slot] [wiadomość]");
  4239.             return 0;
  4240.         }
  4241.         if(slot < 1 || slot > 5)
  4242.         {
  4243.             InfoBoxShow(2, playerid, "Podany przez Ciebie slot grupy jest nieprawidlowy.", 3);
  4244.             return 0;
  4245.         }
  4246.         if(pGrupa[playerid][slot] == 0 || Grupa[pGrupa[playerid][slot]][gAktywna] == 0)
  4247.         {
  4248.             InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
  4249.             return 0;
  4250.         }
  4251.         if(!(Grupa[pGrupa[playerid][slot]][gFlagPerm] & G_FLAG_IC))
  4252.         {
  4253.             InfoBoxShow(2, playerid, "~y~Grupa~w~ nie ma uprawnien do korzystania z czatu ~y~InCharacter~w~.", 3);
  4254.             return 0;
  4255.         }
  4256.         format(String, sizeof(String),"%s (słuchawka): %s", CharName(playerid), wiadomosc);
  4257.         PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4258.         SendGroupMessage(1, playerid, pGrupa[playerid][slot], wiadomosc);
  4259.         return 0;
  4260.     }
  4261.     if(text[0] == '@')
  4262.     {
  4263.         new wiadomosc[256], slot;
  4264.         if(sscanf(text[1], "ds[256]", slot, wiadomosc))
  4265.         {
  4266.             Tip(playerid, "Czat OOC: @[slot] [wiadomość]");
  4267.             return 0;
  4268.         }
  4269.         if(slot < 1 || slot > 5)
  4270.         {
  4271.             InfoBoxShow(2, playerid, "Podany przez Ciebie slot grupy jest nieprawidlowy.", 3);
  4272.             return 0;
  4273.         }
  4274.         if(pGrupa[playerid][slot] == 0 || Grupa[pGrupa[playerid][slot]][gAktywna] == 0)
  4275.         {
  4276.             InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
  4277.             return 0;
  4278.         }
  4279.         if(!(Grupa[pGrupa[playerid][slot]][gFlagPerm] & G_FLAG_OOC))
  4280.         {
  4281.             InfoBoxShow(2, playerid, "Czat ~y~grupy~w~ zostal ~r~wylaczony~w~ przez lidera.", 3);
  4282.             return 0;
  4283.         }
  4284.         SendGroupMessage(0, playerid, pGrupa[playerid][slot], wiadomosc);
  4285.         return 0;
  4286.     }
  4287.     //
  4288.     else if(!strcmp(":/", text, true)){
  4289.     format(String, sizeof(String), "* %s krzywi się.", CharName(playerid));
  4290.     ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  4291.     return 0;
  4292.     }
  4293.     else if(!strcmp(":D", text, true)){
  4294.     format(String, sizeof(String), "* %s śmieje się.", CharName(playerid));
  4295.     ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  4296.     return 0;
  4297.     }
  4298.     else if(!strcmp(":P", text, true)){
  4299.     format(String, sizeof(String), "* %s wystawia język.", CharName(playerid));
  4300.     ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  4301.     return 0;
  4302.     }
  4303.     else if(!strcmp(":)", text, true)){
  4304.     format(String, sizeof(String), "* %s uśmiecha się.", CharName(playerid));
  4305.     ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  4306.     return 0;
  4307.     }
  4308.     else if(!strcmp(":(", text, true)){
  4309.     format(String, sizeof(String), "* %s smuci się.", CharName(playerid));
  4310.     ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  4311.     return 0;
  4312.     }
  4313.     if(text[0] == '?')
  4314.     {
  4315.         InfoBoxShow(2, playerid, "Taki znak nie istnieje w swiecie InCharacter, zastosuj w inny sposob.", 3);
  4316.         return 0;
  4317.     }
  4318.     else if(text[0] == '.')
  4319.     {
  4320.         if(strlen(text) == 1) return 0;
  4321.         strdel(text, 0, 1);
  4322.         format(String, sizeof(String),"[%d] %s (( %s ))",playerid, CharName(playerid), text);
  4323.         PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4324.         return 0;
  4325.     }
  4326.     else if(text[strlen(text)-1] == '!' && text[strlen(text)-2] == '!')
  4327.     {
  4328.         if(strlen(text) < 78)
  4329.         {
  4330.             format(String, sizeof(String), "%s krzyczy: %s", CharName(playerid), text);
  4331.             ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4332.         }
  4333.         else
  4334.         {
  4335.             new pos = strfind(text, " ", true, strlen(text) / 2);
  4336.             if(pos != -1)
  4337.             {
  4338.                 new text2[64];
  4339.  
  4340.                 strmid(text2, text, pos + 1, strlen(text));
  4341.                 strdel(text, pos, strlen(text));
  4342.                 format(String, sizeof(String), "%s krzyczy: %s", CharName(playerid), text);
  4343.                 ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4344.                 format(String, sizeof(String), "            ...%s", text2);
  4345.                 ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4346.             }
  4347.         }
  4348.     }
  4349.     else
  4350.     {
  4351.         if(strlen(text) < 78)
  4352.         {
  4353.             format(String, sizeof(String), "%s mówi: %s", CharName(playerid), text);
  4354.             ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4355.         }
  4356.         else
  4357.         {
  4358.             new pos = strfind(text, " ", true, strlen(text) / 2);
  4359.             if(pos != -1)
  4360.             {
  4361.                 new text2[64];
  4362.  
  4363.                 strmid(text2, text, pos + 1, strlen(text));
  4364.                 strdel(text, pos, strlen(text));
  4365.                 format(String, sizeof(String), "%s mówi: %s", CharName(playerid), text);
  4366.                 ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4367.                 format(String, sizeof(String), "            ...%s", text2);
  4368.                 ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  4369.             }
  4370.         }
  4371.     }
  4372.     return 0;
  4373. }
  4374.  
  4375. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  4376. {
  4377.     new ACS[200];
  4378.     SetPVarFloat(playerid, "rpHealthCheat", GetPVarFloat(playerid, "rpHealthCheat") + amount);
  4379.     if(dHP[playerid] > dHP[playerid] - amount)
  4380.     {
  4381.         dHP[playerid] -= amount;
  4382.     }
  4383.     //zabezpieczenie przed CleoGun & InfinityAmmo
  4384.     if(weaponid > 0 && weaponid < 46)
  4385.     {
  4386.         if(issuerid != playerid)
  4387.         {
  4388.             if(weaponid != GetPVarInt(issuerid, "rpBron"))
  4389.                 return format(ACS, sizeof(ACS), "NoWeapon: %d (%s), Sys: %d (%s).", weaponid, WeapName(weaponid), GetPVarInt(issuerid, "rpBron"), WeapName(GetPVarInt(issuerid, "rpBron"))), Kara(0, issuerid, -1, ACS, 7);
  4390.             if(weaponid > 10 && weaponid < 46)
  4391.             {
  4392.                 if(!(Grupa[Sluzba(issuerid)][gFlagPerm] & G_FLAG_DRIVEBY))
  4393.                 {
  4394.                     if(GetPlayerState(issuerid) == PLAYER_STATE_PASSENGER || GetPlayerState(issuerid) == PLAYER_STATE_DRIVER)
  4395.                         return format(ACS, sizeof(ACS), "DriveBy: %s (weapID: %d, weapName: %s).", Nick(playerid), weaponid, WeapName(weaponid)), Kara(0, issuerid, -1, ACS, 7);
  4396.                 }
  4397.             }
  4398.             new weapons[13][2];
  4399.             for (new i = 0; i < 13; i++)
  4400.             {
  4401.                 GetPlayerWeaponData(issuerid, i, weapons[i][0], weapons[i][1]);
  4402.                 if(weapons[i][0] == GetPVarInt(issuerid, "rpBron"))
  4403.                 {
  4404.                     if(amount <= 5)
  4405.                     {
  4406.                         //
  4407.                     }
  4408.                     else
  4409.                     {
  4410.                         new w = weaponid;
  4411.                         if(w == 42 || w == 41 || w == 38 || w == 37 || w == 36 || w == 35 || w == 34 || w == 33 || w == 32 || w == 31 || w == 30 || w == 29 || w == 28 || w == 27 || w == 26 || w == 25 || w == 24 || w == 23 || w == 22 || w == 18 || w == 16)
  4412.                         {
  4413.                             SetPVarInt(issuerid, "rpAmmo", GetPVarInt(issuerid, "rpAmmo")-1);
  4414.                             SetPVarInt(issuerid, "rpAmmoCheat", GetPVarInt(issuerid, "rpAmmoCheat")+1);
  4415.                         }
  4416.                     }
  4417.                 }
  4418.             }
  4419.         }
  4420.     }
  4421.     if(amount < 10)
  4422.     {
  4423.         SetPVarInt(playerid, "rpDamage", 2);
  4424.     }
  4425.     if(amount > 10)
  4426.     {
  4427.         SetPVarInt(playerid, "rpDamage", 4);
  4428.     }
  4429.     UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pNickName], KOL_DAMAGE, CharName3DText(playerid));
  4430.     if(weaponid != 0 && issuerid != playerid && amount > 5.0)
  4431.     {
  4432.         ApplyAnimation(playerid, "CRACK", "crckidle1", 1.5, 1, 0, 0, 0, 0);
  4433.         SetPVarInt(playerid, "rpAnimacja", 15);
  4434.     }
  4435.     return 1;
  4436. }
  4437.  
  4438. Data()
  4439. {
  4440.     return getdate(Rok,Miesiac,Dzien);
  4441. }
  4442.  
  4443. Tip(playerid, tekst[])
  4444. {
  4445.     format(String, sizeof(String), "Tip:{FFFFFF} %s", tekst);
  4446.     return SendClientMessage(playerid, 0xB3D341FF, String);
  4447. }
  4448.  
  4449.  
  4450.  
  4451. KaraBox(text[])
  4452. {
  4453.     if(NapisUzywany)
  4454.     {
  4455.         TextDrawHideForAll(TDKara);
  4456.         KillTimer(NapisTimer);
  4457.     }
  4458.     NapisUzywany = true;
  4459.     TextDrawSetString(TDKara,text);
  4460.     TextDrawShowForAll(TDKara);
  4461.     NapisTimer=SetTimer("KaraBoxOFF", 15000, false);
  4462.     return 1;
  4463. }
  4464.  
  4465. Funkcja::KaraBoxOFF()
  4466. {
  4467.     NapisUzywany = false;
  4468.     TextDrawHideForAll(TDKara);
  4469.     KillTimer(NapisTimer);
  4470.     return 1;
  4471. }
  4472.  
  4473. Funkcja::UpdateGlobal(playerid, global)
  4474. {
  4475.     if(Login(playerid) == 1)
  4476.     {
  4477.         new query[256];
  4478.         mysql_reconnect();
  4479.         format(query, sizeof(query), "UPDATE `members` SET `gamescore`=%d, `NoRUN`=%d, `NoVEH`=%d, `NoOOC`=%d, `NoGUN`=%d, `premiumscore`=%d, `premium`=%d WHERE `member_id`=%d", IPB[playerid][ipb_GameScore], IPB[playerid][ipb_NoRUN], IPB[playerid][ipb_NoVEH], IPB[playerid][ipb_NoOOC], IPB[playerid][ipb_NoGUN], IPB[playerid][ipb_PremiumScore], IPB[playerid][ipb_Premium], global);
  4480.         mysql_query_ex(query);
  4481.     }
  4482.     return 1;
  4483. }
  4484.  
  4485. Funkcja::Powitanie(playerid)
  4486. {
  4487.     Player[playerid][pGID]  = GetPVarInt(playerid, "pGID");
  4488.     new query[512];
  4489.     format(query, sizeof(query), "SELECT `gameperm`,`premium`,`ban_uid`,`member_group_id`,`ban_time`,`members_display_name` FROM `members` WHERE `member_id`=%d LIMIT 1", GetPVarInt(playerid, "pGID"));
  4490.     mysql_query_ex(query);
  4491.     mysql_store_result();
  4492.     if(mysql_num_rows() != 0)
  4493.     {
  4494.         mysql_fetch_row_format(query);
  4495.         sscanf(query, "p<|>ddddds[256]", Player[playerid][pAdmin], IPB[playerid][ipb_Premium], IPB[playerid][ipb_Ban], IPB[playerid][ipb_Grupa], IPB[playerid][ipb_BanTime], Player[playerid][pName]);
  4496.     }
  4497.     mysql_free_result();
  4498.  
  4499.     if(IPB[playerid][ipb_Grupa] == 5 || IPB[playerid][ipb_Ban] != 0 && gettime() < IPB[playerid][ipb_BanTime])
  4500.     {
  4501.         SetPVarInt(playerid, "TimeBanned", 1);
  4502.         SendClientMessage(playerid, -1, "Konto globalne, na które właśnie się zalogowałeś posiada status osoby {BB0000}zbanowanej{FFFFFF}.");
  4503.         format(String, sizeof(String), "Z powyższego powodu proces tworzenia logowania dla konta globalnego %s (UID: %d) zostaje przerwany.", Player[playerid][pName], Player[playerid][pGID]);
  4504.         SendClientMessage(playerid, -1, String);
  4505.         return KickWithMessage(playerid, -1, "Jeżeli nie zgadzasz się z nałożoną na Ciebie karą, napisz odwołanie na forum (page-rp.pl).");
  4506.     }
  4507.  
  4508.     //Sesja
  4509.     format(query, sizeof(query), "INSERT INTO `1sesje_log` (`data`,`char`,`global`,`status`,`IP`) VALUES ('%d', %d, '%d', '%d', '%s')", gettime(), Player[playerid][pUID], Player[playerid][pGID], 1, Player[playerid][pIP]);
  4510.     mysql_query_ex(query);
  4511.  
  4512.     Player[playerid][pLastLogin] = gettime();
  4513.     Player[playerid][pInGame] = 1;
  4514.     SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
  4515.     if(IPB[playerid][ipb_Premium] > gettime())
  4516.         SetPlayerColor(playerid, 0xFFFFFFFF);
  4517.     else
  4518.         SetPlayerColor(playerid, 0xD6D6D6FF);
  4519.     format(String, sizeof(String), "Witaj {AAC5E3}%s{FFFFFF}, zalogowałeś się na postać {AAC5E3}%s (UID: %d, GID: %d){FFFFFF}. Miłej gry!", Player[playerid][pName], Nick(playerid), Player[playerid][pUID], Player[playerid][pGID], playerid);
  4520.     SendClientMessage(playerid, -1, String);
  4521.     SetPlayerScore(playerid, IPB[playerid][ipb_GameScore]);
  4522.     if(Player[playerid][pAdmin] > 0)
  4523.     {
  4524.             SendClientMessage(playerid, -1, "Konto globalne, na które właśnie się zalogowałeś posiada status {BB0000}Administratora{FFFFFF}. Pamiętaj, by nie nadużywać uprawnień.");
  4525.     }
  4526.     HidePlayerZone(playerid);
  4527.     ShowPlayerZone(playerid);
  4528.     Player[playerid][pGID] = GetPVarInt(playerid, "pGID");
  4529.     Global_Data_Load(playerid);
  4530.  
  4531.     //Pierwsze logowanie w danym dniu
  4532.     new day, month, year;
  4533.     getdate(day, month, year);
  4534.     if(Player[playerid][pLastDay] != day)
  4535.     {
  4536.         Player[playerid][pLastDay]      = day;
  4537.         IPB[playerid][ipb_GameScore]    += 15;
  4538.         Tip(playerid, "Otrzymujesz 15 punktów GameScore za pierwsze logowanie się w tym dniu.");
  4539.         Global_Data_Save(playerid);
  4540.     }
  4541.  
  4542.     for(new p = 0; p < MAX_ITEM; p++)
  4543.     {
  4544.         if(Przedmiot[p][iAktywny] == 1)
  4545.         {
  4546.             if(Przedmiot[p][iTyp] == 18 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
  4547.             {
  4548.                 if(Przedmiot[p][iWartosc1] == Player[playerid][pTelefon])
  4549.                 {
  4550.                     return Przedmiot[p][iUsed] = 1;
  4551.                 }
  4552.             }
  4553.         }
  4554.     }
  4555.     SetPVarInt(playerid, "Teleport", 1);
  4556.     return Player[playerid][pTelefon] = 0;
  4557. }
  4558.  
  4559. Funkcja::Achivement(playerid, achiv)
  4560. {
  4561.     new query[256], achiv0 = 0;
  4562.     if(achiv == 1 && Player[playerid][pAchiv1] == 0)
  4563.     {
  4564.         achiv0++;
  4565.         Player[playerid][pAchiv1] = gettime();
  4566.         format(query, sizeof(query), "UPDATE `1postacie` SET `achiv1`=%d", Player[playerid][pAchiv1]);
  4567.     }
  4568.     else if(achiv == 2 && Player[playerid][pAchiv2] == 0)
  4569.     {
  4570.         achiv0++;
  4571.         Player[playerid][pAchiv2] = gettime();
  4572.         format(query, sizeof(query), "UPDATE `1postacie` SET `achiv2`=%d", Player[playerid][pAchiv2]);
  4573.     }
  4574.     else if(achiv == 3 && Player[playerid][pAchiv3] == 0)
  4575.     {
  4576.         achiv0++;
  4577.         Player[playerid][pAchiv3] = gettime();
  4578.         format(query, sizeof(query), "UPDATE `1postacie` SET `achiv3`=%d", Player[playerid][pAchiv3]);
  4579.     }
  4580.     if(achiv0 > 0) return mysql_query_ex(query);
  4581.     return 1;
  4582. }
  4583.  
  4584. Funkcja::Sekundnik()
  4585. {
  4586.     new player = 0;
  4587.     foreach(Player, p)
  4588.     {
  4589.         player++;
  4590.     }
  4591.     if(player > Statystyki[1])
  4592.     {
  4593.         Statystyki[1] = player;
  4594.     }
  4595.     new hour, minute, second, Time[3], players;
  4596.     gettime(hour, minute, second);
  4597.     if(minute == 01 && second < 3)
  4598.     {
  4599.         SetWorldTime(hour);
  4600.     }
  4601.     //system pojazdów
  4602.     for(new v = 0; v < MAX_VEHICLES; v++)
  4603.     {
  4604.         GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
  4605.         if(engine == 1)
  4606.         {
  4607.             foreach(Player, p)
  4608.             {
  4609.                 if(GetPlayerVehicleID(p) == v)
  4610.                 {
  4611.                     if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
  4612.                     {
  4613.                         if(GetPlayerSpeed(p) >= 100)
  4614.                         Pojazd[CarUID(v)][vPaliwo] -= 0.007;
  4615.                         else if(GetPlayerSpeed(p) < 100 && GetPlayerSpeed(p) > 10)
  4616.                         Pojazd[CarUID(v)][vPaliwo] -= 0.005;
  4617.                         else if(GetPlayerSpeed(p) <= 10)
  4618.                         Pojazd[CarUID(v)][vPaliwo] -= 0.003;
  4619.                         new Float:speed, Float:timex;
  4620.                         speed = GetPlayerSpeed(p);
  4621.                         timex = 3600;
  4622.                         Pojazd[CarUID(v)][vPrzebieg] += speed/timex*3;
  4623.                         Player[p][pWyjezdzone] += speed/timex*3;
  4624.                     }
  4625.                 }
  4626.                 else
  4627.                 {
  4628.                     Pojazd[CarUID(v)][vPaliwo] -= 0.001;
  4629.                 }
  4630.             }
  4631.             if(Pojazd[CarUID(v)][vPaliwo] <= 0.0)
  4632.             {
  4633.                 SetVehicleParamsEx(v, 0, lights, alarm, doors, bonnet, boot, objective);
  4634.             }
  4635.  
  4636.         }
  4637.     }
  4638.     //koniec
  4639.     foreach(Player, p)
  4640.     {
  4641. //      format(String, sizeof(String), "FPS: %d", GetPlayerFPS(p)), Tip(p, String);
  4642.         if(Login(p) == 1)
  4643.         {
  4644.             //strefy
  4645.             if(GetPVarInt(p, "LastZone") != PlayerInZone(p))
  4646.             {
  4647.                 if(!AreaToArea(150.0, GetPVarInt(p, "LastZone"), PlayerInZone(p)))
  4648.                 {
  4649.                     if(GetPVarInt(p, "Teleport") == 0 && GetPVarInt(p, "LastZone") > 0)
  4650.                     {
  4651.                         if(GetPlayerVirtualWorld(p) == 0 && PlayerInZone(p) != 0)
  4652.                         {
  4653.                             format(String, sizeof(String), "Prawdopodobny AirBreak: %d, %d.", GetPVarInt(p, "LastZone"), PlayerInZone(p));
  4654.                             Kara(0, p, -1, String, 0);
  4655.                         }
  4656.                     }
  4657.                 }
  4658.                 SetPVarInt(p, "Teleport", 0);
  4659.                 SetPVarInt(p, "LastZone", PlayerInZone(p));
  4660.                 if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
  4661.                 {
  4662.                     if(GetPVarInt(p, "LastSpeed") != GangZoneInfo[PlayerInZone(p)][gSpeed])
  4663.                     {
  4664.                         SetPVarInt(p, "LastSpeed", GangZoneInfo[PlayerInZone(p)][gSpeed]);
  4665.                         if(GangZoneInfo[PlayerInZone(p)][gSpeed] != 0)
  4666.                         format(String, sizeof(String), "~g~Limit:~w~ %dkmh.", GangZoneInfo[PlayerInZone(p)][gSpeed]);
  4667.                         else
  4668.                         format(String, sizeof(String), "~g~Limit:~w~ brak.");
  4669.                         GameTextForPlayer(p, String, 1250, 6);
  4670.                     }
  4671.                 }
  4672.             }
  4673.             //
  4674.             if(GetPlayerSpeed(p) > 0)
  4675.             {
  4676.                 if(gettime() > GetPVarInt(p, "Spawned"))
  4677.                 {
  4678.                     new Float:PosX, Float:PosY, Float:PosZ,
  4679.                         VirtualWorld, InteriorID;
  4680.                     GetPlayerPos(p, PosX, PosY, PosZ);
  4681.                     VirtualWorld    = GetPlayerVirtualWorld(p);
  4682.                     InteriorID      = GetPlayerInterior(p);
  4683.  
  4684.                     Player[p][pPosX]    = PosX;
  4685.                     Player[p][pPosY]    = PosY;
  4686.                     Player[p][pPosZ]    = PosZ;
  4687.                     Player[p][pVir]     = VirtualWorld;
  4688.                     Player[p][pInt]     = InteriorID;
  4689.                 }
  4690.             }
  4691.             if(GetPVarInt(p, "rpWedka2") < gettime())
  4692.             {
  4693.                 if(GetPVarInt(p, "rpWedka1") != 0)
  4694.                 {
  4695.                     SetPVarInt(p, "rpWedka1", 0);
  4696.                     SetPVarInt(p, "rpWedka2", 0);
  4697.                     SetPVarInt(p, "rpWedka3", 0);
  4698. /*                  new ryba = random(20);
  4699.                     switch(ryba)
  4700.                     {
  4701.                         case 0:
  4702.                         {
  4703.                             return 1;
  4704.                         }
  4705.                         case 1..3:
  4706.                         {
  4707.                             return 1;
  4708.                         }
  4709.                         case 4:
  4710.                         case 5:
  4711.                         case 6..7:
  4712.                         {
  4713.                             return 1;
  4714.                         }
  4715.                         case 8:
  4716.                         case 9:
  4717.                         case 10:
  4718.                         case 11..14:
  4719.                         {
  4720.                             return 1;
  4721.                         }
  4722.                         case 15:
  4723.                         case 16:
  4724.                         case 17:
  4725.                         case 18:
  4726.                         case 19:
  4727.                         case 20:
  4728.                         case 21..23:
  4729.                         {
  4730.                             return 1;
  4731.                         }
  4732.                         case 24:
  4733.                         case 25:
  4734.                     }
  4735. */
  4736.                 }
  4737.             }
  4738.             else
  4739.             {
  4740.                 if(GetPVarInt(p, "rpWedka1") != 0)
  4741.                 {
  4742.                     if(GetPVarInt(p, "rpWedka3") == 4)
  4743.                     {
  4744.                         SetPVarInt(p, "rpWedka3", 0);
  4745.                         ApplyAnimation(p, "SWORD", "sword_block", 50.0, 0, 1, 0, 1, 1);
  4746.                     }
  4747.                     else
  4748.                     {
  4749.                         SetPVarInt(p, "rpWedka3", GetPVarInt(p, "rpWedka3")+1);
  4750.                     }
  4751.                     //random itemów
  4752.                 }
  4753.             }
  4754.             SetPVarInt(p, "AFK", GetPVarInt(p, "AFK") + 1);
  4755.             players++;
  4756.             FullTime(Player[p][pOnline], Time[0], Time[1], Time[2]);
  4757.             if(Time[1] == 0 && Time[2] == 0)
  4758.             {
  4759.                 if(Time[0] == 30 && Time[1] == 0 && Time[2] < 1 && Player[p][pAchiv1] <= 0)
  4760.                 {
  4761.                     IPB[p][ipb_GameScore] += 250;
  4762.                     Achivement(p, 1);
  4763.                     InfoBoxShow(0, p, "Gratulacje!~n~Odblokowales osiagniecie ~y~30 godzin online~w~!~n~Otrzymujesz w nagrode ~b~~h~250~w~ punktow ~b~~h~GameScore~w~!", 6);
  4764.                 }
  4765.                 if(IPB[p][ipb_Premium] > gettime())
  4766.                     IPB[p][ipb_GameScore] += 15;
  4767.                     else
  4768.                     IPB[p][ipb_GameScore] += 10;
  4769.                 UpdateGlobal(p, Player[p][pGID]);
  4770.                 Global_Data_Save(p);
  4771.             }
  4772.             SetPlayerScore(p, IPB[p][ipb_GameScore]);
  4773.             if(Player[p][pBW] != 0)
  4774.             {
  4775.                 new animlib[32], animname[32];
  4776.                 GetAnimationName(GetPlayerAnimationIndex(p),animlib,32,animname,32);
  4777.                 format(String, sizeof(String), "~r~BW~w~: %d min.", Player[p][pBW]);
  4778.                 GameTextForPlayer(p, String, 1500, 1);
  4779.                 TogglePlayerControllable(p, false);
  4780.                 new Float:Pos[3];
  4781.                 GetPlayerPos(p, Pos[0], Pos[1], Pos[2]);
  4782.                 SetPlayerCameraPos(p, Pos[0], Pos[1]+2, Pos[2]+12);
  4783.                 SetPlayerCameraLookAt(p, Pos[0], Pos[1], Pos[2]);
  4784.                 if(!strcmp(animname, "crckdeth1"))
  4785.                     animlib = " ";
  4786.                     else
  4787.                     ApplyAnimation(p,"CRACK","crckdeth1",4.1,0,0,0,1,0);
  4788.  
  4789.             }
  4790.             if(GetPVarInt(p, "rpAnimacja") != 0)
  4791.             {
  4792.                 SetPVarInt(p, "rpAnimacja", GetPVarInt(p, "rpAnimacja")-1);
  4793.                 if(GetPVarInt(p, "rpAnimacja") <= 0)
  4794.                 {
  4795.                     ClearAnimations(p);
  4796.                 }
  4797.             }
  4798.             if(Sluzba(p) != 0 && Grupa[Sluzba(p)][gAktywna] == 1)
  4799.             {
  4800.                 Player[p][pDutyAll]++;
  4801.             }
  4802.             if(GetPVarInt(p, "AFK") < 5)
  4803.             {
  4804.                 Player[p][pPayDayGame]++;
  4805.             }
  4806.             Player[p][pOnline]++;
  4807.             Statystyki[4]++;
  4808.             if(GetPVarInt(p, "rpDamage") > 0)
  4809.             {
  4810.                 SetPVarInt(p, "rpDamage", GetPVarInt(p, "rpDamage")-1);
  4811.             }
  4812.             if(GetPVarInt(p, "rpDamage") == 0)
  4813.             {
  4814.                 if((Grupa[Sluzba(p)][gFlagPerm] & G_FLAG_COLOR))
  4815.                 UpdateDynamic3DTextLabelText(Text3D:Player[p][pNickName], Grupa[Sluzba(p)][gKolor], CharName3DText(p));
  4816.                 else
  4817.                 UpdateDynamic3DTextLabelText(Text3D:Player[p][pNickName], KOL_NAME, CharName3DText(p));
  4818.             }
  4819.             //Resetowanie /ame
  4820.             if(gettime() > GetPVarInt(p, "rpAme"))
  4821.             {
  4822.                 UpdateDynamic3DTextLabelText(Text3D:Player[p][pAme], COLOR_PURPLE, " ");
  4823.             }
  4824.             //oferta naprawy
  4825.             if(GetPVarInt(p, "OffeVehTime") != 0 && GetPVarInt(p, "OffeVehType") == OFFER_REPAIR)
  4826.             {
  4827.                 new Float:vehPos[3];
  4828.                 GetVehiclePos(GetPVarInt(p, "OffeVeh"), vehPos[0], vehPos[1], vehPos[2]);
  4829.                 GetVehicleParamsEx(GetPVarInt(p, "OffeVeh"), engine, lights, alarm, doors, bonnet, boot, objective);
  4830.                 if(engine <= 0)
  4831.                 {
  4832.                     if(IsPlayerInRangeOfPoint(p, 6.0, vehPos[0], vehPos[1], vehPos[2]))
  4833.                     {
  4834.                         SetPVarInt(p, "OffeVehTime", GetPVarInt(p, "OffeVehTime")-1);
  4835.                         TextDrawShowForPlayer(p, TDOffe[p]);
  4836.                         format(String, sizeof(String), "~w~Naprawa:~b~~h~~h~ %d ~w~sekund.", GetPVarInt(p, "OffeVehTime"));
  4837.                         TextDrawSetString(TDOffe[p], String);
  4838.  
  4839.                         format(String, sizeof(String), "Pojazd jest w trakcie naprawy\nDo końca: %d sekund.", GetPVarInt(p, "OffeVehTime"));
  4840.                         UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, String);
  4841.  
  4842.                         if(GetPVarInt(p, "OffeVehTime") <= 0)
  4843.                         {
  4844.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP] = 1000.0;
  4845.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels]   = 0;
  4846.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors]    = 0;
  4847.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights]   = 0;
  4848.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires]    = 0;
  4849.                             SetVehicleHealth(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP]);
  4850.                             UpdateVehicleDamageStatus(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires]);
  4851.                             ZapiszPojazd(CarUID(GetPVarInt(p, "OffeVeh")));
  4852.                             format(String, sizeof(String), "Naprawa pojazdu %s (UID: %d) została zakończona.", GetVehicleName(CarUID(GetPVarInt(p, "OffeVeh"))), CarUID(GetPVarInt(p, "OffeVeh"))), Info(p, String);
  4853.                             TextDrawHideForPlayer(p, TDOffe[p]);
  4854.                             Offer[p][oBlock] = 0;
  4855.                             UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, " ");
  4856.                         }
  4857.                     }
  4858.                     else
  4859.                     {
  4860.                         GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Oddaliles sie od pojazdu.", 2000, 5);
  4861.                     }
  4862.                 }
  4863.                 else
  4864.                 {
  4865.                     GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Silnik pojazdu musi byc zgaszony.", 2000, 5);
  4866.                 }
  4867.             }
  4868.             //oferta lakierowania
  4869.             if(GetPVarInt(p, "OffeVehTime") != 0 && GetPVarInt(p, "OffeVehType") == OFFER_RESPRAY)
  4870.             {
  4871.  
  4872.             }
  4873.             //oferta montażu
  4874.             if(GetPVarInt(p, "OffeVehTime") != 0 && GetPVarInt(p, "OffeVehType") == OFFER_MONTAGE)
  4875.             {
  4876.                 new Float:vehPos[3];
  4877.                 GetVehiclePos(GetPVarInt(p, "OffeVeh"), vehPos[0], vehPos[1], vehPos[2]);
  4878.                 GetVehicleParamsEx(GetPVarInt(p, "OffeVeh"), engine, lights, alarm, doors, bonnet, boot, objective);
  4879.                 if(engine <= 0)
  4880.                 {
  4881.                     if(IsPlayerInRangeOfPoint(p, 6.0, vehPos[0], vehPos[1], vehPos[2]))
  4882.                     {
  4883.                         SetPVarInt(p, "OffeVehTime", GetPVarInt(p, "OffeVehTime")-1);
  4884.                         TextDrawShowForPlayer(p, TDOffe[p]);
  4885.                         format(String, sizeof(String), "~w~Montaz komponentu:~b~~h~~h~ %d ~w~sekund.", GetPVarInt(p, "OffeVehTime"));
  4886.                         TextDrawSetString(TDOffe[p], String);
  4887.  
  4888.                         format(String, sizeof(String), "Pojazd jest w trakcie montażu\nDo końca: %d sekund.", GetPVarInt(p, "OffeVehTime"));
  4889.                         UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, String);
  4890.  
  4891.                         if(GetPVarInt(p, "OffeVehTime") <= 0)
  4892.                         {
  4893.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP] = 1000.0;
  4894.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels]   = 0;
  4895.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors]    = 0;
  4896.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights]   = 0;
  4897.                             Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires]    = 0;
  4898.                             SetVehicleHealth(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP]);
  4899.                             UpdateVehicleDamageStatus(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires]);
  4900.                             ZapiszPojazd(CarUID(GetPVarInt(p, "OffeVeh")));
  4901.                             format(String, sizeof(String), "Montaż komponentu w pojeździe %s (UID: %d) został zakończony.", GetVehicleName(CarUID(GetPVarInt(p, "OffeVeh"))), CarUID(GetPVarInt(p, "OffeVeh"))), Info(p, String);
  4902.                             TextDrawHideForPlayer(p, TDOffe[p]);
  4903.                             Offer[p][oBlock] = 0;
  4904.                             UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, " ");
  4905.                         }
  4906.                     }
  4907.                     else
  4908.                     {
  4909.                         GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Oddaliles sie od pojazdu.", 2000, 5);
  4910.                     }
  4911.                 }
  4912.                 else
  4913.                 {
  4914.                     GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Silnik pojazdu musi byc zgaszony.", 2000, 5);
  4915.                 }
  4916.             }
  4917.         }
  4918.     }
  4919.     if(players > Serwer[1])
  4920.     {
  4921.         Serwer[1] = players;
  4922.     }
  4923.     if(hour == 10 && minute == 35 && second < 3 && restart == 0)
  4924.     {
  4925.         new query[256];
  4926.         format(query, sizeof(query), "INSERT INTO `1stats` (`data`,`logowania`,`gracze`,`komendy`,`kary`,`online`) VALUES ('%d', %d, '%d', %d, '%d', %d)", gettime(), Statystyki[0], Statystyki[1], Statystyki[2], Statystyki[3], Statystyki[4]);
  4927.         mysql_query_ex(query);
  4928.         restart = 1;
  4929.         print("Wykonal sie automatyczny restart serwera.");
  4930.         for(new nr = 0; nr < MAX_OBIEKT; nr++){
  4931.                 if(Obiekt[nr][oAktywny] == 1){
  4932.                     ZapiszObiekt(nr);
  4933.                 }
  4934.         }
  4935.         for(new nr = 0; nr < MAX_ITEM; nr++){
  4936.                 if(Przedmiot[nr][iAktywny] == 1){
  4937.                     ZapiszPrzedmiot(nr);
  4938.                     if(Przedmiot[nr][iTyp] == 1 && Przedmiot[nr][iUsed] == 1)
  4939.                     {
  4940.                         Przedmiot[nr][iUsed] = 0;
  4941.                     }
  4942.                 }
  4943.         }
  4944.         foreach(Player, p)
  4945.         {
  4946.                 if(Login(p) == 1)
  4947.                 {
  4948.                     InfoBoxShow(2, p, "Wlasnie nastapil automatyczny restart serwera.", 3);
  4949.                     SavePlayerStats(p, SAVE_PLAYER_BASIC);
  4950.                     SavePlayerStats(p, SAVE_PLAYER_POS);
  4951.                     SavePlayerStats(p, SAVE_PLAYER_GROUP);
  4952.                     OnPlayerDisconnect(p, 0);
  4953.                     Kick(p);
  4954.                 }
  4955.         }
  4956.         for(new uid = 0; uid < 5000; uid++)
  4957.         {
  4958.             PayDay(uid);
  4959.         }
  4960.         mysql_free_result();
  4961.         SetTimerEx("Restart", 5000, 0, "");
  4962.     }
  4963.     return 1;
  4964. }
  4965.  
  4966. Funkcja::Minutnik()
  4967. {
  4968.     mysql_check();
  4969.     foreach(Player, p)
  4970.     {
  4971.         if(Login(p) == 1)
  4972.         {
  4973.             //Strefy
  4974.             HidePlayerZone(p);
  4975.             ShowPlayerZone(p);
  4976.             // AdminJail
  4977.             if(Player[p][pAJ] > 0)
  4978.             {
  4979.                 Player[p][pAJ]--;
  4980.                 if(Player[p][pAJ] == 0)
  4981.                 {
  4982.                     Tip(p, "Czas Twojego AJ dobiegł końca, graj zgodnie z zasadami RolePlay.");
  4983.                     OnPlayerSpawn(p);
  4984.                 }
  4985.             }
  4986.             // Brutally Wounded (bw)
  4987.             if(Player[p][pBW] > 0)
  4988.             {
  4989.                 ApplyAnimation(p,"CRACK","crckdeth1",4.1,0,0,0,1,0);
  4990.                 Player[p][pBW]--;
  4991.                 if(Player[p][pBW] == 0)
  4992.                 {
  4993.                     setHP(p, 9.0);
  4994.                     TogglePlayerControllable(p, true);
  4995.                     SetCameraBehindPlayer(p);
  4996.                     ClearAnimations(p);
  4997.                     Info(p, "Twoja postać ocknęła się po stanie nieprzytomności (BW).\nPamiętaj, że taki stan trzeba należycie odegrać.");
  4998.                 }
  4999.             }
  5000.             // Areszt
  5001.             if(Player[p][pJail] < gettime() && Player[p][pJail] != 0)
  5002.             {
  5003.                 new info[128];
  5004.                 Player[p][pJail] = 0;
  5005.                 SetPlayerPos(p, Drzwi[InDoor(p)][dWewPosX], Drzwi[InDoor(p)][dWewPosY], Drzwi[InDoor(p)][dWewPosZ]);
  5006.                 format(info, sizeof(info), "Czas aresztu gracza %s dobiegł końca. Zostaje on wypuszczony na wolność.", CharName(p));
  5007.                 SendGroupMessage(0, p, Drzwi[InDoor(p)][dOwnerUID], info);
  5008.             }
  5009.             // Zerowanie permów
  5010.             if(pGrupa[p][1] == 0 || Grupa[pGrupa[p][1]][gAktywna] == 0)
  5011.             {
  5012.                 pGrupaPerm[p][1] = 0;
  5013.             }
  5014.             if(pGrupa[p][2] == 0 || Grupa[pGrupa[p][2]][gAktywna] == 0)
  5015.             {
  5016.                 pGrupaPerm[p][2] = 0;
  5017.             }
  5018.             if(pGrupa[p][3] == 0 || Grupa[pGrupa[p][3]][gAktywna] == 0)
  5019.             {
  5020.                 pGrupaPerm[p][3] = 0;
  5021.             }
  5022.             if(pGrupa[p][4] == 0 || Grupa[pGrupa[p][4]][gAktywna] == 0)
  5023.             {
  5024.                 pGrupaPerm[p][4] = 0;
  5025.             }
  5026.             if(pGrupa[p][5] == 0 || Grupa[pGrupa[p][5]][gAktywna] == 0)
  5027.             {
  5028.                 pGrupaPerm[p][5] = 0;
  5029.             }
  5030.         }
  5031.     }
  5032.     return 1;
  5033. }
  5034.  
  5035. Funkcja::DziesiecioMinutnik()
  5036. {
  5037.     foreach(Player, p)
  5038.     {
  5039.         if(Login(p) == 1)
  5040.         {
  5041.             SavePlayerStats(p, SAVE_PLAYER_BASIC);
  5042.         }
  5043.     }
  5044.     for(new nr = 0; nr < MAX_ITEM; nr++)
  5045.     {
  5046.         if(Przedmiot[nr][iAktywny] == 1)
  5047.         {
  5048.             if(Przedmiot[nr][iTyp] == 17)
  5049.             {
  5050.                 if(Przedmiot[nr][iWartosc2] < gettime())
  5051.                 {
  5052.                     Przedmiot[nr][iAktywny] = 0;
  5053.                     DestroyDynamicObject(ItemObiekt[nr]);
  5054.                 }
  5055.             }
  5056.             ZapiszPrzedmiot(nr);
  5057.         }
  5058.     }
  5059.     for(new v = 0; v < MAX_VEHICLES; v++)
  5060.     {
  5061.         if(Pojazd[v][vSpawn] == 1)
  5062.         {
  5063.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  5064.             {
  5065.                 if(PojazdUID[veh] == v)
  5066.                 {
  5067.                     ZapiszPojazd(veh);
  5068.                 }
  5069.             }
  5070.         }
  5071.     }
  5072.     return 1;
  5073. }
  5074.  
  5075. Funkcja::AntyCheat()
  5076. {
  5077.     new bron[13], amunicja[13], ACS[512];
  5078.     foreach(Player, p)
  5079.     {
  5080.         new ban = 0;
  5081.         if(Login(p) == 1)
  5082.         {
  5083.             //kasa
  5084.             if(GetPlayerMoney(p) != dKasa(p))
  5085.             {
  5086.                 ResetPlayerMoney(p);
  5087.                 GivePlayerMoney(p, dKasa(p));
  5088.             }
  5089.             if(GetPVarInt(p, "rpDoorEnterExit") != 0)
  5090.             {
  5091.                 if(gettime() > GetPVarInt(p, "rpDoorEnterExit"))
  5092.                 {
  5093.                     TogglePlayerControllable(p, true);
  5094.                     SetPVarInt(p, "rpDoorEnterExit", 0);
  5095.                 }
  5096.             }
  5097.             //na pojazdy / w pojazdach
  5098.             if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
  5099.             {
  5100.                 new v = GetPlayerVehicleID(p), veh = CarUID(v), Float:vehHP, panels1, doors1, lights1, tires1;
  5101.                 //komponenty pojazdu
  5102.                 for(new component = 0; component < 14; component++)
  5103.                 {
  5104.                     new comp = GetVehicleComponentInSlot(v, component), bool:compreturn;
  5105.                     if(comp > 0)
  5106.                     {
  5107.                         if(VehTune[v][0] == comp)
  5108.                         { compreturn = true; }
  5109.                         if(VehTune[v][1] == comp)
  5110.                         { compreturn = true; }
  5111.                         if(VehTune[v][2] == comp)
  5112.                         { compreturn = true; }
  5113.                         if(VehTune[v][3] == comp)
  5114.                         { compreturn = true; }
  5115.                         if(VehTune[v][4] == comp)
  5116.                         { compreturn = true; }
  5117.                         if(VehTune[v][5] == comp)
  5118.                         { compreturn = true; }
  5119.                         if(VehTune[v][6] == comp)
  5120.                         { compreturn = true; }
  5121.                         if(VehTune[v][7] == comp)
  5122.                         { compreturn = true; }
  5123.                         if(VehTune[v][8] == comp)
  5124.                         { compreturn = true; }
  5125.                         if(VehTune[v][9] == comp)
  5126.                         { compreturn = true; }
  5127.                         if(VehTune[v][10] == comp)
  5128.                         { compreturn = true; }
  5129.                         if(VehTune[v][11] == comp)
  5130.                         { compreturn = true; }
  5131.                         if(VehTune[v][12] == comp)
  5132.                         { compreturn = true; }
  5133.                         if(VehTune[v][13] == comp)
  5134.                         { compreturn = true; }
  5135.                         if(compreturn == false)
  5136.                         {
  5137.                             new string[128];
  5138.                             format(string, sizeof(string), "Tuning pojazdu: %d (%s) (Komponent: %d).", v, GetVehicleName(CarUID(v)), comp), Kara(0, p, -1, string, 0);
  5139.                             SetVehicleToRespawn(v);
  5140.                         }
  5141.                     }
  5142.                 }
  5143.                 //uszkodzenia wizualne
  5144.                 GetVehicleHealth(v, vehHP);
  5145.                 GetVehicleDamageStatus(v, panels1, doors1, lights1, tires1);
  5146.                 if(GetPVarInt(p, "Fix") < gettime())
  5147.                 {
  5148.                     if(panels1 == 0 && Pojazd[veh][vPanels] != 0 || doors1 == 0  && Pojazd[veh][vDoors] != 0 || lights1 == 0  && Pojazd[veh][vLights] != 0 || tires1 == 0 && Pojazd[veh][vTires] != 0 )
  5149.                     {
  5150.                         new string[128];
  5151.                         format(string, sizeof(string), "Wymuszona naprawa: %d (%s), Visual.", veh, GetVehicleName(veh)), Kara(0, p, -1, string, 0);
  5152.                         SetVehicleHealth(v, Pojazd[veh][vHP]);
  5153.                         UpdateVehicleDamageStatus(v, Pojazd[veh][vPanels], Pojazd[veh][vDoors], Pojazd[veh][vLights], Pojazd[veh][vTires]);
  5154.                     }
  5155.                     //uszkodzenia wewnętrzne
  5156.                     if(vehHP > Pojazd[veh][vHP])
  5157.                     {
  5158.                         new string[128];
  5159.                         format(string, sizeof(string), "Wymuszona naprawa: %d (%s), HP (+%.1f).", veh, GetVehicleName(veh), vehHP-Pojazd[veh][vHP]), Kara(0, p, -1, string, 0);
  5160.                         SetVehicleHealth(v, Pojazd[veh][vHP]);
  5161.                     }
  5162.                 }
  5163.                 if(Pojazd[veh][vHP] > vehHP)
  5164.                 {
  5165.                     new Float:Difference = Pojazd[veh][vHP] - vehHP;
  5166.                     //zapis do logów w tym miejscu
  5167.                     //koniec zapisu do logów -> początek zabierania HP wedle obrażeń pojazdu
  5168.                     Pojazd[veh][vHP] = vehHP;
  5169.                     foreach(Player, player)
  5170.                     {
  5171.                         if(GetPlayerVehicleID(p) == v && Player[p][pBW] == 0)
  5172.                         {
  5173.                             new Float:Damage = 0.0;
  5174.                             if(GetPVarInt(player, "rpPasy") == 1)
  5175.                                 Damage = Difference * 0.05;
  5176.                                 else
  5177.                                 Damage = Difference * 0.1;
  5178.                             if(dHP[player] < Damage)
  5179.                             {
  5180.                                 new string[128];
  5181.                                 format(string, sizeof(string), "** %s w skutek wypadku stracił przytomność. **", CharName(player));
  5182.                                 ProxDetector(10.0, player, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
  5183.                                 SetPVarInt(player, "SpawnBW", gettime()+5);
  5184.                                 ApplyAnimation(player, "CRACK", "crckdeth1", 4.1, 0, 0, 0, 1, 0);
  5185.                                 TogglePlayerControllable(player, false);
  5186.                                 Player[player][pBW] = 10;
  5187.                             }
  5188.                             else
  5189.                             {
  5190.                                 giveHP(player, -Damage);
  5191.                             }
  5192.                             SetPVarInt(player, "rpDamage", 2);
  5193.                             UpdateDynamic3DTextLabelText(Text3D:Player[player][pNickName], KOL_DAMAGE, CharName3DText(player));
  5194.                         }
  5195.                     }
  5196.                 }
  5197.                 if(GetPlayerSpeed(p) > 275)
  5198.                 {
  5199.                     format(ACS, sizeof(ACS), "SpeedHack: %dkm/h (%s).", GetPlayerSpeed(p), GetVehicleName(CarUID(v))), Kara(0, p, -1, ACS, 7);
  5200.                 }
  5201.             }
  5202.             if(GetPVarInt(p, "Banned") <  gettime())
  5203.             {
  5204.                 if(GetPVarInt(p, "Banned") != 0)
  5205.                 {
  5206.                     Kick(p);
  5207.                 }
  5208.             }
  5209.             for(new player = 0; player < MAX_PLAYERS; player++)
  5210.             {
  5211.                 if(player != p && Login(player) == 1)
  5212.                 {
  5213.                     if(Player[p][pUID] == Player[player][pUID])
  5214.                     {
  5215.                         Kara(0, player, -1, "Double InGame Char.", 0);
  5216.                     }
  5217.                 }
  5218.             }
  5219.             new Float:armour, Float:ACHP;
  5220.             GetPlayerHealth(p, ACHP);
  5221.             if(ACHP != dHP[p])
  5222.             {
  5223.                 if(ACHP > dHP[p])
  5224.                 {
  5225.                     if(GetPVarInt(p, "ACT") < gettime() - 30)
  5226.                     {
  5227.                         SetPVarInt(p, "ACT", gettime());
  5228.                         SetPVarInt(p, "ACR", 0);
  5229.                     }
  5230.                     else
  5231.                     {
  5232.                         if(Player[p][pBW] != 0)
  5233.                         {
  5234.                             SetPVarInt(p, "ACR", 0);
  5235.                         }
  5236.                         SetPVarInt(p, "ACR", GetPVarInt(p, "ACR")+1);
  5237.                         /*if(GetPVarInt(p, "ACR") > 10)
  5238.                         {
  5239.                             Kara(0, p, -1, "Prawdopodobny GodMode.", 0);
  5240.                         }*/
  5241.                     }
  5242.                     SetPlayerHealth(p, dHP[p]);
  5243.                 }
  5244.                 else
  5245.                 {
  5246.                     dHP[p] = ACHP;
  5247.                 }
  5248.             }
  5249.  
  5250.             GetPlayerArmour(p, armour);
  5251.             if(armour >= 1)
  5252.             {
  5253.                 format(ACS, sizeof(ACS), "Armour: %.1f%.", armour), Kara(0, p, -1, ACS, 0);
  5254.             }
  5255.             if(GetPlayerSpeed(p) > 3)
  5256.             {
  5257.                 if(gettime() > GetPVarInt(p, "SpawnBW"))
  5258.                 {
  5259.                     if(Player[p][pBW] != 0)
  5260.                     {
  5261.                         format(ACS, sizeof(ACS), "UnFreeze: %dj.", GetPlayerSpeed(p));
  5262.                         Kara(0, p, -1, ACS, 7);
  5263.                     }
  5264.                 }
  5265.             }
  5266.             //Broń
  5267.             for (new i = 0; i < 13; i++)
  5268.             {
  5269.                 GetPlayerWeaponData(p, i, bron[i], amunicja[i]);
  5270.                 if(bron[i] != GetPVarInt(p, "rpBron"))
  5271.                 {
  5272.                     if(bron[i] != 0)
  5273.                     {
  5274.                         if(GetPVarInt(p, "rpBronAC") < gettime())
  5275.                         {
  5276.                             if(bron[i] != 0)
  5277.                             {
  5278.                                 ban = 1;
  5279.                                 format(ACS, sizeof(ACS), "Bron: %d/%d (%s), System: %d/%d (%s).", bron[i], amunicja[i], WeapName(bron[i]), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpAmmo"), WeapName(GetPVarInt(p, "rpBron"))), Kara(0, p, -1, ACS, 7);
  5280.                                 break;
  5281.                             }
  5282.                         }
  5283.                     }
  5284.                 }
  5285.                 if(amunicja[i] > GetPVarInt(p, "rpAmmo") && ban == 0)
  5286.                 {
  5287.                     if(GetPVarInt(p, "rpBronAC") < gettime())
  5288.                     {
  5289.                         if(GetPVarInt(p, "rpAmmoCheat") == 0)
  5290.                                 format(ACS, sizeof(ACS), "Ammo: %d/%d (%s), System: %d/%d (%s).", bron[i], amunicja[i], WeapName(bron[i]), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpAmmo"), WeapName(GetPVarInt(p, "rpBron"))), Kara(0, p, -1, ACS, 21);
  5291.                         else
  5292.                         {
  5293.                             printf("[inf] %s - %d (Sys: %d/%d, Shot: %d)", NickShow(p), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpAmmo"), GetPVarInt(p, "rpAmmoCheat"));
  5294.                             format(ACS, sizeof(ACS), "Inf: %d/%d (%s), System: %d (%s), Shot: %d.", bron[i], amunicja[i], WeapName(GetPVarInt(p, "rpBron")), GetPVarInt(p, "rpBron"), WeapName(GetPVarInt(p, "rpBron")), GetPVarInt(p, "rpAmmoCheat")), Kara(0, p, -1, ACS, 21);
  5295.                         }
  5296.                         break;
  5297.                     }
  5298.                 }
  5299.             }
  5300.             // Anty FlyHack
  5301.             new anim_id = GetPlayerAnimationIndex(p), Float:PosX, Float:PosY, Float:PosZ;
  5302.             GetPlayerPos(p, PosX, PosY, PosZ);
  5303.             if(PosZ > 75.0 && (anim_id == 1543 || anim_id == 1538 || anim_id == 1539))
  5304.             {
  5305.                 format(ACS, sizeof(ACS), "FlyHack: %.1fh.", PosZ);
  5306.                 Kara(0, p, -1, ACS, 0);
  5307.             }
  5308.             //
  5309.             if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
  5310.             {
  5311.                 GetVehicleParamsEx(GetPlayerVehicleID(p), engine, lights, alarm, doors, bonnet, boot, objective);
  5312.                 if(lights == 1)
  5313.                     TextDrawSetString(Licznik1[p], "~g~~h~L");
  5314.                     else
  5315.                     TextDrawSetString(Licznik1[p], "~w~L");
  5316.                 if(engine == 1)
  5317.                 {
  5318.                     format(String, sizeof(String), "%03d km/h", GetPlayerSpeed(p));
  5319.                     TextDrawSetString(Licznik0[p], String);
  5320.                     format(String, sizeof(String), "%.2fL", Pojazd[CarUID(GetPlayerVehicleID(p))][vPaliwo]);
  5321.                     TextDrawSetString(Licznik2[p], String);
  5322.                 }
  5323.                 else
  5324.                 {
  5325.                     TextDrawSetString(Licznik0[p], "000 km/h");
  5326.                     TextDrawSetString(Licznik2[p], "0.00L");
  5327.                 }
  5328.             }
  5329.             //LastVehicle
  5330.             if(GetPlayerState(p) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(p) > 0 && GetPlayerVehicleID(p) != GetPVarInt(p, "LastVehicleID"))
  5331.             {
  5332.                     SetPVarInt(p, "LastVehicleID", GetPlayerVehicleID(p));
  5333.             }
  5334.             //Odspawnowywanie pojazdów
  5335.             for(new V = 0; V < MAX_VEHICLES; V++)
  5336.             {
  5337.                 new Float:vPos[4];
  5338.                 GetVehiclePos(V, vPos[0], vPos[1], vPos[2]);
  5339.                 GetVehicleZAngle(V, vPos[3]);
  5340.                 if(VehicleLastPos[V][0] > 0 || VehicleLastPos[V][1] > 0 || VehicleLastPos[V][2] > 0)
  5341.                 {
  5342.                     if(vPos[0] != VehicleLastPos[V][0] || vPos[1] != VehicleLastPos[V][1] || vPos[3] != VehicleLastPos[V][3])
  5343.                     {
  5344.                         new Occupied = 0;
  5345.                         foreach(Player, gracz)
  5346.                         {
  5347.                             if(GetPlayerVehicleID(gracz) == V)
  5348.                             {
  5349.                                 Occupied = 1;
  5350.                             }
  5351.                         }
  5352.                         if(Occupied == 0)
  5353.                         {
  5354.                             if(IsBoat(V) == 0)
  5355.                             {
  5356.                                 SetVehiclePos(V, VehicleLastPos[V][0], VehicleLastPos[V][1], VehicleLastPos[V][2]);
  5357.                                 SetVehicleZAngle(V, VehicleLastPos[V][3]);
  5358.                             }
  5359.                         }
  5360.                     }
  5361.                 }
  5362.             }
  5363.  
  5364.         }
  5365.     }
  5366.     return 1;
  5367. }
  5368.  
  5369. Funkcja::Kara(rodzaj, gracz, admin, powod[], czas)
  5370. {
  5371.     Statystyki[3]++;
  5372.     if(Login(gracz) == 0)
  5373.         return InfoBoxShow(2, admin, "~w~Nieznaleziono gracza po podanym ~y~ID~w~.~n~Prawdopodobnie nie jest zalogowany na serwer.", 3);
  5374.     new query[256], kara[128], text[64];
  5375.     if(czas == 1)
  5376.     text = "(1 dzien)";
  5377.         else
  5378.     format(text, sizeof(text), "(%d dni)", czas);
  5379.     if(czas == 0)
  5380.     {
  5381.         text = " ";
  5382.     }
  5383.     if(rodzaj == 0)
  5384.     {
  5385.         if(admin == -1)
  5386.         {
  5387.             format(kara, sizeof(kara), "Kick~n~~w~Gracz: %s~n~Nadal: System~n~%s", CharName(gracz), powod);
  5388.             KaraBox(kara), Kick(gracz);
  5389.         }
  5390.         else
  5391.         {
  5392.             format(kara, sizeof(kara), "Kick~n~~w~Gracz: %s~n~Nadal: %s~n~%s", CharName(gracz), CharName(admin), powod);
  5393.             KaraBox(kara), Kick(gracz);
  5394.             admin = Player[admin][pGID];
  5395.         }
  5396.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
  5397.     }
  5398.     else if(rodzaj == 1)
  5399.     {
  5400.         if(admin == -1)
  5401.         {
  5402.             format(kara, sizeof(kara), "Warn~n~~w~Gracz: %s~n~Nadal: System~n~%s", CharName(gracz), powod);
  5403.             KaraBox(kara);
  5404.         }
  5405.         else
  5406.         {
  5407.             format(kara, sizeof(kara), "Warn~n~~w~Gracz: %s~n~Nadal: %s~n~%s", CharName(gracz), CharName(admin), powod);
  5408.             KaraBox(kara);
  5409.             admin = Player[admin][pGID];
  5410.         }
  5411.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
  5412.     }
  5413.     else if(rodzaj == 2)
  5414.     {
  5415.         if(admin == -1)
  5416.         {
  5417.             format(kara, sizeof(kara), "Ban ~w~%s~n~Gracz: %s~n~Nadal: System~n~%s", text, CharName(gracz), powod);
  5418.             KaraBox(kara);
  5419.         }
  5420.         else
  5421.         {
  5422.             format(kara, sizeof(kara), "Ban ~w~%s~n~Gracz: %s~n~Nadal: %s~n~%s", text, CharName(gracz), CharName(admin), powod);
  5423.             KaraBox(kara);
  5424.             admin = Player[admin][pGID];
  5425.         }
  5426.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, gettime()+czas*86400, Player[gracz][pUID]);
  5427.         mysql_query_ex(query);
  5428.         return Banned(gracz, gettime()+czas*86400, mysql_insert_id());
  5429.     }
  5430.     else if(rodzaj == 3)
  5431.     {
  5432.         new czas1;
  5433.         if(czas == 0)
  5434.             czas1 = 999;
  5435.             else
  5436.             czas1 = gettime()+czas*86400;
  5437.         format(kara, sizeof(kara), "Blokada postaci ~w~%s~n~Gracz: %s~n~Nadal: %s~n~%s", text, CharName(gracz), CharName(admin), powod);
  5438.         KaraBox(kara), Player[gracz][pKonto] = czas1, Kick(gracz);
  5439.         admin = Player[admin][pGID];
  5440.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, czas1, Player[gracz][pUID]);
  5441.     }
  5442.     else if(rodzaj == 4)
  5443.     {
  5444.         Player[gracz][pAJ] = czas;
  5445.         if(admin == -1)
  5446.         {
  5447.             format(kara, sizeof(kara), "AdminJail~n~~w~Gracz: %s~n~Nadal: System~n~%s", CharName(gracz), powod);
  5448.             KaraBox(kara), Kick(gracz);
  5449.         }
  5450.         else
  5451.         {
  5452.             format(kara, sizeof(kara), "AdminJail~n~~w~Gracz: %s~n~Nadal: %s~n~%s", CharName(gracz), CharName(admin), powod);
  5453.             KaraBox(kara), Kick(gracz);
  5454.             admin = Player[admin][pGID];
  5455.         }
  5456.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
  5457.     }
  5458.     else if(rodzaj == 7)
  5459.     {
  5460.         Player[gracz][pKonto] = 999, Kick(gracz);
  5461.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
  5462.     }
  5463.     else if(rodzaj == 8)
  5464.     {
  5465.         Global_Data_Save(gracz);
  5466.         format(kara, sizeof(kara), "GameScore ~w~%s~n~Gracz: %s~n~Nadal: %s~n~%s", text, CharName(gracz), CharName(admin), powod);
  5467.         KaraBox(kara);
  5468.         admin = Player[admin][pGID];
  5469.         format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin,  gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
  5470.     }
  5471.     return mysql_query_ex(query);
  5472. }
  5473.  
  5474.  
  5475. Funkcja::Spawnuj(playerid)
  5476. {
  5477.     ResetPlayerWeapons(playerid);
  5478.     return SpawnPlayer(playerid);
  5479. }
  5480.  
  5481. Funkcja::dShowPlayerDialog(playerid,id,styl,napis[],text[],res[],res2[])
  5482. {
  5483.     setDialog(playerid,id);
  5484.     return ShowPlayerDialog(playerid,id,styl,napis,text,res,res2);
  5485. }
  5486.  
  5487. Funkcja::OnPlayerLoginIC(playerid, name[])
  5488. {
  5489.     if(Login(playerid) == 1)
  5490.     {
  5491.         SetPVarInt(playerid, "LastZone", 0);
  5492.         SetPVarInt(playerid, "Spawned", gettime()+5);
  5493.         TogglePlayerSpectating(playerid, false);
  5494.         for(new Globalne:i; i < Globalne; i++)
  5495.         IPB[playerid][i] = 0;
  5496.         Player[playerid][pSesja] = gettime();
  5497.         Data();
  5498.         new h, m, s, data[512];
  5499.         gettime(h, m, s);
  5500.         format(String, sizeof(String), "[info] Sesja rozpoczeta %02d/%02d/%d, Godzina %02d:%02d:%02d.", Dzien, Miesiac, Rok, h, m, s);
  5501.         PlayerLog(playerid, String);
  5502.         new query[512];
  5503.         format(query, sizeof(query), "SELECT `konto`,`online`,`skin`,`invisible`,`nick` FROM `1postacie` WHERE `uid`=%d LIMIT 1", Player[playerid][pUID]);
  5504.         mysql_query_ex(query);
  5505.         mysql_store_result();
  5506.         if(mysql_num_rows() != 0)
  5507.         {
  5508.             mysql_fetch_row_format(query);
  5509.             sscanf(query, "p<|>dddds[32]", Player[playerid][pKonto], Player[playerid][pOnline], Player[playerid][pSkin], Player[playerid][pInvisible], Player[playerid][pNick]);
  5510.         }
  5511.         mysql_free_result();
  5512.         //
  5513.         if(Player[playerid][pKonto] == 999)
  5514.             return Info(playerid, "Postać została uśmiercona w sposób InCharacter, nie możesz na niej grać."), Kick(playerid);
  5515.         if(Player[playerid][pKonto] != 1 && Player[playerid][pKonto] > gettime())
  5516.             return Info(playerid, "Konto zostało zablokowane przez Administrację.\nOdwiedź kartę gracza, by dowiedzieć się więcej."), Kick(playerid);
  5517.         Player[playerid][pKonto] = 1;
  5518.         GetPlayerIp(playerid, Player[playerid][pIP], 16);
  5519.         //wczytujemy wszystko
  5520.         format(query, sizeof(query), "SELECT `konto`,`online`,`skin`,`lastskin`,`owneruid`,`ingame`,`godziny`,`HP`,`plec`,`wiek`,`sila`,`invisible`,`allduty`,`job`,`spawnid`,`kasa`,`bank`,`BW`,`dystans`,`interior`,`vw`,`posx`,`posy`,`posz`,`quit`,`quittime`,`AJ`,`JAIL`,`Spawn`,`SpawnTyp`,`paydaygame`,`telefon` FROM `1postacie` WHERE uid = '%d' LIMIT 1", Player[playerid][pUID]);
  5521.         mysql_query_ex(query);
  5522.         mysql_store_result();
  5523.         if(mysql_fetch_row_format(data, "|"))
  5524.         {
  5525.             sscanf(data, "p<|>dddddddfddddddddddfddfffdddddddd",
  5526.             Player[playerid][pKonto],
  5527.             Player[playerid][pOnline],
  5528.             Player[playerid][pSkin],
  5529.             Player[playerid][pLastSkin],
  5530.             Player[playerid][pGID],
  5531.             Player[playerid][pInGame],
  5532.             Player[playerid][pGodziny],
  5533.             Player[playerid][pHP],
  5534.             Player[playerid][pSex],
  5535.             Player[playerid][pWiek],
  5536.             Player[playerid][pSila],
  5537.             Player[playerid][pInvisible],
  5538.             Player[playerid][pDutyAll],
  5539.             Player[playerid][pJob],
  5540.             Player[playerid][pSpawnID],
  5541.             Player[playerid][pKasa],
  5542.             Player[playerid][pBank],
  5543.             Player[playerid][pBW],
  5544.             Player[playerid][pWyjezdzone],
  5545.             Player[playerid][pInt],
  5546.             Player[playerid][pVir],
  5547.             Player[playerid][pPosX],
  5548.             Player[playerid][pPosY],
  5549.             Player[playerid][pPosZ],
  5550.             Player[playerid][pQuit],
  5551.             Player[playerid][pQuitTime],
  5552.             Player[playerid][pAJ],
  5553.             Player[playerid][pJail],
  5554.             Player[playerid][pSpawn],
  5555.             Player[playerid][pSpawnTyp],
  5556.             Player[playerid][pPayDayGame],
  5557.             Player[playerid][pTelefon]);
  5558.             SetPlayerHealth(playerid, Player[playerid][pHP]);
  5559.             setHP(playerid, Player[playerid][pHP]);
  5560.         }
  5561.         mysql_free_result();
  5562.         //Wczytyjemy grupy gracza
  5563.         format(query, sizeof(query), "SELECT `group_1`,`group_2`,`group_3`,`group_4`,`group_5`,`g_perm_1`,`g_perm_2`,`g_perm_3`,`g_perm_4`,`g_perm_5`,`g_payday_1`,`g_payday_2`,`g_payday_3`,`g_payday_4`,`g_payday_5` FROM `1postacie` WHERE uid = '%d' LIMIT 1", Player[playerid][pUID]);
  5564.         mysql_query_ex(query);
  5565.         mysql_store_result();
  5566.         if(mysql_fetch_row_format(data, "|"))
  5567.         {
  5568.             sscanf(data, "p<|>ddddddddddddddd", pGrupa[playerid][1], pGrupa[playerid][2], pGrupa[playerid][3], pGrupa[playerid][4], pGrupa[playerid][5],
  5569.             pGrupaPerm[playerid][1], pGrupaPerm[playerid][2], pGrupaPerm[playerid][3], pGrupaPerm[playerid][4], pGrupaPerm[playerid][5],
  5570.             pGrupaPayDay[playerid][1], pGrupaPayDay[playerid][2], pGrupaPayDay[playerid][3], pGrupaPayDay[playerid][4], pGrupaPayDay[playerid][5]);
  5571.         }
  5572.         mysql_free_result();
  5573.         //koniec
  5574.         Powitanie(playerid);
  5575.         Player[playerid][pGID]      = GetPVarInt(playerid, "pGID");
  5576.         return 1;
  5577.     }
  5578.     return Info(playerid, "Logowanie nieautoryzowane."), Kick(playerid);
  5579. }
  5580.  
  5581. Funkcja::SavePlayerStats(playerid, what)
  5582. {
  5583.     if(!Login(playerid) || GetPVarInt(playerid, "TimeBanned") == 1)
  5584.     {
  5585.         return 1;
  5586.     }
  5587.     Player[playerid][pLastLogin] = gettime();
  5588.     new timex[3];
  5589.     FullTime(Player[playerid][pOnline], timex[0], timex[1], timex[2]);
  5590.     Player[playerid][pGodziny] = timex[0];
  5591.     new query[512], main_query[1024];
  5592.     format(main_query, sizeof(main_query), "UPDATE `1postacie` SET");
  5593.     if(what & SAVE_PLAYER_CASH)
  5594.     {
  5595.         format(query, sizeof(query), " kasa = '%d', bank = '%d'", dKasa(playerid), Player[playerid][pBank]);
  5596.         if(strlen(main_query) > 32)
  5597.         {
  5598.             strcat(main_query, ",", sizeof(main_query));
  5599.         }
  5600.         strcat(main_query, query, sizeof(main_query));
  5601.     }
  5602.     if(what & SAVE_PLAYER_BASIC)
  5603.     {
  5604.         format(query, sizeof(query), " kasa = '%d', bank = '%d', skin = '%d', lastskin = '%d', dystans = '%f', BW = '%d', HP = '%f', Spawn = '%d', SpawnTyp = '%d', SpawnID = '%d', sila = '%d', job = '%d', paydaygame = '%d', AJ = '%d', JAIL = '%d', telefon = '%d', ingame = '%d', online = '%d', lastlogin = '%d', godziny = '%d', `konto` = '%d'",
  5605.         dKasa(playerid),
  5606.         Player[playerid][pBank], Player[playerid][pSkin], GetPlayerSkin(playerid), Player[playerid][pWyjezdzone], Player[playerid][pBW], dHP[playerid],
  5607.         Player[playerid][pSpawn], Player[playerid][pSpawnTyp], Player[playerid][pSpawnID], Player[playerid][pSila], Player[playerid][pJob], Player[playerid][pPayDayGame], Player[playerid][pAJ], Player[playerid][pJail], Player[playerid][pTelefon], Player[playerid][pInGame], Player[playerid][pOnline],
  5608.         Player[playerid][pLastLogin], Player[playerid][pGodziny], Player[playerid][pKonto]);
  5609.          
  5610.         if(strlen(main_query) > 32)
  5611.         {
  5612.             strcat(main_query, ",", sizeof(main_query));
  5613.         }
  5614.         strcat(main_query, query, sizeof(main_query));
  5615.     }
  5616.     if(what & SAVE_PLAYER_POS)
  5617.     {
  5618.         GetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
  5619.         Player[playerid][pInt] = GetPlayerInterior(playerid);
  5620.         Player[playerid][pVir] = GetPlayerVirtualWorld(playerid);
  5621.         // Pozycja (interior, virtual world, posx, posy, posz)
  5622.         format(query, sizeof(query), " quit = '%d', quittime = '%d', interior = '%d', vw = '%d', posx = '%f', posy = '%f', posz = '%f'",
  5623.         Player[playerid][pQuit], Player[playerid][pQuitTime], Player[playerid][pInt],
  5624.         Player[playerid][pVir],
  5625.         Player[playerid][pPosX],
  5626.         Player[playerid][pPosY],
  5627.         Player[playerid][pPosZ]);
  5628.  
  5629.         if(strlen(main_query) > 32)
  5630.         {
  5631.             strcat(main_query, ",", sizeof(main_query));
  5632.         }
  5633.         strcat(main_query, query, sizeof(main_query));
  5634.     }
  5635.     if(what & SAVE_PLAYER_GROUP)
  5636.     {
  5637.         // Pozycja (interior, virtual world, posx, posy, posz)
  5638.         format(query, sizeof(query), " group_1 = '%d', group_2 = '%d', group_3 = '%d', group_4 = '%d', group_5 = '%d', g_perm_1 = '%d', g_perm_2 = '%d', g_perm_3 = '%d', g_perm_4 = '%d', g_perm_5 = '%d', g_payday_1 = '%d', g_payday_2 = '%d', g_payday_3 = '%d', g_payday_4 = '%d', g_payday_5 = '%d'",
  5639.         pGrupa[playerid][1],
  5640.         pGrupa[playerid][2],
  5641.         pGrupa[playerid][3],
  5642.         pGrupa[playerid][4],
  5643.         pGrupa[playerid][5],
  5644.         pGrupaPerm[playerid][1],
  5645.         pGrupaPerm[playerid][2],
  5646.         pGrupaPerm[playerid][3],
  5647.         pGrupaPerm[playerid][4],
  5648.         pGrupaPerm[playerid][5],
  5649.         pGrupaPayDay[playerid][1],
  5650.         pGrupaPayDay[playerid][2],
  5651.         pGrupaPayDay[playerid][3],
  5652.         pGrupaPayDay[playerid][4],
  5653.         pGrupaPayDay[playerid][5]);
  5654.  
  5655.         if(strlen(main_query) > 32)
  5656.         {
  5657.             strcat(main_query, ",", sizeof(main_query));
  5658.         }
  5659.         strcat(main_query, query, sizeof(main_query));
  5660.     }
  5661.     format(query, sizeof(query), " WHERE uid = '%d' LIMIT 1", Player[playerid][pUID]);
  5662.     strcat(main_query, query, sizeof(main_query));
  5663.     return mysql_query_ex(main_query);
  5664. }
  5665.        
  5666. /*
  5667.         for(new s = 1; s < 6; s++)
  5668.         {
  5669.             if(GrupaGraczSlot(playerid, s, pGrupa[playerid][s]) != 0)
  5670.             {
  5671.                 if(pGrupa[playerid][s] != 0)
  5672.                 {
  5673.                     pGrupa[playerid][s] = 0;
  5674.                 }
  5675.             }
  5676.         }
  5677. */
  5678.  
  5679.  
  5680. //Update mysql
  5681.  
  5682. Funkcja::Door_Update(doorID)
  5683. {
  5684.     new query[512], main_query[1024];
  5685.     format(main_query, sizeof(main_query), "UPDATE `1drzwi` SET");
  5686.     if(Drzwi[doorID][dAktywne] == 1)
  5687.     {
  5688.         mysql_real_escape_string(Drzwi[doorID][dNazwa], Drzwi[doorID][dNazwa]);
  5689.         format(query, sizeof(query), " owner = '%d', owner_uid = '%d', name = '%s'", Drzwi[doorID][dOwner], Drzwi[doorID][dOwnerUID], Drzwi[doorID][dNazwa]);
  5690.         if(strlen(main_query) > 32)
  5691.         {
  5692.             strcat(main_query, ",", sizeof(main_query));
  5693.         }
  5694.         strcat(main_query, query, sizeof(main_query));
  5695.     }
  5696.     format(query, sizeof(query), " WHERE uid = '%d' LIMIT 1", doorID);
  5697.     strcat(main_query, query, sizeof(main_query));
  5698.     return mysql_query_ex(main_query);
  5699. }
  5700.  
  5701. //
  5702.  
  5703. Funkcja::Global_Data_Load(playerid)
  5704. {
  5705.     if(Player[playerid][pGID] == 0)
  5706.         return 1;
  5707.  
  5708.     new file[40];
  5709.     if(Login(playerid) != 1) return 1;
  5710.  
  5711.     format(file,sizeof(file), "Gracze/gData/%d.ini", Player[playerid][pGID]);
  5712.     if(DOF2_FileExists(file))
  5713.     {
  5714.         IPB[playerid][ipb_GameScore]        = DOF2_GetInt(file,     "GameScore");
  5715.         IPB[playerid][ipb_Premium]          = DOF2_GetInt(file,     "Premium");
  5716.         IPB[playerid][ipb_PremiumScore]     = DOF2_GetInt(file,     "PremiumScore");
  5717.         IPB[playerid][ipb_PremiumService]   = DOF2_GetInt(file,     "PremiumService");
  5718.         IPB[playerid][ipb_ZoneShow]         = DOF2_GetInt(file,     "ZoneShow");
  5719.     }
  5720.     else
  5721.     {
  5722.         DOF2_CreateFile(file);
  5723.         IPB[playerid][ipb_GameScore]        = DOF2_GetInt(file,     "GameScore");
  5724.         IPB[playerid][ipb_Premium]          = DOF2_GetInt(file,     "Premium");
  5725.         IPB[playerid][ipb_PremiumScore]     = DOF2_GetInt(file,     "PremiumScore");
  5726.         IPB[playerid][ipb_PremiumService]   = DOF2_GetInt(file,     "PremiumService");
  5727.         IPB[playerid][ipb_ZoneShow]         = DOF2_GetInt(file,     "ZoneShow");
  5728.     }
  5729.     UpdateGlobal(playerid, Player[playerid][pGID]);
  5730.     return DOF2_SaveFile();
  5731. }
  5732.  
  5733. Funkcja::Global_Data_Save(playerid)
  5734. {
  5735.     if(Player[playerid][pGID] == 0)
  5736.         return 1;
  5737.  
  5738.     UpdateGlobal(playerid, Player[playerid][pGID]);
  5739.  
  5740.     new file[40];
  5741.     if(Login(playerid) != 1) return 1;
  5742.  
  5743.     format(file,sizeof(file), "Gracze/gData/%d.ini", Player[playerid][pGID]);
  5744.     if(DOF2_FileExists(file))
  5745.     {
  5746.         DOF2_SetInt(file,   "GameScore",        IPB[playerid][ipb_GameScore]);
  5747.         DOF2_SetInt(file,   "Premium",          IPB[playerid][ipb_Premium]);
  5748.         DOF2_SetInt(file,   "PremiumScore",     IPB[playerid][ipb_PremiumScore]);
  5749.         DOF2_SetInt(file,   "PremiumService",   IPB[playerid][ipb_PremiumService]);
  5750.         DOF2_SetInt(file,   "ZoneShow",         IPB[playerid][ipb_ZoneShow]);
  5751.     }
  5752.     else
  5753.     {
  5754.         DOF2_CreateFile(file);
  5755.         DOF2_SetInt(file,   "GameScore",        IPB[playerid][ipb_GameScore]);
  5756.         DOF2_SetInt(file,   "Premium",          IPB[playerid][ipb_Premium]);
  5757.         DOF2_SetInt(file,   "PremiumScore",     IPB[playerid][ipb_PremiumScore]);
  5758.         DOF2_SetInt(file,   "PremiumService",   IPB[playerid][ipb_PremiumService]);
  5759.         DOF2_SetInt(file,   "ZoneShow",         1);
  5760.     }
  5761.     return DOF2_SaveFile();
  5762. }
  5763.  
  5764. ShowOrderCat(playerid)
  5765. {
  5766.     new kat[64], list[1024];
  5767.     for(new i = 1; i < sizeof(KategorieZamowien); i++)
  5768.     {
  5769.         format(kat, sizeof(kat), "%d\t%s", i, KategorieZamowien[i]);
  5770.         format(list, sizeof(list), "%s%s\n", list, kat);
  5771.     }
  5772.     return dShowPlayerDialog(playerid, 2000, DIALOG_STYLE_LIST, ""ServName"Zamówienia", list, "Wybierz", "Anuluj");
  5773. }
  5774.  
  5775. NickShow(playerid)
  5776. {
  5777.     new text[64];
  5778.     format(text, sizeof(text), "%s (UID: %d, GID: %d)", Nick(playerid), Player[playerid][pUID], Player[playerid][pGID]);
  5779.     return text;
  5780. }
  5781.  
  5782. Funkcja::PlayerToPlayer(Float:radi, playerid, targetid)
  5783. {
  5784.     if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid))
  5785.     {
  5786.         new Float:posx, Float:posy, Float:posz;
  5787.         new Float:oldposx, Float:oldposy, Float:oldposz;
  5788.         new Float:tempposx, Float:tempposy, Float:tempposz;
  5789.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  5790.         //radi = 2.0; //Trigger Radius
  5791.         GetPlayerPos(targetid, posx, posy, posz);
  5792.         tempposx = (oldposx -posx);
  5793.         tempposy = (oldposy -posy);
  5794.         tempposz = (oldposz -posz);
  5795.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  5796.         {
  5797.             return 1;
  5798.         }
  5799.     }
  5800.     return 0;
  5801. }
  5802.  
  5803. IsBoat(vehicleid)
  5804. {
  5805.     new boat = 0, model = GetVehicleModel(vehicleid);
  5806.     switch(model)
  5807.     {
  5808.         case 472: boat = 1;
  5809.         case 473: boat = 1;
  5810.         case 493: boat = 1;
  5811.         case 595: boat = 1;
  5812.         case 484: boat = 1;
  5813.         case 430: boat = 1;
  5814.         case 453: boat = 1;
  5815.         case 452: boat = 1;
  5816.         case 446: boat = 1;
  5817.         case 454: boat = 1;
  5818.     }
  5819.     return boat;
  5820. }
  5821.  
  5822. stock AreaToArea(Float:radi, area_one, area_two)
  5823. {
  5824.     new Float:tempposx, Float:tempposy, Float:tempposz;
  5825.     tempposx = (GangZoneInfo[area_one][gMinX] -GangZoneInfo[area_two][gMinX]);
  5826.     tempposy = (GangZoneInfo[area_one][gMinY] -GangZoneInfo[area_two][gMinY]);
  5827.     tempposz = (0 -0);
  5828.     if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  5829.     {
  5830.         return 1;
  5831.     }
  5832.     return 0;
  5833. }
  5834.  
  5835.  
  5836. stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
  5837. {
  5838.     new Float:X, Float:Y, Float:Z;
  5839.     GetPlayerPos(playerid, X, Y, Z);
  5840.     if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
  5841.     return 0;
  5842. }
  5843.  
  5844. stock GroupDoorInArea(group, area)
  5845. {
  5846.     new door = 0;
  5847.     for(new d = 1; d < MAX_DRZWI; d++)
  5848.     {
  5849.         if(Drzwi[d][dAktywne] == 1 && Drzwi[d][dOwner] == OWNER_GROUP && Drzwi[d][dOwnerUID] == group)
  5850.         {
  5851.             if(Drzwi[d][dZewPosX] <= GangZoneInfo[area][gMaxX] && Drzwi[d][dZewPosX] >= GangZoneInfo[area][gMinX] && Drzwi[d][dZewPosY] <= GangZoneInfo[area][gMaxY] && Drzwi[d][dZewPosY] >= GangZoneInfo[area][gMinY])
  5852.             {
  5853.                 door++;
  5854.             }
  5855.         }
  5856.     }
  5857.     return door;
  5858. }
  5859.  
  5860. stock PlayerInZone(playerid)
  5861. {
  5862.     new zone = 0;
  5863.     for(new g = 1; g < MAX_GANG_ZONES; g++)
  5864.     {
  5865.         if(IsPlayerInArea(playerid, GangZoneInfo[g][gMaxX], GangZoneInfo[g][gMinX], GangZoneInfo[g][gMaxY], GangZoneInfo[g][gMinY]))
  5866.         {
  5867.             if(GangZoneInfo[g][gAktywna] == 1)
  5868.             {
  5869.                 zone = g;
  5870.                 break;
  5871.             }
  5872.         }
  5873.     }
  5874.     return zone;
  5875. }
  5876.  
  5877. stock HidePlayerZone(playerid)
  5878. {
  5879.     for(new g = 1; g < MAX_GANG_ZONES; g++)
  5880.     {
  5881.         if(GangZoneInfo[g][gAktywna] == 1)
  5882.         {
  5883.             GangZoneHideForPlayer(playerid, GangZone[g]);
  5884.         }
  5885.     }
  5886.     return 1;
  5887. }
  5888.  
  5889. stock ShowPlayerZone(playerid)
  5890. {
  5891.     for(new g = 1; g < MAX_GANG_ZONES; g++)
  5892.     {
  5893.         if(GangZoneInfo[g][gAktywna] == 1)
  5894.         {
  5895.             if(GangZoneInfo[g][gOwner] == OWNER_GROUP && IPB[playerid][ipb_ZoneShow] == 1)
  5896.             {
  5897.                 GangZoneShowForPlayer(playerid, GangZone[g], Grupa[GangZoneInfo[g][gOwnerUID]][gKolorZone]);
  5898.             }
  5899.         }
  5900.     }
  5901.     return 1;
  5902. }
  5903.  
  5904. stock GetPlayerWeaponInData(playerID)
  5905. {
  5906.     new weapID = INVALID_WEAPON_DATA, weapons[13], ammo;
  5907.     for(new i = 0; i < 13; i++)
  5908.     {
  5909.         GetPlayerWeaponData(playerID, i, weapons[i], ammo);
  5910.         if(weapons[i] != 0)
  5911.         {
  5912.             weapID = weapons[i];
  5913.             continue;
  5914.         }
  5915.     }
  5916.     return weapID;
  5917. }
  5918.  
  5919. stock DoorObject(doorID)
  5920. {
  5921.     new object = 0;
  5922.     for(new o = 1; o < MAX_OBIEKT; o++)
  5923.     {
  5924.         if(Obiekt[o][oVir] == Drzwi[doorID][dWewVir])
  5925.         {
  5926.             object++;
  5927.         }
  5928.     }
  5929.     return object;
  5930. }
  5931.  
  5932. stock DoorInfo(playerid, doorID)
  5933. {
  5934.     new owner[16], ownerType[64], info[2048], vw[64];
  5935.     //Informacje o właścicielu
  5936.     if(Drzwi[doorID][dOwner] == OWNER_PLAYER)
  5937.     {
  5938.         owner = "Gracz";
  5939.         format(ownerType, 64, "Gracz (%d)", Drzwi[doorID][dOwnerUID]);
  5940.     }
  5941.     else if(Drzwi[doorID][dOwner] == OWNER_GROUP)
  5942.     {
  5943.         owner = "Grupa";
  5944.         format(ownerType, 64, "%s (%d)", Grupa[Drzwi[doorID][dOwnerUID]][gNazwa], Drzwi[doorID][dOwnerUID]);
  5945.     }
  5946.     else
  5947.     {
  5948.         ownerType = "Brak";
  5949.         owner = "Brak";
  5950.     }
  5951.     //Virtual World, Interior
  5952.     format(vw, 64, "VirtualWorld:\t\t%d\nInterior:\t\t%d", Drzwi[doorID][dWewVir], Drzwi[doorID][dIntWew]);
  5953.     //Formatowanie ogólne
  5954.     format(info, 2048, "Identyfikator:\t\t%d\nNazwa drzwi:\t\t%s\nTyp ownera:\t\t%s\nOwner:\t\t\t%s\n%s\nObiekty:\t\t%d (%d)", doorID, Drzwi[doorID][dNazwa], owner, ownerType, vw, DoorObject(doorID), Drzwi[doorID][dObiekty]);
  5955.     return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Drzwi", info, "Rozumiem", "");
  5956. }
  5957.  
  5958. stock KickWithMessage(playerid, color, message[])
  5959. {
  5960.     SendClientMessage(playerid, color, message);
  5961.     SetTimerEx("KickPublic", 1000, 0, "d", playerid);
  5962.     return 1;
  5963. }
  5964.  
  5965.  
  5966.  
  5967. forward KickPublic(playerid);
  5968. public KickPublic(playerid) return Kick(playerid);
  5969.  
  5970. stock WordWrap(givenString[128], spaces) // By Mario
  5971. {
  5972.     new editingString[128], spaceCounter = 0;
  5973.     memcpy(editingString, givenString, 0, 128 * 4);
  5974.  
  5975.     // Zrób pętlę na każdy bit
  5976.     for (new i = 0; editingString[i] != 0; i++)
  5977.     {
  5978.         // Sprawdź czy po przecinku lub kropce jest spacja - jeśli nie, dodaj ją
  5979.         if(editingString[i] == ',' || editingString[i] == '.')
  5980.         {
  5981.             if(editingString[i+1] != ' ') strins(editingString, " ", i + 1);
  5982.         }
  5983.  
  5984.         // Nalicz spacje
  5985.         if(editingString[i] == ' ' && editingString[i+1] != ' ') spaceCounter++;
  5986.  
  5987.         // Jeśli naliczył wskazaną ilość spacji, przenieś do następnej linijki
  5988.         if(spaceCounter >= spaces)
  5989.         {
  5990.             editingString[i] = '\n';
  5991.             spaceCounter = 0;
  5992.         }
  5993.     }
  5994.     return editingString;
  5995. }
  5996.  
  5997. stock floatval(Float:f)
  5998. {
  5999.    new str[20], str2[10];
  6000.    floatround(f);
  6001.    format(str, sizeof str, "%f", f);
  6002.    if(f >= 0 && f < 10) strmid(str2, str, 0, 1);
  6003.    else if(f >= 10 && f < 100) strmid(str2, str, 0, 2);
  6004.    else if(f >= 100 && f < 1000) strmid(str2, str, 0, 3);
  6005.    else if(f >= 1000 && f < 10000) strmid(str2, str, 0, 4);
  6006.    return strval(str2);
  6007. }
  6008.  
  6009. stock SetVehicleSpeed(vehicleid, Float:speed)
  6010. {
  6011.     new Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, Float:a;
  6012.     GetVehicleVelocity(vehicleid, x1, y1, z1);
  6013.     GetVehiclePos(vehicleid, x2, y2, z2);
  6014.     GetVehicleZAngle(vehicleid, a); a = 360 - a;
  6015.     x1 = (floatsin(a, degrees) * (speed/100) + floatcos(a, degrees) * 0 + x2) - x2;
  6016.     y1 = (floatcos(a, degrees) * (speed/100) + floatsin(a, degrees) * 0 + y2) - y2;
  6017.     SetVehicleVelocity(vehicleid, x1, y1, z1);
  6018. }
  6019.  
  6020. stock GetVehicleSpeed(vehicleid)
  6021. {
  6022.         new Float:vSpeed[3];
  6023.         GetVehicleVelocity( vehicleid, vSpeed[0], vSpeed[1], vSpeed[2] );
  6024.  
  6025.         new Float:vSpeed_Float;
  6026.         vSpeed_Float = floatsqroot( ((vSpeed[0] * vSpeed[0]) + (vSpeed[1] * vSpeed[1])) + (vSpeed[2] * vSpeed[2])) * 161;
  6027.  
  6028.         new vSpeed_Int;
  6029.         vSpeed_Int = floatround( vSpeed_Float, floatround_round);
  6030.  
  6031.         return vSpeed_Int;
  6032. }
  6033.  
  6034. stock hexstring(string[])
  6035. {
  6036.     new ret, val, i;
  6037.     if (string[0] == '0' && string[1] | 0x20 == 'x') i = 2;
  6038.     while (string[i])
  6039.     {
  6040.             ret <<= 4;
  6041.             val = string[i++] - '0';
  6042.             if (val > 0x09) val -= 0x07;
  6043.             if (val > 0x0F) val -= 0x20;
  6044.             if (val < 0x01) continue;
  6045.             if (val < 0x10) ret += val;
  6046.     }
  6047.     return ret;
  6048. }
  6049.  
  6050. stock GetPlayerFPS(playerid)
  6051. {
  6052.     SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
  6053.     if(GetPVarInt(playerid, "DrunkL") < 100) SetPlayerDrunkLevel(playerid, 2000);
  6054.         else{
  6055.             if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
  6056.             {
  6057.                 SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
  6058.                 SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
  6059.                 if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
  6060.                 {
  6061.                     return GetPVarInt(playerid, "FPS") - 1;
  6062.                 }
  6063.             }
  6064.         }
  6065.     return 0;
  6066. }
  6067.  
  6068. stock GetCharName(uid)
  6069. {
  6070.     new name[MAX_PLAYER_NAME+1], file[40];
  6071.     format(file, sizeof(file), "Gracze/%d.ini", uid);
  6072.     if(DOF2_FileExists(file))
  6073.     {
  6074.         name = DOF2_GetString(file, "Nick");
  6075.     }
  6076.     else
  6077.     {
  6078.         name = "---";
  6079.     }
  6080.     return name;
  6081. }
  6082.  
  6083. stock GetVehicleName(uid)
  6084. {
  6085.     new tmp = Pojazd[uid][vModel] - 400;
  6086.     return nazwypojazdow[tmp];
  6087. }
  6088.  
  6089.  
  6090. stock pDrzwi(playerid, drzwi)
  6091. {
  6092.     new typ = 0;
  6093.     if(Drzwi[drzwi][dOwner] == OWNER_PLAYER && Drzwi[drzwi][dOwnerUID] == Player[playerid][pUID])
  6094.     {
  6095.         typ = OWNER_PLAYER;
  6096.     }
  6097.     for(new g = 1; g < 6; g++)
  6098.     {
  6099.         if(Drzwi[drzwi][dOwner] == OWNER_GROUP && Drzwi[drzwi][dOwnerUID] == GroupSlot(playerid, pGrupa[playerid][g]))
  6100.         {
  6101.             typ = OWNER_GROUP;
  6102.         }
  6103.         printf("Drzwi: %d, Uprawnienia z grupy o UID %d (Slot: %d)", drzwi, pGrupa[playerid][g], g);
  6104.     }
  6105.     return typ;
  6106. }
  6107.  
  6108. stock pDrzwiOwner(playerid, drzwi)
  6109. {
  6110.     new typ = 0;
  6111.     if(Drzwi[drzwi][dOwner] == OWNER_PLAYER && Drzwi[drzwi][dOwnerUID] == Player[playerid][pUID])
  6112.     {
  6113.         return typ = OWNER_PLAYER;
  6114.     }
  6115.     for(new g = 1; g < 6; g++)
  6116.     {
  6117.         if(Drzwi[drzwi][dOwner] == OWNER_GROUP && Drzwi[drzwi][dOwnerUID] == GroupSlot(playerid, pGrupa[playerid][g]))
  6118.         {
  6119.             if((pGrupaPerm[playerid][g] & PERM_LEADER))
  6120.             {
  6121.                 printf("Drzwi: %d, Uprawnienia z grupy o UID %d (Slot: %d)", drzwi, pGrupa[playerid][g], g);
  6122.                 return typ = OWNER_GROUP;
  6123.             }
  6124.         }
  6125.     }
  6126.     return typ;
  6127. }
  6128.  
  6129. stock InDoor(playerid)
  6130. {
  6131.     new door = 0;
  6132.     for(new d = 0; d < MAX_DRZWI; d++)
  6133.     {
  6134.         if(Drzwi[d][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]) && Drzwi[d][dWewVir] == GetPlayerVirtualWorld(playerid))
  6135.         {
  6136.             door = d;
  6137.         }
  6138.     }
  6139.     return door;
  6140. }
  6141.  
  6142. stock pPojazd(playerid, vehicleid)
  6143. {
  6144.     new drive = 0;
  6145.     if(Pojazd[CarUID(vehicleid)][vOwner] == 1 && Pojazd[CarUID(vehicleid)][vOwnerUID] == Player[playerid][pUID])
  6146.     {
  6147.         drive = 1;
  6148.     }
  6149.     if(Pojazd[CarUID(vehicleid)][vOwner] == 2 && ((pGrupaPerm[playerid][GroupSlot(playerid, Pojazd[CarUID(vehicleid)][vOwnerUID])] & PERM_OFFER)))
  6150.     {
  6151.         drive = 2;
  6152.     }
  6153.     if(pItem(playerid, 20, CarUID(vehicleid), 0) != 0)
  6154.     {
  6155.         drive = 3;
  6156.     }
  6157.     return drive;
  6158. }
  6159.  
  6160. stock pAdminPerm(playerid)
  6161. {
  6162.     new permision = 0;
  6163.     if(GetPVarInt(playerid, "Grupa") == 4)
  6164.     {
  6165.         permision = 4;
  6166.     }
  6167.     else if(GetPVarInt(playerid, "Grupa") == 7)
  6168.     {
  6169.         permision = 7;
  6170.     }
  6171.     return permision;
  6172. }
  6173.  
  6174. stock pItem(playerid, typ, wartosc1, wartosc2)
  6175. {
  6176.     new item = 0;
  6177.     for(new p = 1; p < MAX_ITEM; p++)
  6178.     {
  6179.         if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
  6180.         {
  6181.             if(Przedmiot[p][iTyp] == typ)
  6182.             {
  6183.                 if(Przedmiot[p][iWartosc1] == wartosc1 && Przedmiot[p][iWartosc2] == wartosc2)
  6184.                 {
  6185.                     item = p;
  6186.                 }
  6187.             }
  6188.         }
  6189.     }
  6190.     return item;
  6191. }
  6192.  
  6193. stock GrupaInfo(playerid, grupa)
  6194. {
  6195.     new info[128], big_str[1024], aktywnosc[64], podgrupa[128];
  6196.     if(Grupa[grupa][gPunkty] >= 1000)
  6197.     format(aktywnosc, sizeof(aktywnosc), "{00B000}%d{FFFFFF} pkt.", Grupa[grupa][gPunkty]);
  6198.     else
  6199.     format(aktywnosc, sizeof(aktywnosc), "{FF8000}%d{FFFFFF} pkt.", Grupa[grupa][gPunkty]);
  6200.     if(Grupa[grupa][gOwner] != 0)
  6201.     {
  6202.         format(podgrupa, sizeof(podgrupa), "Grupa nadrzędna:\t%s (%d)", Grupa[Grupa[grupa][gOwner]][gNazwa], Grupa[grupa][gOwner]);
  6203.     }
  6204.     format(info, sizeof(info), ""ServName"%s (UID: %d)", Grupa[grupa][gNazwa], grupa);
  6205.     format(big_str, sizeof(big_str), "Typ grupy:\t\t%s\nNazwa grupy:\t\t%s\nTag:\t\t\t%s\nBudżet:\t\t\t$%d\nEuro:\t\t\t€%d\nAktwyność:\t\t%s\nDotacja rządowa:\t$%d\nLimit pojazdów:\t\t%d\n%s", GrupaTyp(grupa), Grupa[grupa][gNazwa], Grupa[grupa][gTag], Grupa[grupa][gBank], Grupa[grupa][gWirCash], aktywnosc, Grupa[grupa][gPayDay], Grupa[grupa][gVehLimit], podgrupa);
  6206.     return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, info, big_str, "Wybierz", "");
  6207. }
  6208.  
  6209. stock PaliwoMax(model)
  6210. {
  6211.     new paliwo = 0;
  6212.     switch(model)
  6213.     {
  6214.         case 400: paliwo = 60;
  6215.         case 401: paliwo = 40;
  6216.         case 402: paliwo = 55;
  6217.         case 403: paliwo = 200;
  6218.         case 404: paliwo = 30;
  6219.         case 405: paliwo = 50;
  6220.         case 406: paliwo = 95;
  6221.         case 407: paliwo = 120;
  6222.         case 408: paliwo = 95;
  6223.         case 409: paliwo = 75;
  6224.         case 410: paliwo = 30;
  6225.         case 411: paliwo = 55;
  6226.         case 412: paliwo = 40;
  6227.         case 413: paliwo = 45;
  6228.         case 414: paliwo = 45;
  6229.         case 415: paliwo = 65;
  6230.         case 416: paliwo = 95;
  6231.         case 417: paliwo = 150;
  6232.         case 418: paliwo = 45;
  6233.         case 419: paliwo = 45;
  6234.         case 420: paliwo = 55;
  6235.         case 421: paliwo = 55;
  6236.         case 422: paliwo = 35;
  6237.         case 423: paliwo = 40;
  6238.         case 424: paliwo = 30;
  6239.         case 425: paliwo = 150;
  6240.         case 426: paliwo = 60;
  6241.         case 427: paliwo = 90;
  6242.         case 428: paliwo = 90;
  6243.         case 429: paliwo = 55;
  6244.         case 430: paliwo = 100;
  6245.         case 431: paliwo = 200;
  6246.         case 432: paliwo = 200;
  6247.         case 433: paliwo = 100;
  6248.         case 434: paliwo = 55;
  6249.         case 435: paliwo = -1;
  6250.         case 436: paliwo = 30;
  6251.         case 437: paliwo = 140;
  6252.         case 438: paliwo = 60;
  6253.         case 439: paliwo = 50;
  6254.         case 440: paliwo = 75;
  6255.         case 441: paliwo = -1;
  6256.         case 442: paliwo = 35;
  6257.         case 443: paliwo = 75;
  6258.         case 444: paliwo = 25;
  6259.         case 445: paliwo = 35;
  6260.         case 446: paliwo = 45;
  6261.         case 447: paliwo = 95;
  6262.         case 448: paliwo = 10;
  6263.         case 449: paliwo = -1;
  6264.         case 450: paliwo = -1;
  6265.         case 451: paliwo = 50;
  6266.         case 452: paliwo = 65;
  6267.         case 453: paliwo = 45;
  6268.         case 454: paliwo = 45;
  6269.         case 455: paliwo = 75;
  6270.         case 456: paliwo = 80;
  6271.         case 457: paliwo = 15;
  6272.         case 458: paliwo = 50;
  6273.         case 459: paliwo = 50;
  6274.         case 460: paliwo = 65;
  6275.         case 461: paliwo = 30;
  6276.         case 462: paliwo = 10;
  6277.         case 463: paliwo = 30;
  6278.         case 464: paliwo = -1;
  6279.         case 465: paliwo = -1;
  6280.         case 466: paliwo = 40;
  6281.         case 467: paliwo = 40;
  6282.         case 468: paliwo = 30;
  6283.         case 469: paliwo = 100;
  6284.         case 470: paliwo = 110;
  6285.         case 471: paliwo = 35;
  6286.         case 472: paliwo = 50;
  6287.         case 473: paliwo = 25;
  6288.         case 474: paliwo = 35;
  6289.         case 475: paliwo = 54;
  6290.         case 476: paliwo = 110;
  6291.         case 477: paliwo = 50;
  6292.         case 478: paliwo = 30;
  6293.         case 479: paliwo = 35;
  6294.         case 480: paliwo = 55;
  6295.         case 481: paliwo = -1;
  6296.         case 482: paliwo = 75;
  6297.         case 483: paliwo = 60;
  6298.         case 484: paliwo = 95;
  6299.         case 485: paliwo = 15;
  6300.         case 486: paliwo = 65;
  6301.         case 487: paliwo = 120;
  6302.         case 488: paliwo = 100;
  6303.         case 489: paliwo = 65;
  6304.         case 490: paliwo = 65;
  6305.         case 491: paliwo = 55;
  6306.         case 492: paliwo = 60;
  6307.         case 493: paliwo = 70;
  6308.         case 494: paliwo = 50;
  6309.         case 495: paliwo = 65;
  6310.         case 496: paliwo = 50;
  6311.         case 497: paliwo = 125;
  6312.         case 498: paliwo = 25;
  6313.         case 499: paliwo = 55;
  6314.         case 500: paliwo = 45;
  6315.         case 501: paliwo = -1;
  6316.         case 502: paliwo = 55;
  6317.         case 503: paliwo = 55;
  6318.         case 504: paliwo = 55;
  6319.         case 505: paliwo = 65;
  6320.         case 506: paliwo = 50;
  6321.         case 507: paliwo = 65;
  6322.         case 508: paliwo = 65;
  6323.         case 509: paliwo = -1;
  6324.         case 510: paliwo = -1;
  6325.         case 511: paliwo = 100;
  6326.         case 512: paliwo = 100;
  6327.         case 513: paliwo = 100;
  6328.         case 514: paliwo = 125;
  6329.         case 515: paliwo = 135;
  6330.         case 516: paliwo = 35;
  6331.         case 517: paliwo = 45;
  6332.         case 518: paliwo = 50;
  6333.         case 519: paliwo = 250;
  6334.         case 520: paliwo = 200;
  6335.         case 521: paliwo = 35;
  6336.         case 522: paliwo = 35;
  6337.         case 523: paliwo = 35;
  6338.         case 524: paliwo = 65;
  6339.         case 525: paliwo = 60;
  6340.         case 526: paliwo = 45;
  6341.         case 527: paliwo = 45;
  6342.         case 528: paliwo = 55;
  6343.         case 529: paliwo = 40;
  6344.         case 530: paliwo = 15;
  6345.         case 531: paliwo = 30;
  6346.         case 532: paliwo = 75;
  6347.         case 533: paliwo = 60;
  6348.         case 534: paliwo = 55;
  6349.         case 535: paliwo = 50;
  6350.         case 536: paliwo = 45;
  6351.         case 537: paliwo = -1;
  6352.         case 538: paliwo = -1;
  6353.         case 539: paliwo = 25;
  6354.         case 540: paliwo = 45;
  6355.         case 541: paliwo = 65;
  6356.         case 542: paliwo = 35;
  6357.         case 543: paliwo = 30;
  6358.         case 544: paliwo = 95;
  6359.         case 545: paliwo = 40;
  6360.         case 546: paliwo = 45;
  6361.         case 547: paliwo = 55;
  6362.         case 548: paliwo = 200;
  6363.         case 549: paliwo = 35;
  6364.         case 550: paliwo = 48;
  6365.         case 551: paliwo = 60;
  6366.         case 552: paliwo = 55;
  6367.         case 553: paliwo = 120;
  6368.         case 554: paliwo = 45;
  6369.         case 555: paliwo = 45;
  6370.         case 556: paliwo = 25;
  6371.         case 557: paliwo = 25;
  6372.         case 558: paliwo = 60;
  6373.         case 559: paliwo = 55;
  6374.         case 560: paliwo = 75;
  6375.         case 561: paliwo = 55;
  6376.         case 562: paliwo = 55;
  6377.         case 563: paliwo = 125;
  6378.         case 564: paliwo = -1;
  6379.         case 565: paliwo = 45;
  6380.         case 566: paliwo = 55;
  6381.         case 567: paliwo = 55;
  6382.         case 568: paliwo = 30;
  6383.         case 569: paliwo = -1;
  6384.         case 570: paliwo = -1;
  6385.         case 571: paliwo = 15;
  6386.         case 572: paliwo = 15;
  6387.         case 573: paliwo = 65;
  6388.         case 574: paliwo = 25;
  6389.         case 575: paliwo = 55;
  6390.         case 576: paliwo = 50;
  6391.         case 577: paliwo = 250;
  6392.         case 578: paliwo = 80;
  6393.         case 579: paliwo = 80;
  6394.         case 580: paliwo = 65;
  6395.         case 581: paliwo = 35;
  6396.         case 582: paliwo = 45;
  6397.         case 583: paliwo = 15;
  6398.         case 584: paliwo = -1;
  6399.         case 585: paliwo = 45;
  6400.         case 586: paliwo = 35;
  6401.         case 587: paliwo = 50;
  6402.         case 588: paliwo = 45;
  6403.         case 589: paliwo = 50;
  6404.         case 590: paliwo = -1;
  6405.         case 591: paliwo = -1;
  6406.         case 592: paliwo = 250;
  6407.         case 593: paliwo = 75;
  6408.         case 594: paliwo = -1;
  6409.         case 595: paliwo = 55;
  6410.         case 596: paliwo = 60;
  6411.         case 597: paliwo = 60;
  6412.         case 598: paliwo = 50;
  6413.         case 599: paliwo = 55;
  6414.         case 600: paliwo = 35;
  6415.         case 601: paliwo = 75;
  6416.         case 602: paliwo = 55;
  6417.         case 603: paliwo = 50;
  6418.         case 604: paliwo = 25;
  6419.         case 605: paliwo = 20;
  6420.         case 606: paliwo = -1;
  6421.         case 607: paliwo = -1;
  6422.         case 608: paliwo = -1;
  6423.         case 609: paliwo = 35;
  6424.         case 610: paliwo = -1;
  6425.         case 611: paliwo = -1;
  6426.     }
  6427.     return paliwo;
  6428. }
  6429.  
  6430. stock VehInfo(playerid, vehicleid)
  6431. {
  6432.     new veh = CarUID(vehicleid), paliwo[32], info[128], big_str[1024], owner[16];
  6433.     if(Pojazd[veh][vPaliwoTyp] == 1)
  6434.     {
  6435.         paliwo = "Benzyna";
  6436.     }
  6437.     else if(Pojazd[veh][vPaliwoTyp] == 2)
  6438.     {
  6439.         paliwo = "Diesel";
  6440.     }
  6441.     else if(Pojazd[veh][vPaliwoTyp] == 3)
  6442.     {
  6443.         paliwo = "Gas";
  6444.     }
  6445.     else
  6446.     {
  6447.         paliwo = "-";
  6448.     }
  6449.     if(Pojazd[veh][vOwner] == 1)
  6450.         owner = "Gracz";
  6451.         else
  6452.         owner = "Grupa";
  6453.     format(big_str, sizeof(big_str), "Model:\t\t\t%d\nKolory:\t\t\t%d:%d\nRodzaj paliwa:\t\t%s\nPaliwo:\t\t\t%.1fl\nStan techniczny:\t%.2f HP\nPrzebieg:\t\t%.2f km\nTyp ownera:\t\t%s\nUID ownera:\t\t%d\n\nParking:\n\t\tX: %.04f\tY: %.04f\tZ: %.04f", Pojazd[veh][vModel], Pojazd[veh][vKolor1], Pojazd[veh][vKolor2], paliwo, Pojazd[veh][vPaliwo], Pojazd[veh][vHP], Pojazd[veh][vPrzebieg], owner, Pojazd[veh][vOwnerUID], Pojazd[veh][vPosX], Pojazd[veh][vPosY], Pojazd[veh][vPosZ]);
  6454.     format(info, sizeof(info), ""ServName"%s (UID: %d, sampID: %d)", GetVehicleName(veh), veh, vehicleid);
  6455.     return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, info, big_str, "Wybierz", "");
  6456. }
  6457.  
  6458.  
  6459. stock GrupaTyp(grupa)
  6460. {
  6461.     new tmp = Grupa[grupa][gTyp];
  6462.     return TypGrupy[tmp];
  6463. }
  6464.  
  6465. stock GrupaGracz(playerid, grupa)
  6466. {
  6467.     new grupainvite = 0;
  6468.     if(pGrupa[playerid][1] == grupa)
  6469.     {
  6470.         grupainvite = 1;
  6471.     }
  6472.     if(pGrupa[playerid][2] == grupa)
  6473.     {
  6474.         grupainvite = 2;
  6475.     }
  6476.     if(pGrupa[playerid][3] == grupa)
  6477.     {
  6478.         grupainvite = 3;
  6479.     }
  6480.     if(pGrupa[playerid][4] == grupa)
  6481.     {
  6482.         grupainvite = 4;
  6483.     }
  6484.     if(pGrupa[playerid][5] == grupa)
  6485.     {
  6486.         grupainvite = 5;
  6487.     }
  6488.     return grupainvite;
  6489. }
  6490.  
  6491. stock GrupaGraczSlot(playerid, slot, grupa)
  6492. {
  6493.     new grupainvite = 0;
  6494.     if(pGrupa[playerid][1] == grupa && slot != 1)
  6495.     {
  6496.         grupainvite = 1;
  6497.     }
  6498.     if(pGrupa[playerid][2] == grupa && slot != 2)
  6499.     {
  6500.         grupainvite = 2;
  6501.     }
  6502.     if(pGrupa[playerid][3] == grupa && slot != 3)
  6503.     {
  6504.         grupainvite = 3;
  6505.     }
  6506.     if(pGrupa[playerid][4] == grupa && slot != 4)
  6507.     {
  6508.         grupainvite = 4;
  6509.     }
  6510.     if(pGrupa[playerid][5] == grupa && slot != 5)
  6511.     {
  6512.         grupainvite = 5;
  6513.     }
  6514.     return grupainvite;
  6515. }
  6516.  
  6517.  
  6518. stock GrupaSlot(playerid, grupa)
  6519. {
  6520.     new Slot = 0;
  6521.     if(pGrupa[playerid][1] == grupa)
  6522.     {
  6523.         Slot = 1;
  6524.     }
  6525.     if(pGrupa[playerid][2] == grupa)
  6526.     {
  6527.         Slot = 2;
  6528.     }
  6529.     if(pGrupa[playerid][3] == grupa)
  6530.     {
  6531.         Slot = 3;
  6532.     }
  6533.     if(pGrupa[playerid][4] == grupa)
  6534.     {
  6535.         Slot = 4;
  6536.     }
  6537.     if(pGrupa[playerid][5] == grupa)
  6538.     {
  6539.         Slot = 5;
  6540.     }
  6541.     return Slot;
  6542. }
  6543.  
  6544. stock SendGroupMessage(typ, playerid, group, text[])
  6545. {
  6546.     foreach(Player, i)
  6547.     {
  6548.         if(pGrupa[i][1] == group || pGrupa[i][2] == group || pGrupa[i][3] == group || pGrupa[i][4] == group || pGrupa[i][5] == group)
  6549.         {
  6550.             if(typ == 0)
  6551.             {
  6552.                 format(String, sizeof(String), "@%d %s (( [%d] %s: %s ))", GrupaSlot(playerid, group), Grupa[group][gTag], playerid, CharName(playerid), text);
  6553.                 SendClientMessage(i, Grupa[group][gKolor], String);
  6554.             }
  6555.             else if(typ == 1)
  6556.             {
  6557.                 format(String, sizeof(String), "!%d ** %s: %s **", GrupaSlot(playerid, group), CharName(playerid), text);
  6558.                 SendClientMessage(i, Grupa[group][gKolor], String);
  6559.             }
  6560.             else
  6561.             {
  6562.                 SendClientMessage(i, Grupa[group][gKolor], String);
  6563.             }
  6564.         }
  6565.     }
  6566.     return 1;
  6567. }
  6568.  
  6569. stock giveHP(playerid, Float:HP)
  6570. {
  6571.     dHP[playerid]+=HP;
  6572.     if(dHP[playerid]>100) dHP[playerid]=100;
  6573.     SetPlayerHealth(playerid,dHP[playerid]);
  6574.     return 1;
  6575. }
  6576.  
  6577. stock setHP(playerid, Float:HP)
  6578. {
  6579.     dHP[playerid]=HP;
  6580.     if(dHP[playerid]>100) dHP[playerid]=100;
  6581.     SetPlayerHealth(playerid,HP);
  6582.     return 1;
  6583. }
  6584.  
  6585. stock Float:getHP(playerid)
  6586. {
  6587.     return dHP[playerid];
  6588. }
  6589.  
  6590. stock dKasa(playerid)
  6591.     return Player[playerid][pKasa];
  6592.  
  6593.  
  6594. stock sKasa(playerid, kasa)
  6595.     return Player[playerid][pKasa] += kasa;
  6596.  
  6597. stock gKasa(grupa, kasa)
  6598. {
  6599.     //tulog
  6600.     return Grupa[grupa][gBank] += kasa, ZapiszGrupe(grupa);
  6601. }
  6602.  
  6603. stock AddPoints(grupa, kwota)
  6604. {
  6605.     Grupa[grupa][gPunkty] += kwota/10;
  6606.     return ZapiszGrupe(grupa);
  6607. }
  6608.  
  6609. stock cName(playerid)
  6610. {
  6611.     new nick[64];
  6612.     format(nick, sizeof(nick), "%s (UID: %d, GID: %d)", Nick(playerid), Player[playerid][pUID], Player[playerid][pGID]);
  6613.     return nick;
  6614. }
  6615.  
  6616.  
  6617. stock CharName3DText(playerid)
  6618. {
  6619.     new zwrot[256], statusy[128], bw[16], rekawiczki[16], afk[64], afk0[32], afk1[3], org[16], discman[16], sila[16], pasy[8];
  6620.     if(Player[playerid][pBW] != 0)
  6621.     {
  6622.         if(Player[playerid][pSex] == CHAR_SEX_MALE)
  6623.         bw = ", nieprzytomny";
  6624.         else
  6625.         bw = ", nieprzytomna";
  6626.     }
  6627.     if(GetPVarInt(playerid, "rpPasy") == 1)
  6628.     {
  6629.         pasy = ", pasy";
  6630.     }
  6631.     if(ItemUsed(playerid, 7) != 0)
  6632.         rekawiczki = ", rękawice";
  6633.  
  6634.     if(ItemUsed(playerid, 23) != 0)
  6635.         discman = ", słucha muzyki";
  6636.  
  6637.     if(Sluzba(playerid) != 0 && (Grupa[Sluzba(playerid)][gFlagPerm] & G_FLAG_DEPARTMENT))
  6638.         format(org, sizeof(org), ", %s", Grupa[Sluzba(playerid)][gTag]);
  6639.     if(Player[playerid][pSila] > 5000)
  6640.     {
  6641.         if(Player[playerid][pSex] == CHAR_SEX_MALE)
  6642.         format(sila, sizeof(sila), "wysportowany");
  6643.         else
  6644.         format(sila, sizeof(sila), "wysportowana");
  6645.     }
  6646.     else
  6647.     {
  6648.         format(sila, sizeof(sila), "%dj", Player[playerid][pSila]);
  6649.     }
  6650.     if(GetPVarInt(playerid, "AFK") > 5)
  6651.     {
  6652.         format(afk0, sizeof(afk0), ", AFK od ");
  6653.         format(afk, sizeof(afk), "%s%s", afk, afk0);
  6654.         FullTime(GetPVarInt(playerid, "AFK"), afk1[0], afk1[1], afk1[2]);
  6655.         if(afk1[0] != 0){
  6656.             format(afk0, sizeof(afk0), "%02dh. ", afk1[0]);
  6657.             format(afk, sizeof(afk), "%s%s", afk, afk0);
  6658.         }
  6659.         if(afk1[1] != 0){
  6660.             format(afk0, sizeof(afk0), "%02dm. ", afk1[1]);
  6661.             format(afk, sizeof(afk), "%s%s", afk, afk0);
  6662.         }
  6663.         if(afk1[2] != 0){
  6664.             format(afk0, sizeof(afk0), "%02ds.", afk1[2]);
  6665.             format(afk, sizeof(afk), "%s%s", afk, afk0);
  6666.         }
  6667.     }
  6668.     else
  6669.     {
  6670.         afk = "";
  6671.     }
  6672.     if(Status(playerid) == 0)
  6673.     {
  6674.         format(statusy, sizeof(statusy), "%s%s%s%s%s%s%s%s", sila, org, bw, rekawiczki, discman, pasy, afk);
  6675.         format(zwrot, sizeof(zwrot), "%s (%d)\n(%s%s%s)", CharName(playerid), playerid, statusy);
  6676.     }
  6677.     else if(Status(playerid) == 1)
  6678.     {
  6679.         format(statusy, sizeof(statusy), "%s%s%s%s%s", bw, rekawiczki, discman, pasy, afk);
  6680.         format(zwrot, sizeof(zwrot), "%s (%d)\n(ukryta twarz%s)", CharName(playerid), playerid, statusy);
  6681.     }
  6682.     else if(Status(playerid) == 2)
  6683.     {
  6684.         format(zwrot, sizeof(zwrot), "%s (%d)", CharName(playerid), playerid);
  6685.     }
  6686.     return zwrot;
  6687. }
  6688.  
  6689. stock NickSAMP(playerid)
  6690. {
  6691.     new nick[MAX_PLAYER_NAME];
  6692.     GetPlayerName(playerid, nick, sizeof(nick));
  6693.     return nick;
  6694. }
  6695.  
  6696. stock FullTime(sekundy,&godziny,&minuty,&sek)
  6697. {
  6698.     if(sekundy<60)
  6699.     {
  6700.         sek = sekundy;
  6701.         return 1;
  6702.     }
  6703.     if(!sekundy) return 1;
  6704.     while(sekundy>=3600)
  6705.     {
  6706.         godziny += 1;
  6707.         sekundy -= 3600;
  6708.     }
  6709.     if(!sekundy) return 1;
  6710.     while(sekundy >= 60)
  6711.     {
  6712.         minuty += 1;
  6713.         sekundy -= 60;
  6714.     }
  6715.     sek = sekundy;
  6716.     return 1;
  6717. }
  6718.  
  6719. stock TimeFormat(sekundy, &dni = 0, &godziny = 0, &minuty = 0, &sek = 0)
  6720. {
  6721.     godziny = sekundy / 3600;
  6722.     sekundy -= godziny * 3600;
  6723.     minuty = sekundy / 60;
  6724.     sekundy -= minuty * 60;
  6725.     sek = sekundy;
  6726.     return 1;
  6727. }
  6728.  
  6729. stock Nick(playerid)
  6730. {
  6731.     new nick[MAX_PLAYER_NAME];
  6732.     GetPlayerName(playerid, nick, sizeof(nick));
  6733.     UnderscoreToSpace(nick);
  6734.     return nick;
  6735. }
  6736.  
  6737. stock WeapName(weapID)
  6738. {
  6739.     new weapName[64];
  6740.     GetWeaponName(weapID, weapName, sizeof(weapName));
  6741.     if(IsNull(weapName))
  6742.         weapName = "-";
  6743.     return weapName;
  6744. }
  6745.  
  6746. stock UnderscoreToSpace(name[])
  6747. {
  6748.     new pos = strfind(name,"_", true);
  6749.     if( pos != -1 )
  6750.     name[pos] = ' ';
  6751. }
  6752.  
  6753. Banned(playerid, time, uid)
  6754. {
  6755.     new query[256];
  6756.     format(query, sizeof(query), "UPDATE `members` SET `ban_time`=%d, `ban_uid`=%d WHERE `member_id`=%d", time, uid, Player[playerid][pGID]);
  6757.     mysql_query_ex(query);
  6758.     return Ban(playerid);
  6759. }
  6760.  
  6761. stock GetWeaponModel(weaponid)
  6762. {
  6763.     switch(weaponid)
  6764.     {
  6765.         case 1:
  6766.             return 331;
  6767.  
  6768.         case 2..8:
  6769.             return weaponid+331;
  6770.  
  6771.         case 9:
  6772.             return 341;
  6773.  
  6774.         case 10..15:
  6775.             return weaponid+311;
  6776.  
  6777.         case 16..18:
  6778.             return weaponid+326;
  6779.  
  6780.         case 22..29:
  6781.             return weaponid+324;
  6782.  
  6783.         case 30,31:
  6784.             return weaponid+325;
  6785.  
  6786.         case 32:
  6787.             return 372;
  6788.  
  6789.         case 33..45:
  6790.             return weaponid+324;
  6791.  
  6792.         case 46:
  6793.             return 371;
  6794.     }
  6795.     return 0;
  6796. }
  6797.  
  6798. stock ItemRotX(item)
  6799. {
  6800.     switch(Przedmiot[item][iTyp])
  6801.     {
  6802.         case 1:     return 90;
  6803.         case 2:     return 0;
  6804.         case 5:     return 90;
  6805.         case 17:    return 0;
  6806.     }
  6807.     return 0;
  6808. }
  6809.  
  6810. stock GetItemModel(item)
  6811. {
  6812.     if(Przedmiot[item][iTyp] == 1)
  6813.     {
  6814.         switch(Przedmiot[item][iWartosc1])
  6815.         {
  6816.             case 1:
  6817.                 return 331;
  6818.  
  6819.             case 2..8:
  6820.                 return Przedmiot[item][iWartosc1]+331;
  6821.  
  6822.             case 9:
  6823.                 return 341;
  6824.  
  6825.             case 10..15:
  6826.                 return Przedmiot[item][iWartosc1]+311;
  6827.  
  6828.             case 16..18:
  6829.                 return Przedmiot[item][iWartosc1]+326;
  6830.  
  6831.             case 22..29:
  6832.                 return Przedmiot[item][iWartosc1]+324;
  6833.  
  6834.             case 30,31:
  6835.                 return Przedmiot[item][iWartosc1]+325;
  6836.  
  6837.             case 32:
  6838.                 return 372;
  6839.  
  6840.             case 33..45:
  6841.                 return Przedmiot[item][iWartosc1]+324;
  6842.  
  6843.             case 46:
  6844.                 return 371;
  6845.         }
  6846.     }
  6847.     else if(Przedmiot[item][iTyp] == 2)
  6848.         return 2843;
  6849.     else if(Przedmiot[item][iTyp] == 5)
  6850.         return Przedmiot[item][iWartosc1];
  6851.     else if(Przedmiot[item][iTyp] == 15)
  6852.         return 2358;
  6853.     else if(Przedmiot[item][iTyp] == 17)
  6854.         return 2060;
  6855.     return 0;
  6856. }
  6857.  
  6858. stock ItemWaga(playerid)
  6859. {
  6860.     new waga;
  6861.     for(new nr = 0; nr < MAX_ITEM; nr++)
  6862.     {
  6863.         if(Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID] && Przedmiot[nr][iAktywny] == 1)
  6864.         {
  6865.             waga += Przedmiot[nr][iWaga];
  6866.             if(Przedmiot[nr][iTyp] == 1)
  6867.             {
  6868.                 if(Przedmiot[nr][iWartosc2] != 0)
  6869.                 {
  6870.                     waga += Przedmiot[nr][iWartosc2]*8;
  6871.                 }
  6872.             }
  6873.         }
  6874.     }
  6875.     return waga;
  6876. }
  6877.  
  6878. stock ItemUdzwig(playerid)
  6879. {
  6880.     new udzwig = 0;
  6881.     udzwig = Player[playerid][pSila]*3;
  6882.     if(ItemList(playerid, 16) != 0)
  6883.     {
  6884.         udzwig += Przedmiot[ItemList(playerid, 16)][iWartosc1];
  6885.     }
  6886.     return udzwig;
  6887. }
  6888.  
  6889.  
  6890. stock ItemUsed(playerid, typ)
  6891. {
  6892.     new used = 0;
  6893.     for(new nr = 0; nr < MAX_ITEM; nr++)
  6894.     {
  6895.         if(Przedmiot[nr][iAktywny] == 1 && Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
  6896.         {
  6897.             if(Przedmiot[nr][iTyp] == typ && Przedmiot[nr][iUsed] == 1)
  6898.             {
  6899.                 used = nr;
  6900.                 break;
  6901.             }
  6902.         }
  6903.     }
  6904.     return used;
  6905. }
  6906.  
  6907. stock ItemList(playerid, typ)
  6908. {
  6909.     new used = 0;
  6910.     for(new nr = 0; nr < MAX_ITEM; nr++)
  6911.     {
  6912.         if(Przedmiot[nr][iAktywny] == 1 && Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
  6913.         {
  6914.             if(Przedmiot[nr][iTyp] == typ)
  6915.             {
  6916.                 used = nr;
  6917.                 break;
  6918.             }
  6919.         }
  6920.     }
  6921.     return used;
  6922. }
  6923.  
  6924. stock PokazTekst(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
  6925. {
  6926.     #define MAX_LINE 128
  6927.     new len = strlen(string), tmp[ MAX_LINE + 5 ];
  6928.     if(len >= MAX_LINE)
  6929.     {
  6930.         new text1[ MAX_LINE + 1 ], text2[ MAX_LINE + 1 ], space = strfind(string, " ", .pos = MAX_LINE-10);
  6931.         if(space == -1) space = MAX_LINE;
  6932.         strmid(text1, string, 0, space); strmid(text2, string, space, len);
  6933.         if(space != -1) strdel(text2, 0, 1);
  6934.         format(tmp, sizeof tmp, "%s...", text1); ProxDetector(radi, playerid, tmp, col1, col2, col3, col4, col5);
  6935.         format(tmp, sizeof tmp, "...%s", text2); ProxDetector(radi, playerid, tmp, col1, col2, col3, col4, col5);
  6936.     }
  6937.     else ProxDetector(radi, playerid, string, col1, col2, col3, col4, col5);
  6938.     return 1;
  6939. }
  6940.  
  6941. ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  6942. {
  6943.     if(IsPlayerConnected(playerid)){
  6944.         new Float:posx, Float:posy, Float:posz;
  6945.         new Float:oldposx, Float:oldposy, Float:oldposz;
  6946.         new Float:tempposx, Float:tempposy, Float:tempposz;
  6947.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  6948.         new vir=GetPlayerVirtualWorld(playerid);
  6949.         foreach(Player, i){
  6950.             if(IsPlayerConnected(i)&&GetPlayerVirtualWorld(i)==vir){
  6951.                     GetPlayerPos(i, posx, posy, posz);
  6952.                     tempposx = (oldposx -posx);
  6953.                     tempposy = (oldposy -posy);
  6954.                     tempposz = (oldposz -posz);
  6955.                     if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))){
  6956.                         SendClientMessage(i, col1, string);
  6957.                     }
  6958.                     else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))){
  6959.                         SendClientMessage(i, col2, string);
  6960.                     }
  6961.                     else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))){
  6962.                         SendClientMessage(i, col3, string);
  6963.                     }
  6964.                     else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))){
  6965.                         SendClientMessage(i, col4, string);
  6966.                     }
  6967.                     else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))){
  6968.                         SendClientMessage(i, col5, string);
  6969.                     }
  6970.             }
  6971.         }
  6972.     }
  6973.     return 1;
  6974. }
  6975.  
  6976. PrzedmiotTyp(item)
  6977. {
  6978.     new i = Przedmiot[item][iTyp];
  6979.     new tmp = i;
  6980.     return ItemTyp[tmp-1];
  6981. }
  6982.  
  6983.  
  6984.  
  6985. CharName(playerid)
  6986. {
  6987.     new zwrot[32];
  6988.     if(Status(playerid) == 0)
  6989.     {
  6990.         format(zwrot, sizeof(zwrot), "%s", Nick(playerid));
  6991.     }
  6992.     else if(Status(playerid) == 1)
  6993.     {
  6994.         format(zwrot, sizeof(zwrot), "Nieznajomy %x", Player[playerid][pUID]+979797);
  6995.     }
  6996.     else if(Status(playerid) == 2)
  6997.     {
  6998.         format(zwrot, sizeof(zwrot), "%s", Player[playerid][pName]);
  6999.     }
  7000.     return zwrot;
  7001. }
  7002.  
  7003. PlayerLog(playerid,log[])
  7004. {
  7005.     new File:plik,h,m,s;
  7006.     gettime(h,m,s);
  7007.     format(LogData, sizeof(LogData), "Logi/Gracze/%s.log", NickSAMP(playerid));
  7008.     if(DOF2_FileExists(LogData))
  7009.     {
  7010.         plik = fopen(LogData, io_append);
  7011.         if (plik)
  7012.         {
  7013.             format(LogStr, sizeof(LogStr), "\n[%02d:%02d:%02d] %s",h,m,s,log);
  7014.             fwrite(plik, LogStr);
  7015.             fclose(plik);
  7016.         }
  7017.     }
  7018.     else
  7019.     {
  7020.         DOF2_CreateFile(LogData);
  7021.         plik = fopen(LogData, io_append);
  7022.         if (plik)
  7023.         {
  7024.             format(LogStr, sizeof(LogStr), "[%02d:%02d:%02d] %s",h,m,s,log);
  7025.             fwrite(plik, LogStr);
  7026.             fclose(plik);
  7027.         }
  7028.     }
  7029.     return 1;
  7030. }
  7031.  
  7032. Funkcja::InfoBoxShow(typ,playerid,string[],sek)
  7033. {
  7034.     new czas = sek*1000;
  7035.     TextDrawHideForPlayer(playerid, Doors[playerid]);
  7036.     TextDrawHideForPlayer(playerid, Informacja[playerid]);
  7037.     TextDrawHideForPlayer(playerid, Tiper[playerid]);
  7038.     KillTimer(DrzwiTimer[playerid]);
  7039.     InfoWyswietla[playerid]=1;
  7040.     if(typ == 0)
  7041.     {
  7042.         TextDrawSetString(Doors[playerid], string);
  7043.         TextDrawShowForPlayer(playerid, Doors[playerid]);
  7044.     }
  7045.     if(typ == 1)
  7046.     {
  7047.         TextDrawSetString(Informacja[playerid], string);
  7048.         TextDrawShowForPlayer(playerid, Informacja[playerid]);
  7049.     }
  7050.     if(typ == 2)
  7051.     {
  7052.         TextDrawSetString(Tiper[playerid], string);
  7053.         TextDrawShowForPlayer(playerid, Tiper[playerid]);
  7054.         PlayerPlaySound(playerid, 1149, 0, 0, 0);
  7055.     }
  7056.     DrzwiTimer[playerid] = SetTimerEx("InfoBoxHide", czas, 0, "d", playerid);
  7057.     return 1;
  7058. }
  7059.  
  7060. Funkcja::ShowPlayerItem(playerid)
  7061. {
  7062.     new przedmioty = 0, type[128], Items[1024], info[128];
  7063.     for(new nr = 0; nr < MAX_ITEM; nr++)
  7064.     {
  7065.         if(Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID] && Przedmiot[nr][iAktywny] == 1)
  7066.         {
  7067.             ListItem[playerid][przedmioty] = nr;
  7068.             if(Przedmiot[nr][iUsed] == 1)
  7069.             format(type, sizeof(type), "{FFFFFF}%d{FFFFFF}\t%s\t\t{000000}(%d, %d, %dg)",nr, Przedmiot[nr][iNazwa], Przedmiot[nr][iWartosc1], Przedmiot[nr][iWartosc2], Przedmiot[nr][iWaga]);
  7070.             else
  7071.             format(type, sizeof(type), "{FFFFFF}%d{AAC5E3}\t%s\t\t{000000}(%d, %d, %dg)",nr, Przedmiot[nr][iNazwa], Przedmiot[nr][iWartosc1], Przedmiot[nr][iWartosc2], Przedmiot[nr][iWaga]);
  7072.             format(Items, sizeof(Items), "%s%s\n", Items, type);
  7073.             przedmioty++;
  7074.         }
  7075.     }
  7076.     if(przedmioty == 0) return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
  7077.     format(info, sizeof(info), ""ServName"Przedmioty (%d, %dg/%dg )", przedmioty, ItemWaga(playerid), ItemUdzwig(playerid));
  7078.     return dShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, info, Items, "Wybierz", "Opcje");
  7079. }
  7080.  
  7081. Funkcja::Oferta(odkogo, dlakogo, typ, value1, value2, value3)
  7082. {
  7083.     return 1;
  7084. }
  7085.  
  7086. Funkcja::InfoBoxHide(playerid)
  7087. {
  7088.     if(InfoWyswietla[playerid] == 1)
  7089.     {
  7090.         TextDrawHideForPlayer(playerid, Doors[playerid]);
  7091.         TextDrawHideForPlayer(playerid, Informacja[playerid]);
  7092.         TextDrawHideForPlayer(playerid, Tiper[playerid]);
  7093.         InfoWyswietla[playerid]=0;
  7094.         KillTimer(DrzwiTimer[playerid]);
  7095.     }
  7096.     return 1;
  7097. }
  7098.  
  7099. Funkcja::UseItem(playerid, uid)
  7100. {
  7101.     new typ = Przedmiot[uid][iTyp], used = Przedmiot[uid][iUsed];
  7102.     if(Przedmiot[uid][iOwner] != 1 || Przedmiot[uid][iOwnerUID] != Player[playerid][pUID] || Przedmiot[uid][iAktywny] == 0)
  7103.         return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
  7104.     if(Przedmiot[uid][iFlaga] != 0)
  7105.     {
  7106.         if(Przedmiot[uid][iFlaga] == 1)
  7107.         {
  7108.             if(Przedmiot[uid][iFlagaUID] != Player[playerid][pUID])
  7109.                 return format(String, sizeof(String), "Ten przedmiot jest oflagowany dla gracza o identyfikatorze ~y~%d~w~. Nie mozesz go uzyc.", Przedmiot[uid][iFlagaUID]), InfoBoxShow(2, playerid, String, 3);
  7110.         }
  7111.         else if(Przedmiot[uid][iFlaga] == 2)
  7112.         {
  7113.             if(Przedmiot[uid][iFlagaUID] != Sluzba(playerid))
  7114.                 return format(String, sizeof(String), "Ten przedmiot jest oflagowany dla grupy o identyfikatorze ~y~%d~w~. Nie mozesz go uzyc.", Przedmiot[uid][iFlagaUID]), InfoBoxShow(2, playerid, String, 3);
  7115.         }
  7116.     }
  7117.     if(typ == 1)
  7118.     {
  7119.         if(used == 0)
  7120.         {
  7121.             if(GetPVarInt(playerid, "rpBron") != 0)
  7122.                 return Tip(playerid, "Aktualnie używasz już jakiejś broni.");
  7123.             if(Przedmiot[uid][iWartosc2] == 0)
  7124.                 return Tip(playerid, "Ten przedmiot nie posiada amunicji, zdobądź ją aby go użyć.");
  7125.             Przedmiot[uid][iUsed] = 1;
  7126.             GivePlayerWeapon(playerid, Przedmiot[uid][iWartosc1], Przedmiot[uid][iWartosc2]);
  7127.             format(String, sizeof(String), "* %s wyciąga przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
  7128.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7129.             SetPVarInt(playerid, "rpBron", Przedmiot[uid][iWartosc1]);
  7130.             SetPVarInt(playerid, "rpAmmo", Przedmiot[uid][iWartosc2]);
  7131.             SetPVarInt(playerid, "rpBronAC", gettime());
  7132.             SetPVarInt(playerid, "rpBronUID", uid);
  7133.         }
  7134.         else
  7135.         {
  7136.             new bron[13], amunicja[13];
  7137.             for (new i = 0; i < 13; i++)
  7138.             {
  7139.                 GetPlayerWeaponData(playerid, i, bron[i], amunicja[i]);
  7140.                 if(bron[i] == GetPVarInt(playerid, "rpBron"))
  7141.                 {
  7142.                     ResetPlayerWeapons(playerid);
  7143.                     Przedmiot[uid][iWartosc2] = amunicja[i];
  7144.                 }
  7145.             }
  7146.             Przedmiot[uid][iUsed] = 0;
  7147.             format(String, sizeof(String), "* %s chowa przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
  7148.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7149.             ResetPlayerWeapons(playerid);
  7150.             SetPVarInt(playerid, "rpBron", 0);
  7151.             SetPVarInt(playerid, "rpAmmo", 0);
  7152.             SetPVarInt(playerid, "rpBronAC", gettime()+5);
  7153.             SetPVarInt(playerid, "rpBronUID", 0);
  7154.             RemovePlayerAttachedObject(playerid, ATTACH_SLOT_1);
  7155.         }
  7156.     }
  7157.     else if(typ == 2)
  7158.     {
  7159.         SetPlayerSkin(playerid, Przedmiot[uid][iWartosc2]);
  7160.         Player[playerid][pSkin] = Przedmiot[uid][iWartosc2];
  7161.         for (new p = 0; p < MAX_ITEM; p++)
  7162.         {
  7163.             if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID] && Przedmiot[p][iTyp] == 2)
  7164.             {
  7165.                 Przedmiot[p][iUsed] = 0;
  7166.             }
  7167.         }
  7168.         Przedmiot[uid][iUsed] = 1;
  7169.         return 1;
  7170.     }
  7171.     else if(typ == 3)
  7172.     {
  7173.         if(getHP(playerid) < 10)
  7174.             return Info(playerid, "Nie możesz spożyć tego przedmiotu.\nAby dodać HP w tym stanie postaci musisz udać się do szpitala w celu aplikowania medykamentu.");
  7175.     }
  7176.     else if(typ == 7)
  7177.     {
  7178.         if(Przedmiot[uid][iUsed] == 0)
  7179.         {
  7180.             format(String, sizeof(String), "* %s zakłada rękawiczki.", CharName(playerid));
  7181.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7182.             return Przedmiot[uid][iUsed] = 1;
  7183.         }
  7184.         else
  7185.         {
  7186.             format(String, sizeof(String), "* %s ściąga rękawiczki.", CharName(playerid));
  7187.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7188.             return Przedmiot[uid][iUsed] = 0;
  7189.         }
  7190.     }
  7191.     else if(typ == 8)
  7192.     {
  7193.         if(Przedmiot[uid][iUsed] == 0)
  7194.         {
  7195.             format(String, sizeof(String), "* %s zakłada na twarz przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
  7196.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7197.             Przedmiot[uid][iUsed] = 1;
  7198.             return setStatus(playerid, 1);
  7199.         }
  7200.         else
  7201.         {
  7202.             format(String, sizeof(String), "* %s ściąga z twarzy przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
  7203.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7204.             Przedmiot[uid][iUsed] = 0;
  7205.             return setStatus(playerid, 0);
  7206.         }
  7207.     }
  7208.     else if(typ == 9)
  7209.     {
  7210.         new Float:Pos[3];
  7211.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  7212.         foreach(Player, p)
  7213.         {
  7214.             if(p != playerid && IsPlayerInRangeOfPoint(p, 5.0, Pos[0], Pos[1], Pos[2]) && Player[p][pBW] >= 1)
  7215.             {
  7216.                 Przedmiot[uid][iAktywny] = 0, ZapiszPrzedmiot(uid);
  7217.                 format(String, sizeof(String), "* %s aplikuje lek %s.", CharName(playerid), CharName(p));
  7218.                 ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  7219.                 Player[p][pBW] = 0;
  7220.                 return setHP(p, Przedmiot[uid][iWartosc1]);
  7221.             }
  7222.         }
  7223.         return Info(playerid, "W pobliżu nie ma żadnego gracza w stanie BW.");
  7224.     }
  7225.     else if(typ == 13)
  7226.     {
  7227.         new Itemy[1024], Item[128], list = 1;
  7228.         for(new p = 0; p < MAX_ITEM; p++)
  7229.         {
  7230.             SetPVarInt(playerid, "AmunicjaUID", uid);
  7231.             if(uid != p && Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
  7232.             {
  7233.                 if(Przedmiot[p][iWartosc1] == Przedmiot[uid][iWartosc1])
  7234.                 {
  7235.                     format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
  7236.                     format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  7237.                     ListItem[playerid][list] = p;
  7238.                     list++;
  7239.                 }
  7240.             }
  7241.         }
  7242.         if(list == 1)  return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
  7243.         format(Itemy, sizeof(Itemy), "%s", Itemy);
  7244.         return dShowPlayerDialog(playerid, 101, DIALOG_STYLE_LIST, ""ServName"Przedmioty", Itemy, "Podnies", "Anuluj");
  7245.     }
  7246.     else if(typ == 16)
  7247.     {
  7248.         if(Przedmiot[uid][iUsed] == 0)
  7249.         {
  7250.             InfoBoxShow(2, playerid, "Telefon zostal ~g~uruchomiony~w~.", 3);
  7251.             for(new p = 0; p < MAX_ITEM; p++)
  7252.             {
  7253.                 //resetowanie innych urządzeń
  7254.                 if(uid != p && Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
  7255.                 {
  7256.                     if(Przedmiot[p][iTyp] == 18 && Przedmiot[p][iUsed] == 1)
  7257.                     {
  7258.                         Przedmiot[p][iUsed] = 0;
  7259.                         InfoBoxShow(2, playerid, "Uruchamiajac ten telefon wylaczyles pozostale ~y~urzadzenia~w~.", 3);
  7260.                     }
  7261.                 }
  7262.             }
  7263.             Player[playerid][pTelefon] = Przedmiot[uid][iWartosc1];
  7264.             Przedmiot[uid][iUsed] = 1;
  7265.             return ZapiszPrzedmiot(uid);
  7266.         }
  7267.         InfoBoxShow(2, playerid, "Telefon zostal ~r~wylaczony~w~.", 3);
  7268.         Player[playerid][pTelefon] = 0;
  7269.         Przedmiot[uid][iUsed] = 0;
  7270.         return ZapiszPrzedmiot(uid);
  7271.     }
  7272. /*  else if(typ == 19)
  7273.     {
  7274.         new Itemy[1024], Item[128], list = 1;
  7275.         for(new p = 0; p < MAX_ITEM; p++)
  7276.         {
  7277.             if(uid != p && Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 5 && Przedmiot[p][iOwnerUID] == uid)
  7278.             {
  7279.                 format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
  7280.                 format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  7281.                 ListItem[playerid][list] = p;
  7282.                 list++;
  7283.             }
  7284.         }
  7285.         if(list == 1)  return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
  7286.         format(Itemy, sizeof(Itemy), "%s", Itemy);
  7287.         return dShowPlayerDialog(playerid, 101, DIALOG_STYLE_LIST, ""ServName"Przedmioty", Itemy, "Wyjmij", "Anuluj");
  7288.     } // torba
  7289. */
  7290.     else if(typ == 19)
  7291.     {
  7292.         if(Przedmiot[uid][iUsed] == 0)
  7293.         {
  7294.             new Attach = 0;
  7295.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_2) && Attach == 0)
  7296.             {
  7297.                 SetPVarInt(playerid, "rpFishSlot", 2);
  7298.                 Attach = 2;
  7299.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_2, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7300.                 EditAttachedObject(playerid, ATTACH_SLOT_2);
  7301.             }
  7302.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_3) && Attach == 0)
  7303.             {
  7304.                 SetPVarInt(playerid, "rpFishSlot", 3);
  7305.                 Attach = 3;
  7306.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_3, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7307.                 EditAttachedObject(playerid, ATTACH_SLOT_3);
  7308.             }
  7309.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_4) && Attach == 0)
  7310.             {
  7311.                 SetPVarInt(playerid, "rpFishSlot", 4);
  7312.                 Attach = 4;
  7313.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_4, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7314.                 EditAttachedObject(playerid, ATTACH_SLOT_4);
  7315.             }
  7316.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_5) && Attach == 0)
  7317.             {
  7318.                 SetPVarInt(playerid, "rpFishSlot", 5);
  7319.                 Attach = 5;
  7320.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_5, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7321.                 EditAttachedObject(playerid, ATTACH_SLOT_5);
  7322.             }
  7323.             if(Attach == 0)
  7324.                 return Info(playerid, "Wykorzystałeś limit doczepionych do ciała obiektów.");
  7325.             Przedmiot[uid][iUsed] = 1;
  7326.             InfoBoxShow(2, playerid, "Uzyj ~y~edytora~w~ pozycji obiektu doczepianego w celu idealnego przypasowania do swojej postaci.", 5);
  7327.             return ZapiszPrzedmiot(uid);
  7328.         }
  7329.         RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "rpFishSlot"));
  7330.         Przedmiot[uid][iUsed] = 0;
  7331.         return ZapiszPrzedmiot(uid);
  7332.     }
  7333.     else if(typ == 20)
  7334.     {
  7335.         new veh = Przedmiot[uid][iWartosc1];
  7336.         for(new v = 1; v < MAX_POJAZDY; v++)
  7337.         {
  7338.             new file[40];
  7339.             format(file, sizeof(file), "Pojazdy/%d.ini", v);
  7340.             if(Pojazd[v][vAktywny] == 0 && !DOF2_FileExists(file))
  7341.             {
  7342.                 Pojazd[v][vAktywny]         = 1;
  7343.                 Pojazd[v][vModel]           = veh;
  7344.                 if(Przedmiot[uid][iFlaga] == 1)
  7345.                 {
  7346.                     Pojazd[v][vOwner]           = 1;
  7347.                     Pojazd[v][vOwnerUID]        = Przedmiot[uid][iFlagaUID];
  7348.                 }
  7349.                 if(Przedmiot[uid][iFlaga] == 2)
  7350.                 {
  7351.                     Pojazd[v][vOwner]           = 2;
  7352.                     Pojazd[v][vOwnerUID]        = Przedmiot[uid][iFlagaUID];
  7353.                 }
  7354.                 Pojazd[v][vKolor1]          = random(252);
  7355.                 Pojazd[v][vKolor2]          = random(252);
  7356.                 Pojazd[v][vPrzebieg]        = 0.0;
  7357.                 Pojazd[v][vHP]              = 1000.0;
  7358.                 GetPlayerPos(playerid, Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ]);
  7359.                 GetPlayerFacingAngle(playerid, Pojazd[v][vRot]);
  7360.                 Pojazd[v][vVir]             = GetPlayerVirtualWorld(playerid);
  7361.                 Pojazd[v][vReje]            = 0;
  7362.                 Pojazd[v][vPanels]          = 0;
  7363.                 Pojazd[v][vDoors]           = 0;
  7364.                 Pojazd[v][vLights]          = 0;
  7365.                 Pojazd[v][vTires]           = 0;
  7366.                 Pojazd[v][vPaliwoTyp]       = 1;
  7367.                 Pojazd[v][vPaliwo]          = PaliwoMax(veh);
  7368.                 Pojazd[v][vPaliwoMax]       = PaliwoMax(veh);
  7369.                 //tworzenie
  7370.                 PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
  7371.                 Pojazd[v][vSpawn] = 1;
  7372.                 PojazdUID[PojazdModel[v]] = v;
  7373.                 if(Pojazd[v][vReje] == 0)
  7374.                 {
  7375.                     SetVehicleNumberPlate(PojazdModel[v], " ");
  7376.                 }
  7377.                 else if(Pojazd[v][vReje] == 1)
  7378.                 {
  7379.                     format(String, sizeof(String), "SA %04d", v);
  7380.                     SetVehicleNumberPlate(PojazdModel[v], String);
  7381.                 }
  7382.                 SetVehicleToRespawn(PojazdModel[v]);
  7383.                 UstawParametryPojazdu(PojazdModel[v]);
  7384.                 format(String, sizeof(String), "Utworzono pojazd ~y~%s~w~ (UID: %d) jako ~r~Gracz~w~. Powinien sie on zespawnowac w okolicy Magazynu Pojazdow, wskazowka dojazdu jest marker.", GetVehicleName(v), v);
  7385.                 InfoBoxShow(2, playerid, String, 3);
  7386.                 Przedmiot[uid][iAktywny] = 0, ZapiszPrzedmiot(uid);
  7387.                 ZapiszPojazd(PojazdModel[v]);
  7388.                 break;
  7389.             }
  7390.         }
  7391.         return 1;
  7392.     }
  7393.     else if(typ == 23)
  7394.     {
  7395.         if(Przedmiot[uid][iUsed] == 0)
  7396.         {
  7397.             new Attach = 0;
  7398.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_2) && Attach == 0)
  7399.             {
  7400.                 SetPVarInt(playerid, "rpBagSlot", 2);
  7401.                 Attach = 2;
  7402.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_2, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7403.                 EditAttachedObject(playerid, ATTACH_SLOT_2);
  7404.             }
  7405.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_3) && Attach == 0)
  7406.             {
  7407.                 SetPVarInt(playerid, "rpBagSlot", 3);
  7408.                 Attach = 3;
  7409.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_3, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7410.                 EditAttachedObject(playerid, ATTACH_SLOT_3);
  7411.             }
  7412.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_4) && Attach == 0)
  7413.             {
  7414.                 SetPVarInt(playerid, "rpBagSlot", 4);
  7415.                 Attach = 4;
  7416.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_4, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7417.                 EditAttachedObject(playerid, ATTACH_SLOT_4);
  7418.             }
  7419.             if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_5) && Attach == 0)
  7420.             {
  7421.                 SetPVarInt(playerid, "rpBagSlot", 5);
  7422.                 Attach = 5;
  7423.                 SetPlayerAttachedObject(playerid, ATTACH_SLOT_5, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  7424.                 EditAttachedObject(playerid, ATTACH_SLOT_5);
  7425.             }
  7426.             if(Attach == 0)
  7427.                 return Info(playerid, "Wykorzystałeś limit doczepionych do ciała obiektów.");
  7428.             Przedmiot[uid][iUsed] = 1;
  7429.             InfoBoxShow(2, playerid, "Uzyj ~y~edytora~w~ pozycji obiektu doczepianego w celu idealnego przypasowania do swojej postaci.", 5);
  7430.             return ZapiszPrzedmiot(uid);
  7431.         }
  7432.         RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "rpBagSlot"));
  7433.         Przedmiot[uid][iUsed] = 0;
  7434.         return ZapiszPrzedmiot(uid);
  7435.     }
  7436.     return 1;
  7437. }
  7438.  
  7439. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  7440. {
  7441.     new info[128];
  7442.     for(new i = 0; i <= MAX_DRZWI; i++)
  7443.     {
  7444.         if(pickupid == DrzwiPickup[i])
  7445.         {
  7446.             if(Drzwi[i][dAktywne] == 1)
  7447.             {
  7448.                 new adm[16], enter_pay[32];
  7449.                 if(Drzwi[i][dStatus] == 0){ info= "~y~Aby wejsc, wcisnij jednoczesnie~n~~w~[~b~~h~~h~~k~~SNEAK_ABOUT~ + ~k~~PED_SPRINT~~w~]"; }
  7450.                 else if(Drzwi[i][dStatus] == 1){ info= "~r~Drzwi sa zamkniete"; }
  7451.  
  7452.                 if(IPB[playerid][ipb_Grupa] == 4)
  7453.                     format(adm, sizeof(adm), " ~w~(UID: %d)", i);
  7454.  
  7455.                 format(enter_pay, sizeof(enter_pay), "_");
  7456.  
  7457.                 if(Drzwi[i][dCreatePrice] != 0)
  7458.                 {
  7459.                     format(String, sizeof(String), "Te drzwi nie zostały jeszcze kupione.\nUżyj komendy /drzwi w celu dokonania zakupu.\nCena drzwi:\t\t$%d", Drzwi[i][dCreatePrice]);
  7460.                     Info(playerid, String);
  7461.                     format(enter_pay, sizeof(enter_pay), "~w~~n~Koszt drzwi: ~g~$%d~n~", Drzwi[i][dCreatePrice]);
  7462.                 }
  7463.  
  7464.                 format(String, sizeof(String), "%s%s~n~%s~n~%s", Drzwi[i][dNazwa], adm, enter_pay, info);
  7465.                 return InfoBoxShow(0,playerid,String,6);
  7466.             }
  7467.         }
  7468.     }
  7469.     return 1;
  7470. }
  7471.  
  7472. public OnDynamicObjectMoved(objectid)
  7473. {
  7474.     return 1;
  7475. }
  7476.  
  7477. public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
  7478. {
  7479.     new rotacja[200], obiekty[500];
  7480.     format(rotacja, sizeof(rotacja), "~n~~b~~h~~h~Rotacja X: ~w~%.2f  ~b~~h~~h~Rotacja Y: ~w~%.2f  ~b~~h~~h~Rotacja Z: ~w~%.2f", rx, ry, rz);
  7481.     format(obiekty, sizeof(obiekty), "~y~Edytor obiektow.~n~~b~~h~~h~Edytowany obiekt: ~w~%d  ~b~~h~~h~VirtualWorld: ~w~%d~n~~b~~h~~h~Pozycja X: ~w~%.2f  ~b~~h~~h~Pozycja Y: ~w~%.2f  ~b~~h~~h~Pozycja Z: ~w~%.2f%s", Obiekt(playerid), Obiekt[Obiekt(playerid)][oVir], x, y, z, rotacja);
  7482.     InfoBoxShow(1, playerid, obiekty, 60);
  7483.     if(response == 0)
  7484.     {
  7485.         InfoBoxShow(1, playerid, " ", 1);
  7486.         CancelEdit(playerid), SetPVarInt(playerid, "objectedit", 0);
  7487.         SetDynamicObjectPos(MapObiekt[objectid], Obiekt[MapObiekt[objectid]][oPosX], Obiekt[MapObiekt[objectid]][oPosY], Obiekt[MapObiekt[objectid]][oPosZ]);
  7488.         SetDynamicObjectRot(MapObiekt[objectid], Obiekt[MapObiekt[objectid]][oRotX], Obiekt[MapObiekt[objectid]][oRotY], Obiekt[MapObiekt[objectid]][oRotZ]);
  7489.         setObiekt(playerid, 0);
  7490.     }
  7491.     else if(response == 1)
  7492.     {
  7493.         InfoBoxShow(1, playerid, " ", 1);
  7494.         CancelEdit(playerid), SetPVarInt(playerid, "objectedit", 0);
  7495.         Obiekt[MapObiekt[objectid]][oPosX] = x, Obiekt[MapObiekt[objectid]][oPosY] = y, Obiekt[MapObiekt[objectid]][oPosZ] = z;
  7496.         Obiekt[MapObiekt[objectid]][oRotX] = rx, Obiekt[MapObiekt[objectid]][oRotY] = ry, Obiekt[MapObiekt[objectid]][oRotZ] = rz;
  7497.         SetDynamicObjectPos(MapObiekt[objectid], x, y, z);
  7498.         SetDynamicObjectRot(MapObiekt[objectid], rx, ry, rz);
  7499.         ZapiszObiekt(MapObiekt[objectid]);
  7500.         setObiekt(playerid, 0);
  7501.     }
  7502.     else if(response == 3)
  7503.     {
  7504.         Tip(playerid, "response 3");
  7505.         Obiekt[MapObiekt[objectid]][oPosX] = x, Obiekt[MapObiekt[objectid]][oPosY] = y, Obiekt[MapObiekt[objectid]][oPosZ] = z;
  7506.         Obiekt[MapObiekt[objectid]][oRotX] = rx, Obiekt[MapObiekt[objectid]][oRotY] = ry, Obiekt[MapObiekt[objectid]][oRotZ] = rz;
  7507.         Obiekt[MapObiekt[objectid]][oGateX] = x, Obiekt[MapObiekt[objectid]][oGateY] = y, Obiekt[MapObiekt[objectid]][oGateZ] = z;
  7508.         Obiekt[MapObiekt[objectid]][oGateRotX] = rx, Obiekt[MapObiekt[objectid]][oGateRotY] = ry, Obiekt[MapObiekt[objectid]][oGateRotZ] = rz;
  7509.         SetDynamicObjectPos(MapObiekt[objectid], x, y, z);
  7510.         SetDynamicObjectRot(MapObiekt[objectid], rx, ry, rz);
  7511.         ZapiszObiekt(MapObiekt[objectid]);
  7512.     }
  7513.     return 1;
  7514. }
  7515.  
  7516. public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  7517. {
  7518.     setObiekt(playerid, MapObiekt[objectid]);
  7519.     return EditDynamicObject(playerid, MapObiekt[objectid]);
  7520. }
  7521.  
  7522. Funkcja::DodajPrzedmiot(playerid, Nazwa[], Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga)
  7523. {
  7524.     new nr;
  7525.     for(nr = 1; nr < MAX_ITEM; nr++)
  7526.     {
  7527.             if(Przedmiot[nr][iAktywny] == 0)
  7528.             {
  7529.             Przedmiot[nr][iAktywny] = 1;
  7530.             Przedmiot[nr][iTyp] = Typ;
  7531.             Przedmiot[nr][iWartosc1] = Wartosc1;
  7532.             Przedmiot[nr][iWartosc2] = Wartosc2;
  7533.             Przedmiot[nr][iOwner] = Owner1;
  7534.             Przedmiot[nr][iOwnerUID] = Owner2;
  7535.             Przedmiot[nr][iWaga] = Waga;
  7536.             Przedmiot[nr][iUsed] = 0;
  7537.             Przedmiot[nr][iVir] = GetPlayerVirtualWorld(playerid);
  7538.             strmid(Przedmiot[nr][iNazwa], Nazwa, 0, 64, 64);
  7539.             if(Owner1 == 7)
  7540.             {
  7541.                 new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  7542.                 Przedmiot[nr][iPosX] = Pos[0];
  7543.                 Przedmiot[nr][iPosY] = Pos[1];
  7544.                 Przedmiot[nr][iPosZ] = Pos[2]-0.95;
  7545.                 ItemObiekt[nr] = CreateDynamicObject(GetItemModel(nr), Przedmiot[nr][iPosX], Przedmiot[nr][iPosY], Przedmiot[nr][iPosZ], ItemRotX(nr), 0, 0, GetPlayerVirtualWorld(playerid));
  7546.             }
  7547.             ZapiszPrzedmiot(nr);
  7548.             break;
  7549.             }
  7550.     }
  7551.     return 1;
  7552. }
  7553.  
  7554. CarUID(vehicle)
  7555. {
  7556.     new vuid = PojazdUID[vehicle];
  7557.     return vuid;
  7558. }
  7559.  
  7560. stock GetPlayerSpeed(playerid)
  7561. {
  7562.     new Float:vx,Float:vy,Float:vz,Float:vpredkosc;
  7563.     if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz); else GetPlayerVelocity(playerid,vx,vy,vz);
  7564.     vpredkosc=floatsqroot((vx*vx)+(vy*vy)+(vz*vz))*198;
  7565.     return floatround(vpredkosc);
  7566. }
  7567.  
  7568. stock mysql_check()
  7569. {
  7570.     if(mysql_ping() == (-1))
  7571.     {
  7572.         print("[MySQL] Utracono połączenie. Ponawiam... [Próba: 1/3]");
  7573.         mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
  7574.         if(!mysql_reload())
  7575.         {
  7576.             print("[MySQL] Próba nie powiodła się, ponawiam... [Próba: 2/3]");
  7577.             if(!mysql_reload())
  7578.             {
  7579.                 print("[MySQL] Próba nie powiodła się, ponawiam... [Próba: 3/3]");
  7580.                 if(!mysql_reload())
  7581.                 {
  7582.                     print("[MySQL] Próba nie powiodła się. [Zakończono]");
  7583.                     SendRconCommand("hostname [RolePlay] Błąd bazy danych, zaczekaj...");
  7584.                     SendRconCommand("password pass000");
  7585.                     SetGameModeText("[MySQL] Failed Connect");
  7586.                 }
  7587.                 else print("[MySQL] Połączenie powiodło się.");
  7588.             }
  7589.             else print("[MySQL] Połączenie powiodło się.");
  7590.         }
  7591.         else print("[MySQL] Połączenie powiodło się.");
  7592.     }
  7593.     return 1;
  7594. }
  7595.  
  7596. //Moduły RolePlay
  7597. Funkcja::PayDay(uid)
  7598. {
  7599.     new file[64], PlayerData[13] = 0, PD = 0;
  7600.     format(file, sizeof(file), "Gracze/%d.ini", uid);
  7601.     if(DOF2_FileExists(file))
  7602.     {
  7603.         //pobieranie gotówki
  7604.         PlayerData[0]       = DOF2_GetInt(file,     "Bank");
  7605.         //pobieranie przynależności
  7606.         PlayerData[1]       = DOF2_GetInt(file,     "Grupa1");
  7607.         PlayerData[2]       = DOF2_GetInt(file,     "Grupa2");
  7608.         PlayerData[3]       = DOF2_GetInt(file,     "Grupa3");
  7609.         PlayerData[4]       = DOF2_GetInt(file,     "Grupa4");
  7610.         PlayerData[5]       = DOF2_GetInt(file,     "Grupa5");
  7611.         //pobieranie kwoty wypłaty
  7612.         PlayerData[6]       = DOF2_GetInt(file,     "GrupaPayDay1");
  7613.         PlayerData[7]       = DOF2_GetInt(file,     "GrupaPayDay2");
  7614.         PlayerData[8]       = DOF2_GetInt(file,     "GrupaPayDay3");
  7615.         PlayerData[9]       = DOF2_GetInt(file,     "GrupaPayDay4");
  7616.         PlayerData[10]      = DOF2_GetInt(file,     "GrupaPayDay5");
  7617.         //inne
  7618.         PlayerData[11]      = DOF2_GetInt(file,     "OwnerUID");
  7619.         PlayerData[12]      = DOF2_GetInt(file,     "PayDayGame");
  7620.     }
  7621.     else
  7622.     {
  7623.         return 1;
  7624.     }
  7625.  
  7626.     DOF2_SetInt(file, "PayDayGame", 0), DOF2_SaveFile();
  7627.     if(PlayerData[12] >= 1800)// Blokujemy nadanie wypłaty dla osoby, która w danym dniu nie przegrała 30 minut.
  7628.     {
  7629.         if(PlayerData[1] != 0 && Grupa[PlayerData[1]][gAktywna] == 1)
  7630.         {
  7631.             if(PlayerData[6] <= Grupa[PlayerData[1]][gPayDay])
  7632.             {
  7633.                 PD += PlayerData[6];
  7634.             }
  7635.         }
  7636.         if(PlayerData[2] != 0 && Grupa[PlayerData[2]][gAktywna] == 1)
  7637.         {
  7638.             if(PlayerData[7] <= Grupa[PlayerData[2]][gPayDay])
  7639.             {
  7640.                PD += PlayerData[7];
  7641.             }
  7642.         }
  7643.         if(PlayerData[3] != 0 && Grupa[PlayerData[3]][gAktywna] == 1)
  7644.         {
  7645.             if(PlayerData[8] <= Grupa[PlayerData[3]][gPayDay])
  7646.             {
  7647.                 PD += PlayerData[8];
  7648.             }
  7649.         }
  7650.         if(PlayerData[4] != 0 && Grupa[PlayerData[4]][gAktywna] == 1)
  7651.         {
  7652.             if(PlayerData[9] <= Grupa[PlayerData[4]][gPayDay])
  7653.             {
  7654.                 PD += PlayerData[9];
  7655.             }
  7656.         }
  7657.         if(PlayerData[5] != 0 && Grupa[PlayerData[5]][gAktywna] == 1)
  7658.         {
  7659.             if(PlayerData[10] <= Grupa[PlayerData[5]][gPayDay])
  7660.             {
  7661.                 PD += PlayerData[10];
  7662.             }
  7663.         }
  7664.         if(PD == 0)
  7665.             return DOF2_SetInt(file, "Bank", PlayerData[0]+200), DOF2_SaveFile();
  7666.         if(PD < 1500)
  7667.         PlayerData[0] += PD;
  7668.         else
  7669.         PlayerData[0] += 1500, PD = 1500;
  7670.         //wysyłamy rekord do MySQL
  7671.         new query[256];
  7672.         format(query, sizeof(query), "INSERT INTO `1payday` (`global`,`char`,`paydayplus`,`paydayminus`,`data`) VALUES ('%d', %d, '%d', '%d', '%d')", PlayerData[11], uid, PD, 0, gettime());
  7673.         mysql_query_ex(query);
  7674.         //kończymy wysyłanie insertu do MySQL
  7675.         printf("System przydzielil graczu %d $%d wyplaty, nowy stan konta to $%d.", uid, PD, PlayerData[0]);
  7676.         return DOF2_SetInt(file, "Bank", PlayerData[0]), DOF2_SaveFile();
  7677.     }
  7678.     return 1;
  7679. }
  7680.  
  7681. Funkcja::Wczytaj_Pojazdy()
  7682. {
  7683.     new file[40];
  7684.     for(new v = 1; v < MAX_POJAZDY; v++)
  7685.     {
  7686.         format(file,sizeof(file), "Pojazdy/%d.ini", v);
  7687.         if(DOF2_FileExists(file))
  7688.         {
  7689.             Pojazd[v][vAktywny]     = DOF2_GetInt(file,     "Aktywny");
  7690.             Pojazd[v][vModel]       = DOF2_GetInt(file,     "Model");
  7691.             Pojazd[v][vOwner]       = DOF2_GetInt(file,     "Owner");
  7692.             Pojazd[v][vOwnerUID]    = DOF2_GetInt(file,     "OwnerUID");
  7693.             Pojazd[v][vKolor1]      = DOF2_GetInt(file,     "Kolor1");
  7694.             Pojazd[v][vKolor2]      = DOF2_GetInt(file,     "Kolor2");
  7695.             Pojazd[v][vPrzebieg]    = DOF2_GetFloat(file,   "Przebieg");
  7696.             Pojazd[v][vHP]          = DOF2_GetFloat(file,   "HP");
  7697.             Pojazd[v][vPosX]        = DOF2_GetFloat(file,   "PosX");
  7698.             Pojazd[v][vPosY]        = DOF2_GetFloat(file,   "PosY");
  7699.             Pojazd[v][vPosZ]        = DOF2_GetFloat(file,   "PosZ");
  7700.             Pojazd[v][vRot]         = DOF2_GetFloat(file,   "Rot");
  7701.             Pojazd[v][vVir]         = DOF2_GetInt(file,     "Vir");
  7702.             Pojazd[v][vReje]        = DOF2_GetInt(file,     "Reje");
  7703.             Pojazd[v][vPanels]      = DOF2_GetInt(file,     "Panels");
  7704.             Pojazd[v][vDoors]       = DOF2_GetInt(file,     "Doors");
  7705.             Pojazd[v][vLights]      = DOF2_GetInt(file,     "Lights");
  7706.             Pojazd[v][vTires]       = DOF2_GetInt(file,     "Tires");
  7707.             Pojazd[v][vPaliwoTyp]   = DOF2_GetInt(file,     "PaliwoTyp");
  7708.             Pojazd[v][vPaliwo]      = DOF2_GetFloat(file,   "Paliwo");
  7709.             Pojazd[v][vPaliwoMax]   = DOF2_GetFloat(file,   "PaliwoMax");
  7710.             if(Pojazd[v][vAktywny] == 1)
  7711.             {
  7712.                 new query[256];
  7713.                 format(query, sizeof(query), "INSERT INTO `1veh` (`uid`,`model`,`marka`,`owner`,`owner_uid`,`HP`,`przebieg`) VALUES ('%d', '%d', '%s', '%d', '%d', %f, %f)", v, Pojazd[v][vModel], GetVehicleName(v), Pojazd[v][vOwner], Pojazd[v][vOwnerUID], Pojazd[v][vHP], Pojazd[v][vPrzebieg]);
  7714.                 mysql_query_ex(query);
  7715.             }
  7716.             if(Pojazd[v][vAktywny] == 1 && Pojazd[v][vOwner] == 2)
  7717.             {
  7718.                 StatsVeh++;
  7719.                 if(Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] < Grupa[Pojazd[v][vOwnerUID]][gVehLimit])
  7720.                 {
  7721.                     Pojazd[v][vSpawn] = 1;
  7722.                     PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
  7723.                     GetVehiclePos(PojazdModel[v], VehicleLastPos[PojazdModel[v]][0], VehicleLastPos[PojazdModel[v]][1], VehicleLastPos[PojazdModel[v]][2]);
  7724.                     GetVehicleZAngle(PojazdModel[v], VehicleLastPos[PojazdModel[v]][3]);
  7725.                     PojazdUID[PojazdModel[v]] = v;
  7726.     /*              if(Pojazd[v][vOwner] == 2 && Grupa[Pojazd[v][vOwnerUID]][gAktywna] == 0)
  7727.                     {
  7728.                         Pojazd[v][vAktywny] = 0;
  7729.                         ZapiszPojazd(PojazdModel[v]);
  7730.                         for(new p = 0; p < MAX_ITEM; p++)
  7731.                         {
  7732.                             if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 8 && Przedmiot[p][iOwnerUID] == v && Przedmiot[p][iTyp] == 5)
  7733.                             {
  7734.                                 ZapiszPrzedmiot(p);
  7735.                             }
  7736.                         }
  7737.                         DestroyVehicle(PojazdModel[v]);
  7738.                         printf("[veh][deleted] %s (UID: %d, sampID: %d) zostal skasowany, poniewaz grupa (UID: %d) zostala usunieta.", GetVehicleName(v), v, PojazdModel[v], Pojazd[v][vOwnerUID]);
  7739.                     }
  7740.     */
  7741.                     if(Pojazd[v][vReje] == 0)
  7742.                     {
  7743.                         SetVehicleNumberPlate(PojazdModel[v], " ");
  7744.                     }
  7745.                     else if(Pojazd[v][vReje] == 1)
  7746.                     {
  7747.                         format(String, sizeof(String), "SA %04d", v);
  7748.                         SetVehicleNumberPlate(PojazdModel[v], String);
  7749.                     }
  7750.                     SetVehicleToRespawn(PojazdModel[v]);
  7751.                     UstawParametryPojazdu(PojazdModel[v]);
  7752.                     UpdateVehicleDamageStatus(PojazdModel[v], Pojazd[v][vPanels], Pojazd[v][vDoors], Pojazd[v][vLights], Pojazd[v][vTires]);
  7753.                     Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn]++;
  7754.                 }
  7755.             }
  7756.             else
  7757.             {
  7758.                 Pojazd[v][vSpawn] = 0;
  7759.             }
  7760.         }
  7761.     }
  7762.     return 1;
  7763. }
  7764.  
  7765. Funkcja::ZapiszPojazd(vehicleid)
  7766. {
  7767.     if(vehicleid < 1 || vehicleid > MAX_VEHICLES) return 1;
  7768.     new file[40], veh = CarUID(vehicleid);
  7769.     format(file, sizeof(file), "Pojazdy/%d.ini", veh);
  7770.     //nadpisywanie
  7771.     GetVehicleHealth(vehicleid, Pojazd[veh][vHP]);
  7772.     Pojazd[veh][vVir] = GetVehicleVirtualWorld(vehicleid);
  7773.     Pojazd[veh][vModel] = GetVehicleModel(vehicleid);
  7774.     new panels1, doors1, lights1, tires1;
  7775.     GetVehicleDamageStatus(vehicleid, panels1, doors1, lights1, tires1);
  7776.     if(Pojazd[veh][vPanels] < panels1)
  7777.     {
  7778.         Pojazd[veh][vPanels] = panels1;
  7779.     }
  7780.     if(Pojazd[veh][vDoors] < doors1)
  7781.     {
  7782.         Pojazd[veh][vDoors] = doors1;
  7783.     }
  7784.     if(Pojazd[veh][vLights] < lights1)
  7785.     {
  7786.         Pojazd[veh][vLights] = lights1;
  7787.     }
  7788.     if(Pojazd[veh][vTires] < tires1)
  7789.     {
  7790.         Pojazd[veh][vTires] = tires1;
  7791.     }
  7792.     //
  7793.     if(DOF2_FileExists(file))
  7794.     {
  7795.         DOF2_SetInt(file,   "Aktywny",  Pojazd[veh][vAktywny]);
  7796.         DOF2_SetInt(file,   "Model",    Pojazd[veh][vModel]);
  7797.         DOF2_SetInt(file,   "Owner",    Pojazd[veh][vOwner]);
  7798.         DOF2_SetInt(file,   "OwnerUID", Pojazd[veh][vOwnerUID]);
  7799.         DOF2_SetInt(file,   "Kolor1",   Pojazd[veh][vKolor1]);
  7800.         DOF2_SetInt(file,   "Kolor2",   Pojazd[veh][vKolor2]);
  7801.         DOF2_SetFloat(file, "Przebieg", Pojazd[veh][vPrzebieg]);
  7802.         DOF2_SetFloat(file, "HP",       Pojazd[veh][vHP]);
  7803.         DOF2_SetFloat(file, "PosX",     Pojazd[veh][vPosX]);
  7804.         DOF2_SetFloat(file, "PosY",     Pojazd[veh][vPosY]);
  7805.         DOF2_SetFloat(file, "PosZ",     Pojazd[veh][vPosZ]);
  7806.         DOF2_SetFloat(file, "Rot",      Pojazd[veh][vRot] );
  7807.         DOF2_SetInt(file,   "Vir",      Pojazd[veh][vVir]);
  7808.         DOF2_SetInt(file,   "Reje",     Pojazd[veh][vReje]);
  7809.         DOF2_SetInt(file,   "Panels",   Pojazd[veh][vPanels]);
  7810.         DOF2_SetInt(file,   "Doors",    Pojazd[veh][vDoors]);
  7811.         DOF2_SetInt(file,   "Lights",   Pojazd[veh][vLights]);
  7812.         DOF2_SetInt(file,   "Tires",    Pojazd[veh][vTires]);
  7813.         DOF2_SetInt(file,   "PaliwoTyp",Pojazd[veh][vPaliwoTyp]);
  7814.         DOF2_SetFloat(file, "Paliwo",   Pojazd[veh][vPaliwo]);
  7815.         DOF2_SetFloat(file, "PaliwoMax",Pojazd[veh][vPaliwoMax]);
  7816.         DOF2_SetInt(file,   "Blokada"  ,Pojazd[veh][vBlokada]);
  7817.         DOF2_SetString(file,"BlokadaText",Pojazd[veh][vBlokadaText]);
  7818.         DOF2_SaveFile();
  7819.     }
  7820.     else
  7821.     {
  7822.         DOF2_CreateFile(file);
  7823.         DOF2_SetInt(file,   "Aktywny",  Pojazd[veh][vAktywny]);
  7824.         DOF2_SetInt(file,   "Model",    Pojazd[veh][vModel]);
  7825.         DOF2_SetInt(file,   "Owner",    Pojazd[veh][vOwner]);
  7826.         DOF2_SetInt(file,   "OwnerUID", Pojazd[veh][vOwnerUID]);
  7827.         DOF2_SetInt(file,   "Kolor1",   Pojazd[veh][vKolor1]);
  7828.         DOF2_SetInt(file,   "Kolor2",   Pojazd[veh][vKolor2]);
  7829.         DOF2_SetFloat(file, "Przebieg", Pojazd[veh][vPrzebieg]);
  7830.         DOF2_SetFloat(file, "HP",       Pojazd[veh][vHP]);
  7831.         DOF2_SetFloat(file, "PosX",     Pojazd[veh][vPosX]);
  7832.         DOF2_SetFloat(file, "PosY",     Pojazd[veh][vPosY]);
  7833.         DOF2_SetFloat(file, "PosZ",     Pojazd[veh][vPosZ]);
  7834.         DOF2_SetFloat(file, "Rot",      Pojazd[veh][vRot] );
  7835.         DOF2_SetInt(file,   "Vir",      Pojazd[veh][vVir]);
  7836.         DOF2_SetInt(file,   "Reje",     Pojazd[veh][vReje]);
  7837.         DOF2_SetInt(file,   "Panels",   Pojazd[veh][vPanels]);
  7838.         DOF2_SetInt(file,   "Doors",    Pojazd[veh][vDoors]);
  7839.         DOF2_SetInt(file,   "Lights",   Pojazd[veh][vLights]);
  7840.         DOF2_SetInt(file,   "Tires",    Pojazd[veh][vTires]);
  7841.         DOF2_SetInt(file,   "PaliwoTyp",Pojazd[veh][vPaliwoTyp]);
  7842.         DOF2_SetFloat(file, "Paliwo",   Pojazd[veh][vPaliwo]);
  7843.         DOF2_SetFloat(file, "PaliwoMax",Pojazd[veh][vPaliwoMax]);
  7844.         DOF2_SetInt(file,   "Blokada"  ,Pojazd[veh][vBlokada]);
  7845.         DOF2_SetString(file,"BlokadaText",Pojazd[veh][vBlokadaText]);
  7846.         DOF2_SaveFile();
  7847.     }
  7848.     return 1;//printf("Zapisano: %s (UID: %d, sampID: %d)", GetVehicleName(veh), veh, vehicleid);
  7849. }
  7850.  
  7851. Funkcja::UstawParametryPojazdu(vehicleid)
  7852. {
  7853.     SetVehicleHealth(vehicleid, Pojazd[CarUID(vehicleid)][vHP]);
  7854.     SetVehicleVirtualWorld(vehicleid, Pojazd[CarUID(vehicleid)][vVir]);
  7855.     //Dodawanie tuningu
  7856.     new tune = 0;
  7857.     for(new p = 0; p < MAX_ITEM; p++)
  7858.     {
  7859.         if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 8 && Przedmiot[p][iOwnerUID] == CarUID(vehicleid) && Przedmiot[p][iTyp] == 5)
  7860.         {
  7861.             if(tune < 14)
  7862.             {
  7863.                 tune++;
  7864.                 VehTune[vehicleid][tune] = Przedmiot[p][iWartosc2], AddVehicleComponent(vehicleid, Przedmiot[p][iWartosc2]);
  7865.             }
  7866.         }
  7867.     }
  7868.     return UpdateVehicleDamageStatus(vehicleid, Pojazd[CarUID(vehicleid)][vPanels], Pojazd[CarUID(vehicleid)][vDoors], Pojazd[CarUID(vehicleid)][vLights], Pojazd[CarUID(vehicleid)][vTires]);
  7869. }
  7870.  
  7871. Funkcja::NadpiszParametryPojazdu(vehicleid)
  7872. {
  7873.     new v = CarUID(vehicleid);
  7874.     GetVehicleHealth(vehicleid, Pojazd[v][vHP]);
  7875.     Pojazd[v][vVir] = GetVehicleVirtualWorld(vehicleid);
  7876.     return 1;//ZapiszPojazd(v);
  7877. }
  7878.  
  7879.  
  7880. Funkcja::Wczytaj_Obiekty()
  7881. {
  7882.     new file[40];
  7883.     for(new nr = 0; nr < MAX_OBIEKT; nr++)
  7884.     {
  7885.         format(file,sizeof(file),"Obiekty/%d.ini",nr);
  7886.         if(DOF2_FileExists(file))
  7887.         {
  7888.             Obiekt[nr][oAktywny]    = DOF2_GetInt(file,     "Aktywny");
  7889.             Obiekt[nr][oModel]      = DOF2_GetInt(file,     "Model");
  7890.             Obiekt[nr][oVir]        = DOF2_GetInt(file,     "Vir");
  7891.             Obiekt[nr][oTyp]        = DOF2_GetInt(file,     "Typ");
  7892.             Obiekt[nr][oPosX]       = DOF2_GetFloat(file,   "PosX");
  7893.             Obiekt[nr][oPosY]       = DOF2_GetFloat(file,   "PosY");
  7894.             Obiekt[nr][oPosZ]       = DOF2_GetFloat(file,   "PosZ");
  7895.             Obiekt[nr][oRotX]       = DOF2_GetFloat(file,   "RotX");
  7896.             Obiekt[nr][oRotY]       = DOF2_GetFloat(file,   "RotY");
  7897.             Obiekt[nr][oRotZ]       = DOF2_GetFloat(file,   "RotZ");
  7898.             //tekstury
  7899.             Obiekt[nr][oMatIndex]   = DOF2_GetInt(file,     "MatIndex");
  7900.             Obiekt[nr][oMatModel]   = DOF2_GetInt(file,     "MatModel");
  7901.             Obiekt[nr][oMatTxdname] = DOF2_GetString(file,  "MatTxdname");
  7902.             Obiekt[nr][oMatTexture] = DOF2_GetString(file,  "MatTexture");
  7903.             if(Obiekt[nr][oAktywny] == 1)
  7904.             {
  7905.                 StatsObj++;
  7906.                 MapObiekt[nr] = CreateDynamicObject(Obiekt[nr][oModel], Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ], Obiekt[nr][oRotX], Obiekt[nr][oRotY], Obiekt[nr][oRotZ], Obiekt[nr][oVir]);
  7907.                 SetDynamicObjectMaterial(nr, Obiekt[nr][oMatIndex], Obiekt[nr][oMatModel], Obiekt[nr][oMatTxdname],  Obiekt[nr][oMatTexture], 0xFFFFFFFF);
  7908.             }
  7909.         }
  7910.         else
  7911.         {
  7912.             Obiekt[nr][oAktywny] = 0;
  7913.         }
  7914.     }
  7915.     return 1;
  7916. }
  7917.  
  7918. Funkcja::ZapiszObiekt(nr)
  7919. {
  7920.     if(nr < 1 || nr > MAX_OBIEKT) return 1;
  7921.     new file[40];
  7922.     format(file,sizeof(file),"Obiekty/%d.ini",nr);
  7923.     if(DOF2_FileExists(file))
  7924.     {
  7925.         DOF2_SetInt(file,   "Aktywny",  Obiekt[nr][oAktywny]);
  7926.         DOF2_SetInt(file,   "Model",    Obiekt[nr][oModel]);
  7927.         DOF2_SetInt(file,   "Vir",      Obiekt[nr][oVir]);
  7928.         DOF2_SetInt(file,   "Typ",      Obiekt[nr][oTyp]);
  7929.         DOF2_SetFloat(file, "PosX",     Obiekt[nr][oPosX]);
  7930.         DOF2_SetFloat(file, "PosY",     Obiekt[nr][oPosY]);
  7931.         DOF2_SetFloat(file, "PosZ",     Obiekt[nr][oPosZ]);
  7932.         DOF2_SetFloat(file, "RotX",     Obiekt[nr][oRotX]);
  7933.         DOF2_SetFloat(file, "RotY",     Obiekt[nr][oRotY]);
  7934.         DOF2_SetFloat(file, "RotZ",     Obiekt[nr][oRotZ]);
  7935.         //tekstury
  7936.         DOF2_SetInt(file,   "MatIndex",     Obiekt[nr][oMatIndex]);
  7937.         DOF2_SetInt(file,   "MatModel",     Obiekt[nr][oMatModel]);
  7938.         DOF2_SetString(file, "MatTxdname", Obiekt[nr][oMatTxdname]);
  7939.         DOF2_SetString(file, "MatTexture", Obiekt[nr][oMatTexture]);
  7940.         DOF2_SaveFile();
  7941.     }
  7942.     else
  7943.     {
  7944.         DOF2_CreateFile(file);
  7945.         DOF2_SetInt(file,   "Aktywny",  Obiekt[nr][oAktywny]);
  7946.         DOF2_SetInt(file,   "Model",    Obiekt[nr][oModel]);
  7947.         DOF2_SetInt(file,   "Vir",      Obiekt[nr][oVir]);
  7948.         DOF2_SetInt(file,   "Typ",      Obiekt[nr][oTyp]);
  7949.         DOF2_SetFloat(file, "PosX",     Obiekt[nr][oPosX]);
  7950.         DOF2_SetFloat(file, "PosY",     Obiekt[nr][oPosY]);
  7951.         DOF2_SetFloat(file, "PosZ",     Obiekt[nr][oPosZ]);
  7952.         DOF2_SetFloat(file, "RotX",     Obiekt[nr][oRotX]);
  7953.         DOF2_SetFloat(file, "RotY",     Obiekt[nr][oRotY]);
  7954.         DOF2_SetFloat(file, "RotZ",     Obiekt[nr][oRotZ]);
  7955.         //tekstury
  7956.         DOF2_SetInt(file, "MatIndex",   Obiekt[nr][oMatIndex]);
  7957.         DOF2_SetInt(file, "MatModel",   Obiekt[nr][oMatModel]);
  7958.         DOF2_SetString(file, "MatTxdname", Obiekt[nr][oMatTxdname]);
  7959.         DOF2_SetString(file, "MatTexture", Obiekt[nr][oMatTexture]);
  7960.         DOF2_SaveFile();
  7961.     }
  7962.     return 1;
  7963. }
  7964.  
  7965. Funkcja::Restart()
  7966. {
  7967.     return SendRconCommand("gmx");
  7968. }
  7969.  
  7970. Funkcja::Wczytaj_Drzwi()
  7971. {
  7972.     new file[40], query[512];
  7973.     for(new nr = 0; nr < MAX_DRZWI; nr++)
  7974.     {
  7975.         format(file,sizeof(file),"Drzwi/%d.ini",nr);
  7976.         if(DOF2_FileExists(file))
  7977.         {
  7978.             Drzwi[nr][dAktywne]     = DOF2_GetInt(file, "Aktywne");
  7979.             Drzwi[nr][dOwner]       = DOF2_GetInt(file, "Owner");
  7980.             Drzwi[nr][dOwnerUID]    = DOF2_GetInt(file, "OwnerUID");
  7981.             Drzwi[nr][dWewVir]      = DOF2_GetInt(file, "WewVir");
  7982.             Drzwi[nr][dZewVir]      = DOF2_GetInt(file, "ZewVir");
  7983.             Drzwi[nr][dPickup]      = DOF2_GetInt(file, "Pickup");
  7984.             Drzwi[nr][dObiekty]     = DOF2_GetInt(file, "Obiekty");
  7985.             Drzwi[nr][dNazwa]       = DOF2_GetString(file, "Nazwa");
  7986.             Drzwi[nr][dWewPosX]     = DOF2_GetFloat(file, "WewPosX");
  7987.             Drzwi[nr][dWewPosY]     = DOF2_GetFloat(file, "WewPosY");
  7988.             Drzwi[nr][dWewPosZ]     = DOF2_GetFloat(file, "WewPosZ");
  7989.             Drzwi[nr][dZewPosX]     = DOF2_GetFloat(file, "ZewPosX");
  7990.             Drzwi[nr][dZewPosY]     = DOF2_GetFloat(file, "ZewPosY");
  7991.             Drzwi[nr][dZewPosZ]     = DOF2_GetFloat(file, "ZewPosZ");
  7992.  
  7993.             //Rot
  7994.             Drzwi[nr][dZewRot]     = DOF2_GetFloat(file, "ZewRot");
  7995.             Drzwi[nr][dWewRot]     = DOF2_GetFloat(file, "WewRot");
  7996.  
  7997.             Drzwi[nr][dStatus]      = DOF2_GetInt(file, "Status");
  7998.             Drzwi[nr][dIntZew]      = DOF2_GetInt(file, "IntZew");
  7999.             Drzwi[nr][dIntWew]      = DOF2_GetInt(file, "IntWew");
  8000.             Drzwi[nr][dCreatePrice] = DOF2_GetInt(file, "Price");
  8001.             Drzwi[nr][dCreateTime]  = DOF2_GetInt(file, "Create");
  8002.             if(Drzwi[nr][dAktywne] == 1)
  8003.             {
  8004.                 Door_Update(nr);
  8005.                 StatsDoor++;
  8006.                 DrzwiPickup[nr] = CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
  8007.             }
  8008.             else
  8009.             {
  8010.                 format(query, 128, "DELETE FROM `1drzwi` WHERE uid = '%d'", nr), mysql_query_ex(query);
  8011.             }
  8012.         }
  8013.         else
  8014.         {
  8015.             Drzwi[nr][dAktywne] = 0;
  8016.         }
  8017.     }
  8018.     return 1;
  8019. }
  8020.  
  8021. Funkcja::ZapiszDrzwi(nr)
  8022. {
  8023.     if(nr < 0 || nr > MAX_DRZWI) return 1;
  8024.     new file[40];
  8025.     format(file,sizeof(file),"DRZWI/%d.ini",nr);
  8026.     if(DOF2_FileExists(file))
  8027.     {
  8028.         DOF2_SetInt(file,       "Aktywne",  Drzwi[nr][dAktywne]);
  8029.         DOF2_SetInt(file,       "Owner",    Drzwi[nr][dOwner]);
  8030.         DOF2_SetInt(file,       "OwnerUID", Drzwi[nr][dOwnerUID]);
  8031.         DOF2_SetInt(file,       "WewVir",   Drzwi[nr][dWewVir]);
  8032.         DOF2_SetInt(file,       "ZewVir",   Drzwi[nr][dZewVir]);
  8033.         DOF2_SetInt(file,       "Pickup",   Drzwi[nr][dPickup]);
  8034.         DOF2_SetInt(file,       "Obiekty",  Drzwi[nr][dObiekty]);
  8035.         DOF2_SetString(file,    "Nazwa",    Drzwi[nr][dNazwa]);
  8036.         DOF2_SetFloat(file,     "WewPosX",  Drzwi[nr][dWewPosX]);
  8037.         DOF2_SetFloat(file,     "WewPosY",  Drzwi[nr][dWewPosY]);
  8038.         DOF2_SetFloat(file,     "WewPosZ",  Drzwi[nr][dWewPosZ]);
  8039.         DOF2_SetFloat(file,     "ZewPosX",  Drzwi[nr][dZewPosX]);
  8040.         DOF2_SetFloat(file,     "ZewPosY",  Drzwi[nr][dZewPosY]);
  8041.         DOF2_SetFloat(file,     "ZewPosZ",  Drzwi[nr][dZewPosZ]);
  8042.  
  8043.         //Rot
  8044.         DOF2_SetFloat(file,     "ZewRot",   Drzwi[nr][dZewRot]);
  8045.         DOF2_SetFloat(file,     "WewRot",   Drzwi[nr][dWewRot]);
  8046.  
  8047.         DOF2_SetInt(file,       "Status",   Drzwi[nr][dStatus]);
  8048.         DOF2_SetInt(file,       "IntZew",   Drzwi[nr][dIntZew]);
  8049.         DOF2_SetInt(file,       "IntWew",   Drzwi[nr][dIntWew]);
  8050.         DOF2_SetInt(file,       "Price",    Drzwi[nr][dCreatePrice]);
  8051.         DOF2_SetInt(file,       "Create",   Drzwi[nr][dCreateTime]);
  8052.         DOF2_SaveFile();
  8053.     }
  8054.     else
  8055.     {
  8056.         DOF2_CreateFile(file);
  8057.         DOF2_SetInt(file,       "Aktywne",  Drzwi[nr][dAktywne]);
  8058.         DOF2_SetInt(file,       "Owner",    Drzwi[nr][dOwner]);
  8059.         DOF2_SetInt(file,       "OwnerUID", Drzwi[nr][dOwnerUID]);
  8060.         DOF2_SetInt(file,       "WewVir",   Drzwi[nr][dWewVir]);
  8061.         DOF2_SetInt(file,       "ZewVir",   Drzwi[nr][dZewVir]);
  8062.         DOF2_SetInt(file,       "Pickup",   Drzwi[nr][dPickup]);
  8063.         DOF2_SetInt(file,       "Obiekty",  Drzwi[nr][dObiekty]);
  8064.         DOF2_SetString(file,    "Nazwa",    Drzwi[nr][dNazwa]);
  8065.         DOF2_SetFloat(file,     "WewPosX",  Drzwi[nr][dWewPosX]);
  8066.         DOF2_SetFloat(file,     "WewPosY",  Drzwi[nr][dWewPosY]);
  8067.         DOF2_SetFloat(file,     "WewPosZ",  Drzwi[nr][dWewPosZ]);
  8068.         DOF2_SetFloat(file,     "ZewPosX",  Drzwi[nr][dZewPosX]);
  8069.         DOF2_SetFloat(file,     "ZewPosY",  Drzwi[nr][dZewPosY]);
  8070.         DOF2_SetFloat(file,     "ZewPosZ",  Drzwi[nr][dZewPosZ]);
  8071.  
  8072.         //Rot
  8073.         DOF2_SetFloat(file,     "ZewRot",   Drzwi[nr][dZewRot]);
  8074.         DOF2_SetFloat(file,     "WewRot",   Drzwi[nr][dWewRot]);
  8075.  
  8076.         DOF2_SetInt(file,       "Status",   Drzwi[nr][dStatus]);
  8077.         DOF2_SetInt(file,       "IntZew",   Drzwi[nr][dIntZew]);
  8078.         DOF2_SetInt(file,       "IntWew",   Drzwi[nr][dIntWew]);
  8079.         DOF2_SetInt(file,       "Price",    Drzwi[nr][dCreatePrice]);
  8080.         DOF2_SetInt(file,       "Create",   Drzwi[nr][dCreateTime]);
  8081.         DOF2_SaveFile();
  8082.     }
  8083.     return 1;
  8084. }
  8085.  
  8086. Funkcja::Wczytaj_Przedmioty()
  8087. {
  8088.     new file[40], wczytane;
  8089.     for(new nr = 1; nr < MAX_ITEM; nr++)
  8090.     {
  8091.         format(file,sizeof(file),"Przedmioty/%d.ini",nr);
  8092.         if(DOF2_FileExists(file))
  8093.         {
  8094.             Przedmiot[nr][iAktywny]     = DOF2_GetInt(file, "Aktywny");
  8095.             Przedmiot[nr][iNazwa]       = DOF2_GetString(file, "Nazwa");
  8096.             Przedmiot[nr][iWartosc1]    = DOF2_GetInt(file, "Wartosc1");
  8097.             Przedmiot[nr][iWartosc2]    = DOF2_GetInt(file, "Wartosc2");
  8098.             Przedmiot[nr][iWartosc3]    = DOF2_GetInt(file, "Wartosc3");
  8099.             Przedmiot[nr][iTyp]         = DOF2_GetInt(file, "Typ");
  8100.             Przedmiot[nr][iOwner]       = DOF2_GetInt(file, "Owner");
  8101.             Przedmiot[nr][iOwnerUID]    = DOF2_GetInt(file, "OwnerUID");
  8102.             Przedmiot[nr][iUsed]        = DOF2_GetInt(file, "Used");
  8103.             Przedmiot[nr][iWaga]        = DOF2_GetInt(file, "Waga");
  8104.             Przedmiot[nr][iVir]         = DOF2_GetInt(file, "Vir");
  8105.             Przedmiot[nr][iPosX]        = DOF2_GetFloat(file, "PosX");
  8106.             Przedmiot[nr][iPosY]        = DOF2_GetFloat(file, "PosY");
  8107.             Przedmiot[nr][iPosZ]        = DOF2_GetFloat(file, "PosZ");
  8108.             Przedmiot[nr][iRotX]        = DOF2_GetFloat(file, "RotX");
  8109.             Przedmiot[nr][iFlaga]       = DOF2_GetInt(file, "Flaga");
  8110.             Przedmiot[nr][iFlagaUID]    = DOF2_GetInt(file, "FlagaUID");
  8111.             Przedmiot[nr][iPrice]       = DOF2_GetInt(file, "Cena");
  8112.             Przedmiot[nr][iPremiumPrice]= DOF2_GetInt(file, "Premium");
  8113.             if(Przedmiot[nr][iAktywny] == 1)
  8114.             {
  8115.                 StatsItem++;
  8116.                 if(Przedmiot[nr][iOwner] == 7)
  8117.                 {
  8118.                     ItemObiekt[nr] = CreateObject(GetItemModel(nr), Przedmiot[nr][iPosX], Przedmiot[nr][iPosY], Przedmiot[nr][iPosZ], ItemRotX(nr), 0, 0, Przedmiot[nr][iVir]);
  8119.                 }
  8120.             }
  8121.             wczytane ++;
  8122.         }
  8123.         else
  8124.         {
  8125.             Przedmiot[nr][iAktywny] = 0;
  8126.         }
  8127.     }
  8128.     return 1;
  8129. }
  8130.  
  8131. Funkcja::ZapiszPrzedmiot(nr)
  8132. {
  8133.     if(nr < 1 || nr > MAX_ITEM) return 1;
  8134.     new file[40];
  8135.     format(file,sizeof(file),"Przedmioty/%d.ini",nr);
  8136.     if(DOF2_FileExists(file))
  8137.     {
  8138.         DOF2_SetInt(file,       "Aktywny",  Przedmiot[nr][iAktywny]);
  8139.         DOF2_SetString(file,    "Nazwa",    Przedmiot[nr][iNazwa]);
  8140.         DOF2_SetInt(file,       "Wartosc1", Przedmiot[nr][iWartosc1]);
  8141.         DOF2_SetInt(file,       "Wartosc2", Przedmiot[nr][iWartosc2]);
  8142.         DOF2_SetInt(file,       "Wartosc3", Przedmiot[nr][iWartosc3]);
  8143.         DOF2_SetInt(file,       "Typ",      Przedmiot[nr][iTyp]);
  8144.         DOF2_SetInt(file,       "Owner",    Przedmiot[nr][iOwner]);
  8145.         DOF2_SetInt(file,       "OwnerUID", Przedmiot[nr][iOwnerUID]);
  8146.         DOF2_SetInt(file,       "Used",     Przedmiot[nr][iUsed]);
  8147.         DOF2_SetInt(file,       "Waga",     Przedmiot[nr][iWaga]);
  8148.         DOF2_SetInt(file,       "Vir",      Przedmiot[nr][iVir]);
  8149.         DOF2_SetFloat(file,     "PosX",     Przedmiot[nr][iPosX]);
  8150.         DOF2_SetFloat(file,     "PosY",     Przedmiot[nr][iPosY]);
  8151.         DOF2_SetFloat(file,     "PosZ",     Przedmiot[nr][iPosZ]);
  8152.         DOF2_SetFloat(file,     "RotX",     Przedmiot[nr][iRotX]);
  8153.         DOF2_SetInt(file,       "Flaga",    Przedmiot[nr][iFlaga]);
  8154.         DOF2_SetInt(file,       "FlagaUID", Przedmiot[nr][iFlagaUID]);
  8155.         DOF2_SetInt(file,       "Cena",     Przedmiot[nr][iPrice]);
  8156.         DOF2_SetInt(file,       "Premium",  Przedmiot[nr][iPremiumPrice]);
  8157.         DOF2_SaveFile();
  8158.     }
  8159.     else
  8160.     {
  8161.         DOF2_CreateFile(file);
  8162.         DOF2_SetInt(file,       "Aktywny",  Przedmiot[nr][iAktywny]);
  8163.         DOF2_SetString(file,    "Nazwa",    Przedmiot[nr][iNazwa]);
  8164.         DOF2_SetInt(file,       "Wartosc1", Przedmiot[nr][iWartosc1]);
  8165.         DOF2_SetInt(file,       "Wartosc2", Przedmiot[nr][iWartosc2]);
  8166.         DOF2_SetInt(file,       "Wartosc3", Przedmiot[nr][iWartosc3]);
  8167.         DOF2_SetInt(file,       "Typ",      Przedmiot[nr][iTyp]);
  8168.         DOF2_SetInt(file,       "Owner",    Przedmiot[nr][iOwner]);
  8169.         DOF2_SetInt(file,       "OwnerUID", Przedmiot[nr][iOwnerUID]);
  8170.         DOF2_SetInt(file,       "Used",     Przedmiot[nr][iUsed]);
  8171.         DOF2_SetInt(file,       "Waga",     Przedmiot[nr][iWaga]);
  8172.         DOF2_SetInt(file,       "Vir",      Przedmiot[nr][iVir]);
  8173.         DOF2_SetFloat(file,     "PosX",     Przedmiot[nr][iPosX]);
  8174.         DOF2_SetFloat(file,     "PosY",     Przedmiot[nr][iPosY]);
  8175.         DOF2_SetFloat(file,     "PosZ",     Przedmiot[nr][iPosZ]);
  8176.         DOF2_SetFloat(file,     "RotX",     Przedmiot[nr][iRotX]);
  8177.         DOF2_SetInt(file,       "Flaga",    Przedmiot[nr][iFlaga]);
  8178.         DOF2_SetInt(file,       "FlagaUID", Przedmiot[nr][iFlagaUID]);
  8179.         DOF2_SetInt(file,       "Cena",     Przedmiot[nr][iPrice]);
  8180.         DOF2_SetInt(file,       "Premium",  Przedmiot[nr][iPremiumPrice]);
  8181.         DOF2_SaveFile();
  8182.     }
  8183.     return 1;
  8184. }
  8185.  
  8186.  
  8187. Funkcja::Wczytaj_Grupy()
  8188. {
  8189.     new file[40];
  8190.     for(new nr = 0; nr < MAX_GRUPY; nr++)
  8191.     {
  8192.         format(file,sizeof(file),"Grupy/%d.ini",nr);
  8193.         if(DOF2_FileExists(file))
  8194.         {
  8195.             Grupa[nr][gAktywna]     = DOF2_GetInt(file,     "Aktywna");
  8196.             Grupa[nr][gOwner]       = DOF2_GetInt(file,     "Owner");
  8197.             Grupa[nr][gPunkty]      = DOF2_GetInt(file,     "Punkty");
  8198.             Grupa[nr][gPayDay]      = DOF2_GetInt(file,     "PayDay");
  8199.             Grupa[nr][gTyp]         = DOF2_GetInt(file,     "Typ");
  8200.             Grupa[nr][gNazwa]       = DOF2_GetString(file,  "Nazwa");
  8201.             Grupa[nr][gTag]         = DOF2_GetString(file,  "Tag");
  8202.             Grupa[nr][gBank]        = DOF2_GetInt(file,     "Bank");
  8203.             Grupa[nr][gWirCash]     = DOF2_GetInt(file,     "Premium");
  8204.             Grupa[nr][gKolor]       = DOF2_GetInt(file,     "Kolor");
  8205.             Grupa[nr][gKolorZone]   = DOF2_GetInt(file,     "KolorZone");
  8206.             //flagi
  8207.             Grupa[nr][gFlagPerm]    = DOF2_GetInt(file,     "FlagPerm");
  8208.             //limit pojazdów zespawnowanych
  8209.             Grupa[nr][gVehLimit]    = DOF2_GetInt(file,     "VehLimit");
  8210. /*          new query[128];
  8211.             format(query, sizeof(query), "INSERT INTO `1grupy` (`aktywna`,`owner`,`saldo`,`dotacja`,`czlonkowie`,`tag`,`nazwa`) VALUES (%d, %d, %d, %d, %d, '%s', '%s')"\
  8212.             , Grupa[nr][gAktywna], Grupa[nr][gOwner], Grupa[nr][gBank], Grupa[nr][gPayDay], 0, Grupa[nr][gTag], Grupa[nr][gNazwa]);
  8213.             mysql_query_ex(query); */
  8214.             Grupa[nr][gVehLimitSpawn] = 0;
  8215.             if(Grupa[nr][gAktywna] == 1)
  8216.             {
  8217.                 StatsGroup++;
  8218.                 ZapiszGrupe(nr);
  8219.             }
  8220.         }
  8221.         else
  8222.         {
  8223.             Grupa[nr][gAktywna] = 0;
  8224.         }
  8225.     }
  8226.     return 1;
  8227. }
  8228.  
  8229. Funkcja::ZapiszGrupe(nr)
  8230. {
  8231.     if(nr < 0 || nr > MAX_GRUPY) return 1;
  8232.     new file[40];
  8233.     format(file,sizeof(file),"Grupy/%d.ini",nr);
  8234.     if(DOF2_FileExists(file))
  8235.     {
  8236.         DOF2_SetInt(file,       "Aktywna",  Grupa[nr][gAktywna]);
  8237.         DOF2_SetInt(file,       "Owner",    Grupa[nr][gOwner]);
  8238.         DOF2_SetInt(file,       "Punkty",   Grupa[nr][gPunkty]);
  8239.         DOF2_SetInt(file,       "PayDay",   Grupa[nr][gPayDay]);
  8240.         DOF2_SetInt(file,       "Typ",      Grupa[nr][gTyp]);
  8241.         DOF2_SetString(file,    "Nazwa",    Grupa[nr][gNazwa]);
  8242.         DOF2_SetString(file,    "Tag",      Grupa[nr][gTag]);
  8243.         DOF2_SetInt(file,       "Bank",     Grupa[nr][gBank]);
  8244.         DOF2_SetInt(file,       "Premium",  Grupa[nr][gWirCash]);
  8245.         DOF2_SetInt(file,       "Kolor",    Grupa[nr][gKolor]);
  8246.         DOF2_SetInt(file,       "KolorZone", Grupa[nr][gKolorZone]);
  8247.         //flagi
  8248.         DOF2_SetInt(file,       "FlagPerm", Grupa[nr][gFlagPerm]);
  8249.         //limit pojazdów zespawnowanych
  8250.         DOF2_SetInt(file,       "VehLimit", Grupa[nr][gVehLimit]);
  8251.         DOF2_SaveFile();
  8252.     }
  8253.     else
  8254.     {
  8255.         DOF2_CreateFile(file);
  8256.         DOF2_SetInt(file,       "Aktywna",  Grupa[nr][gAktywna]);
  8257.         DOF2_SetInt(file,       "Owner",    Grupa[nr][gOwner]);
  8258.         DOF2_SetInt(file,       "Punkty",   Grupa[nr][gPunkty]);
  8259.         DOF2_SetInt(file,       "PayDay",   Grupa[nr][gPayDay]);
  8260.         DOF2_SetInt(file,       "Typ",      Grupa[nr][gTyp]);
  8261.         DOF2_SetString(file,    "Nazwa",    Grupa[nr][gNazwa]);
  8262.         DOF2_SetString(file,    "Tag",      Grupa[nr][gTag]);
  8263.         DOF2_SetInt(file,       "Bank",     Grupa[nr][gBank]);
  8264.         DOF2_SetInt(file,       "Premium",  Grupa[nr][gWirCash]);
  8265.         DOF2_SetInt(file,       "Kolor",    Grupa[nr][gKolor]);
  8266.         DOF2_SetInt(file,       "KolorZone", Grupa[nr][gKolorZone]);
  8267.         //flagi
  8268.         DOF2_SetInt(file,       "FlagPerm", Grupa[nr][gFlagPerm]);
  8269.         //limit pojazdów zespawnowanych
  8270.         DOF2_SetInt(file,       "VehLimit", Grupa[nr][gVehLimit]);
  8271.         DOF2_SaveFile();
  8272.     }
  8273.     return 1;
  8274. }
  8275.  
  8276. Funkcja::Wczytaj_Strefy()
  8277. {
  8278.     new file[40];
  8279.     for(new g = 1; g < MAX_GANG_ZONES; g++)
  8280.     {
  8281.         format(file, sizeof(file),"Strefy/%d.ini", g);
  8282.         if(DOF2_FileExists(file))
  8283.         {
  8284.             GangZoneInfo[g][gAktywna]   =   DOF2_GetInt(file,   "Aktywna");
  8285.             GangZoneInfo[g][gMinX]      =   DOF2_GetFloat(file, "MinX");
  8286.             GangZoneInfo[g][gMinY]      =   DOF2_GetFloat(file, "MinY");
  8287.             GangZoneInfo[g][gMaxX]      =   DOF2_GetFloat(file, "MaxX");
  8288.             GangZoneInfo[g][gMaxY]      =   DOF2_GetFloat(file, "MaxY");
  8289.             GangZoneInfo[g][gColor]     =   DOF2_GetInt(file,   "Color");
  8290.             GangZoneInfo[g][gOwner]     =   DOF2_GetInt(file,   "Owner");
  8291.             GangZoneInfo[g][gOwnerUID]  =   DOF2_GetInt(file,   "OwnerUID");
  8292.             GangZoneInfo[g][gNazwa]     =   DOF2_GetString(file, "Nazwa");
  8293.             GangZoneInfo[g][gSpeed]     =   DOF2_GetInt(file,   "Speed");
  8294.             if(GangZoneInfo[g][gAktywna] == 1)
  8295.             {
  8296.                 StatsZone++;
  8297.                 GangZone[g] = GangZoneCreate(GangZoneInfo[g][gMinX], GangZoneInfo[g][gMinY], GangZoneInfo[g][gMaxX], GangZoneInfo[g][gMaxY]);
  8298.             }
  8299.             if(GroupDoorInArea(GangZoneInfo[g][gOwnerUID], g) < 2)
  8300.             {
  8301.                 GangZoneInfo[g][gOwner]         = 0;
  8302.                 GangZoneInfo[g][gOwnerUID]      = 0;
  8303.                 //printf("[zone] Strefa %d została zwolniona.", g), Zapisz_Strefe(g);
  8304.             }
  8305.  
  8306.         }
  8307.     }
  8308.     return 1;
  8309. }
  8310.  
  8311. Funkcja::Zapisz_Strefe(id)
  8312. {
  8313.     if(id < 0 || id > MAX_GANG_ZONES) return 1;
  8314.     new file[40];
  8315.     format(file, sizeof(file), "Strefy/%d.ini", id);
  8316.     if(DOF2_FileExists(file))
  8317.     {
  8318.         DOF2_SetInt(file,       "Aktywna",  GangZoneInfo[id][gAktywna]);
  8319.         DOF2_SetFloat(file,     "MinX",     GangZoneInfo[id][gMinX]);
  8320.         DOF2_SetFloat(file,     "MinY",     GangZoneInfo[id][gMinY]);
  8321.         DOF2_SetFloat(file,     "MaxX",     GangZoneInfo[id][gMaxX]);
  8322.         DOF2_SetFloat(file,     "MaxY",     GangZoneInfo[id][gMaxY]);
  8323.         DOF2_SetInt(file,       "Color",    GangZoneInfo[id][gColor]);
  8324.         DOF2_SetInt(file,       "Owner",    GangZoneInfo[id][gOwner]);
  8325.         DOF2_SetInt(file,       "OwnerUID", GangZoneInfo[id][gOwnerUID]);
  8326.         DOF2_SetString(file,    "Nazwa",    GangZoneInfo[id][gNazwa]);
  8327.         DOF2_SetInt(file,       "Speed",    GangZoneInfo[id][gSpeed]);
  8328.         DOF2_SaveFile();
  8329.     }
  8330.     else
  8331.     {
  8332.         DOF2_CreateFile(file);
  8333.         DOF2_SetInt(file,       "Aktywna",  GangZoneInfo[id][gAktywna]);
  8334.         DOF2_SetFloat(file,     "MinX",     GangZoneInfo[id][gMinX]);
  8335.         DOF2_SetFloat(file,     "MinY",     GangZoneInfo[id][gMinY]);
  8336.         DOF2_SetFloat(file,     "MaxX",     GangZoneInfo[id][gMaxX]);
  8337.         DOF2_SetFloat(file,     "MaxY",     GangZoneInfo[id][gMaxY]);
  8338.         DOF2_SetInt(file,       "Color",    GangZoneInfo[id][gColor]);
  8339.         DOF2_SetInt(file,       "Owner",    GangZoneInfo[id][gOwner]);
  8340.         DOF2_SetInt(file,       "OwnerUID", GangZoneInfo[id][gOwnerUID]);
  8341.         DOF2_SetString(file,    "Nazwa",    GangZoneInfo[id][gNazwa]);
  8342.         DOF2_SetInt(file,       "Speed",    GangZoneInfo[id][gSpeed]);
  8343.         DOF2_SaveFile();
  8344.     }
  8345.     return 1;
  8346. }
  8347.  
  8348. //other
  8349.  
  8350. Funkcja::IsPlayerLogged(playerid)
  8351. {
  8352.     new login = 0;
  8353.     if(Login(playerid) == 1)
  8354.     {
  8355.         login = 1;
  8356.     }
  8357.     return login;
  8358. }
  8359.  
  8360. Funkcja::NoLogin(playerid)
  8361.     return InfoBoxShow(2, playerid, "~w~Nieznaleziono gracza po podanym ~y~ID~w~.~n~Prawdopodobnie nie jest zalogowany na serwer.", 3);
  8362.  
  8363. Funkcja::GiftImage(playerid)
  8364. {
  8365.     Data();
  8366.     format(String, sizeof(String), "SA:MP ~w~RolePlay, %02d.%02d", Dzien, Miesiac);
  8367.     TextDrawSetString(TDData, String);
  8368.     TextDrawShowForPlayer(playerid, TDData);
  8369.     TextDrawShowForPlayer(playerid, PasekSanNews[playerid]);
  8370.     TextDrawHideForPlayer(playerid, ImagenGift);
  8371.     TextDrawSetString(ImagenGift, ImagesGift[random(sizeof(ImagesGift))]);
  8372.     TextDrawShowForPlayer(playerid, ImagenGift);
  8373.     return 1;
  8374. }
  8375.  
  8376. Funkcja::SetEngine(vehicleid, playerid, silnik)
  8377. {
  8378.     if(GetPVarInt(playerid, "Odpala") == 1)
  8379.     {
  8380.         SetPVarInt(playerid, "Odpala", 0);
  8381.         GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  8382.         if(silnik == 1)
  8383.         {
  8384.             SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
  8385.             InfoBoxShow(2, playerid, "Silnik ~y~pojazdu~w~ zostal ~g~uruchomiony~w~.", 3);
  8386.         }
  8387.         else
  8388.         {
  8389.             SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
  8390.             InfoBoxShow(2, playerid, "Silnik ~y~pojazdu~w~ zostal ~r~wylaczony~w~.", 3);
  8391.         }
  8392.     }
  8393.     return 1;
  8394. }
  8395.  
  8396. Funkcja::mysql_query_ex(query[])
  8397. {
  8398.     return mysql_query(query);
  8399. }
  8400.  
  8401. Funkcja::AntyCheatLog(dir[], string[])
  8402. {
  8403.     new File:plik, h, m, s, day, month, year, date[64];
  8404.     gettime(h, m, s);
  8405.     getdate(day, month, year);
  8406.     format(date, sizeof(date), "%d-%d-%d", day, month, year);
  8407.     format(LogData, sizeof(LogData), "Logi/%s/%s.log", dir, date);
  8408.     if(DOF2_FileExists(LogData))
  8409.     {
  8410.         plik = fopen(LogData, io_append);
  8411.         if (plik)
  8412.         {
  8413.             format(LogStr, sizeof(LogStr), "\n[%02d:%02d:%02d] %s", h+1, m, s, string);
  8414.             fwrite(plik, LogStr);
  8415.             fclose(plik);
  8416.         }
  8417.     }
  8418.     else
  8419.     {
  8420.         DOF2_CreateFile(LogData);
  8421.         plik = fopen(LogData, io_append);
  8422.         if (plik)
  8423.         {
  8424.             format(LogStr, sizeof(LogStr), "\n[%02d:%02d:%02d] %s", h+1, m, s, string);
  8425.             fwrite(plik, LogStr);
  8426.             fclose(plik);
  8427.         }
  8428.     }
  8429.     return 1;
  8430. }
  8431.  
  8432. LoadNPC(name[], file[])
  8433. {
  8434.     ConnectNPC(name, file);
  8435.     return printf("Wczytano postać NPC %s z pliku %s.", name, file);
  8436. }
  8437.  
  8438. GroupSlot(playerid, groupUID)
  8439. {
  8440.     new slot = 0;
  8441.     if(pGrupa[playerid][1] == groupUID)
  8442.         slot = 1;
  8443.     if(pGrupa[playerid][2] == groupUID)
  8444.         slot = 2;
  8445.     if(pGrupa[playerid][3] == groupUID)
  8446.         slot = 3;
  8447.     if(pGrupa[playerid][4] == groupUID)
  8448.         slot = 4;
  8449.     if(pGrupa[playerid][5] == groupUID)
  8450.         slot = 5;
  8451.     return slot;
  8452. }
  8453. //Komendy administratora
  8454.  
  8455. CMD:brama(playerid, params[])
  8456. {
  8457.     new range = 0;
  8458.  
  8459.     if(IsPlayerInAnyVehicle(playerid)) range = 10;
  8460.     else range = 5;
  8461.  
  8462.     for(new o = 0; o < MAX_OBIEKT; o++)
  8463.     {
  8464.         if(Obiekt[o][oGate] == 1)
  8465.         {
  8466.             if(GetPlayerVirtualWorld(playerid) == 0)
  8467.             {
  8468.                 if(GangZoneInfo[PlayerInZone(playerid)][gOwner] == 0 || GangZoneInfo[PlayerInZone(playerid)][gOwner] == OWNER_GROUP && GrupaSlot(playerid, GangZoneInfo[PlayerInZone(playerid)][gOwnerUID]) == 0)
  8469.                 {
  8470.                     return Info(playerid, "Nie posiadasz uprawnień do zarządzania tą bramą.");
  8471.                 }
  8472.             }
  8473.             else
  8474.             {
  8475.                 if(pDrzwi(playerid, InDoor(playerid)) == 0)
  8476.                     return Info(playerid, "Nie posiadasz uprawnień do zarządzania tą bramą.");
  8477.             }
  8478.             if(IsPlayerInRangeOfPoint(playerid, range, Obiekt[o][oPosX], Obiekt[o][oPosY], Obiekt[o][oPosZ]) || IsPlayerInRangeOfPoint(playerid, range, Obiekt[o][oGateX], Obiekt[o][oGateY], Obiekt[o][oGateZ]))
  8479.             {
  8480.                 if(Obiekt[o][oGateStatus] == 0)
  8481.                 {
  8482.                     Obiekt[o][oGateStatus] = 1;
  8483.                     MoveDynamicObject(MapObiekt[o], Obiekt[o][oGateX], Obiekt[o][oGateY], Obiekt[o][oGateZ], 1, Obiekt[o][oGateRotX], Obiekt[o][oGateRotY], Obiekt[o][oGateRotZ]);
  8484.                 }
  8485.                 else
  8486.                 {
  8487.                     Obiekt[o][oGateStatus] = 0;
  8488.                     MoveDynamicObject(MapObiekt[o], Obiekt[o][oPosX], Obiekt[o][oPosY], Obiekt[o][oPosZ], 1, Obiekt[o][oRotX], Obiekt[o][oRotY], Obiekt[o][oRotZ]);
  8489.                 }
  8490.                 break;
  8491.             }
  8492.         }
  8493.         if(o == MAX_OBIEKT - 1)
  8494.             return Info(playerid, "W pobliżu nie ma żadnej bramy.");
  8495.     }
  8496.     return 1;
  8497. }
  8498.  
  8499. CMD:area(playerid, params[])
  8500. {
  8501.     if(PlayerInZone(playerid) == 0)
  8502.         return Info(playerid, "Aktualnie nie znajdujesz się w żadnej ze stref.");
  8503.     new title[64], zone = PlayerInZone(playerid), info[1024];
  8504.     SetPVarInt(playerid, "rpAreaZone", PlayerInZone(playerid));
  8505.     format(title, 64, "{AAC5E3}Area: %d (%s, %dkm/h)", zone, GangZoneInfo[zone][gNazwa], GangZoneInfo[zone][gSpeed]);
  8506.     if(GangZoneInfo[zone][gOwner] == 2 && Grupa[GangZoneInfo[zone][gOwnerUID]][gAktywna] == 1)
  8507.     {
  8508.         strcat(info, "1\tPokaż informacje o strefie\n", sizeof(info));
  8509.         if((pGrupaPerm[playerid][GrupaSlot(playerid, GangZoneInfo[zone][gOwnerUID])] & PERM_LEADER))
  8510.         {
  8511.             strcat(info, "3\tWidoczność strefy\n", sizeof(info));
  8512.         }
  8513.     }
  8514.     else
  8515.     {
  8516.         strcat(info, "1\tPokaż informacje o strefie\n", sizeof(info));
  8517.         strcat(info, "2\tPrzejmij strefę\n", sizeof(info));
  8518.     }
  8519.     if((Player[playerid][pAdmin] & ADMIN_PERM_ZONE))
  8520.     {
  8521.         strcat(info, "----\n", sizeof(info));
  8522.         strcat(info, "4\tUstaw limit prędkości dla pojazdów\n", sizeof(info));
  8523.         strcat(info, "5\tSkasuj obiekty znajdujące się na strefie\n", sizeof(info));
  8524.         strcat(info, "6\tWyświetl budynki, które zostały utworzone na terenie strefy\n", sizeof(info));
  8525.         strcat(info, "7\tUstal koszt utworzenia nowego budynku\n", sizeof(info));
  8526.         strcat(info, "8\tMożliwość parkowania pojazdów\n", sizeof(info));
  8527.         if(GangZoneInfo[zone][gOwner] == OWNER_GROUP)
  8528.         {
  8529.             strcat(info, "9\tUsuń dotychczasowego ownera\n", sizeof(info));
  8530.         }
  8531.         else
  8532.         {
  8533.             strcat(info, "10\tUstal nową grupę jako ownera\n", sizeof(info));
  8534.         }
  8535.     }
  8536.     return dShowPlayerDialog(playerid, 300, DIALOG_STYLE_LIST, title, info, "Wybierz", "Anuluj");
  8537. }
  8538.  
  8539. CMD:area2(playerid, params[])
  8540. {
  8541.     GangZoneInfo[PlayerInZone(playerid)][gSpeed]    = 75;
  8542.     return 1;
  8543. }
  8544.  
  8545. CMD:strefa(playerid, params[])
  8546. {
  8547.     if((Player[playerid][pAdmin] & ADMIN_PERM_ZONE))
  8548.     {
  8549.         new sub[80],rest[80], zone_id;
  8550.         if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/strefa [stworz, edytuj, kolor, usun]");
  8551.         if(!strcmp(sub, "stworz", true))
  8552.         {
  8553.             new Float:zone_x, Float:zone_y, Float:Pos[3], name[32];
  8554.             if(sscanf(rest, "ff", zone_x, zone_y))
  8555.                 return Tip(playerid, "/strefa stworz [MaxX] [MaxY]");
  8556.             GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  8557.             for(new g = 1; g < MAX_GANG_ZONES; g++)
  8558.             {
  8559.                 new file[40];
  8560.                 format(file, sizeof(file), "Strefy/%d.ini", g);
  8561.                 if(GangZoneInfo[g][gAktywna] == 0 && !DOF2_FileExists(file))
  8562.                 {
  8563.                     TogglePlayerControllable(playerid, false);
  8564.  
  8565.                     GangZoneInfo[g][gAktywna]   =   1;
  8566.                     GangZoneInfo[g][gMinX]      =   Pos[0];
  8567.                     GangZoneInfo[g][gMinY]      =   Pos[1];
  8568.                     GangZoneInfo[g][gMaxX]      =   Pos[0] + zone_x;
  8569.                     GangZoneInfo[g][gMaxY]      =   Pos[1] + zone_y;
  8570.                     GangZoneInfo[g][gColor]     =   -1;
  8571.                     GangZoneInfo[g][gOwner]     =   OWNER_GROUP;
  8572.                     GangZoneInfo[g][gOwnerUID]  =   1;
  8573.  
  8574.                     SetPlayerPos(playerid, GangZoneInfo[g][gMinX], GangZoneInfo[g][gMaxY], 50.0);
  8575.  
  8576.                     GangZone[g]     =   GangZoneCreate(GangZoneInfo[g][gMinX], GangZoneInfo[g][gMinY], GangZoneInfo[g][gMaxX], GangZoneInfo[g][gMaxY]);
  8577.                     GangZoneShowForPlayer(playerid, GangZone[g], 0xC7EAF8BB);
  8578.                     format(String, sizeof(String), "X: %.0f, Y: %.0f", GangZoneInfo[g][gMinX], GangZoneInfo[g][gMinY]);
  8579.  
  8580.                     format(name, sizeof(name), "%.0fx%.0f", zone_x, zone_y), Tip(playerid, String);
  8581.                     strmid(GangZoneInfo[g][gNazwa],  name, 0, 64, 64);
  8582.                     format(String, sizeof(String), "Utworzona została nowa strefa (UID: %d) o wymiarach %.0fx%.0f", g, zone_x, zone_y), Info(playerid, String);
  8583.                     Zapisz_Strefe(g);
  8584.                     break;
  8585.                 }
  8586.  
  8587.             }
  8588.             return 1;
  8589.         }
  8590.         else if(!strcmp(sub, "usun", true))
  8591.         {
  8592.             if(sscanf(rest, "d", zone_id))
  8593.                 return Tip(playerid, "/strefa usun [ID]");
  8594.             if(GangZoneInfo[zone_id][gAktywna] == 0)
  8595.                 return Tip(playerid, "Strefa nie jest aktywna.");
  8596.             GangZoneInfo[zone_id][gAktywna] = 0;
  8597.             return Zapisz_Strefe(zone_id), format(String, sizeof(String), "Strefa (UID: %d) została pomyślnie usunięta.", zone_id), Info(playerid, String);
  8598.         }
  8599.         else if(!strcmp(sub, "kolor", true))
  8600.         {
  8601.             new zone_color[6], text[10];
  8602.             if(sscanf(rest, "ds[6]", zone_id, zone_color))
  8603.                 return Tip(playerid, "/strefa kolor [ID] [RRGGBB]");
  8604.             format(text, sizeof(text), "0x%sBB", zone_color);
  8605.             GangZoneInfo[zone_id][gColor] = hexstring(text);
  8606.             GangZoneHideForAll(zone_id);
  8607.             GangZoneShowForPlayer(playerid, zone_id, GangZoneInfo[zone_id][gColor]);
  8608.             return Zapisz_Strefe(zone_id), format(String, sizeof(String), "Strefa (UID: %d) została pomyślnie zmodyfikowana.", zone_id), Info(playerid, String);
  8609.         }
  8610.         return 1;
  8611.     }
  8612.     return 1;
  8613. }
  8614.  
  8615. CMD:opis(playerid, params[])
  8616. {
  8617.     new desc[128];
  8618.     if(sscanf(params, "s[128]", desc))
  8619.         return Tip(playerid, "/opis [usun, treść opisu]");
  8620.     if(!strcmp(params, "usun"))
  8621.     {
  8622.         if(GetPVarInt(playerid, "rpOpis") == 0)
  8623.             return Tip(playerid, "Nie utworzyłeś jeszcze żadnego opisu.");
  8624.         return UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pOpis], COLOR_DESC, " "), SetPVarInt(playerid, "rpOpis", 0), Tip(playerid, "Opis został usunięty.");
  8625.     }
  8626.     if(strlen(desc) > 120 || strlen(desc) < 30)
  8627.         return Info(playerid, "Opis powinien mieć od 30 do 120 znaków.");
  8628.     UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pOpis], COLOR_DESC, WordWrap(desc, 5)), SetPVarInt(playerid, "rpOpis", 1), Info(playerid, WordWrap(desc, 5));
  8629.     return 1;
  8630. }
  8631.  
  8632. CMD:zamow(playerid, params[])
  8633. {
  8634.     if(Sluzba(playerid) == 0)
  8635.         return Info(playerid, "Wejdź na służbę grupy, dla której chcesz zamówić produkty.\nW przeciwnym razie nie możesz skorzytać opcji zamawiania.");
  8636.     if(Drzwi[InDoor(playerid)][dOwner] == 2)
  8637.     {
  8638.         if(Drzwi[InDoor(playerid)][dOwnerUID] != Sluzba(playerid))
  8639.             return Info(playerid, "Musisz znajdować się w budynku, który należy do grupy, dla której chcesz zamówić produkty.");
  8640.     }
  8641.     else
  8642.     {
  8643.         return Info(playerid, "Musisz znajdować się w budynku, który należy do grupy, dla której chcesz zamówić produkty.");
  8644.     }
  8645.     return ShowOrderCat(playerid);
  8646. }
  8647.  
  8648. CMD:pogoda(playerid, params[])
  8649. {
  8650.     new pogoda = 0;
  8651.     if(sscanf(params, "d", pogoda))
  8652.         return Tip(playerid, "/pogoda [identyfiaktor]");
  8653.     return SetWeather(pogoda);
  8654. }
  8655.  
  8656. CMD:ac(playerid, params[])
  8657. {
  8658.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_CHAT))
  8659.         return Info(playerid, "Brak uprawnień do korzystania z tej komendy.");
  8660.     new text[128], wiadomosc[128];
  8661.     if(sscanf(params, "s[100]", text))
  8662.         return Tip(playerid, "/ac [wiadomość]");
  8663.     foreach(Player, p)
  8664.     {
  8665.         if((Player[p][pAdmin] & ADMIN_PERM_CHAT))
  8666.         {
  8667.             format(wiadomosc, sizeof(wiadomosc), "{BB0000}%s [%d]{EEE8AA}", CharName(playerid), playerid);
  8668.             format(String, sizeof(String), "(( %s: %s ))", wiadomosc, text);
  8669.             SendClientMessage(p, 0xEEE8AAFF, String);
  8670.         }
  8671.     }
  8672.     return 1;//
  8673. }
  8674.  
  8675. CMD:aduty(playerid, params[])
  8676. {
  8677.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8678.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8679.     if(Status(playerid) == 2)//Zejście ze służby
  8680.     {
  8681.         Info(playerid, "Kończysz służbę Administratora / GameMastera.");
  8682.         return setStatus(playerid, 0);
  8683.     }
  8684.     Info(playerid, "Rozpoczynasz służbę Administratora / GameMastera.");
  8685.     return setStatus(playerid, 2);
  8686. }
  8687.  
  8688. CMD:spec(playerid, params[])
  8689. {
  8690.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8691.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8692.     new gracz;
  8693.     if(sscanf(params, "u", gracz))
  8694.     {
  8695.         if(GetPVarInt(playerid, "rpSpec") != INVALID_PLAYER_ID)
  8696.         {
  8697.             SetPVarInt(playerid, "rpSpec", INVALID_PLAYER_ID);
  8698.             InfoBoxShow(2, playerid, "Podglad ~y~gracza~r~ anulowany~w~.", 3);
  8699.             TogglePlayerSpectating(playerid, false);
  8700.             return SpawnPlayer(playerid);
  8701.         }
  8702.         return Tip(playerid, "/spec [gracz]");
  8703.     }
  8704.     if(IsPlayerLogged(gracz) == 0 || gracz == playerid) return NoLogin(playerid);
  8705.     TogglePlayerSpectating(playerid, true);
  8706.     SetPVarInt(playerid, "rpSpec", gracz);
  8707.     InfoBoxShow(2, playerid, "Podglad gracza jest teraz ~y~aktywny~w~.~n~~n~Uzywaj klawiszy ~r~LALT~w~ oraz ~r~LSHIFT~w~, aby swobodne ~g~przeskakiwac~w~ miedzy graczami.", 180);
  8708.     if(IsPlayerInAnyVehicle(gracz))
  8709.     {
  8710.         PlayerSpectateVehicle(playerid, GetPlayerVehicleID(gracz));
  8711.     }
  8712.     else
  8713.     {
  8714.         PlayerSpectatePlayer(playerid, gracz);
  8715.     }
  8716.     return 1;
  8717. }
  8718.  
  8719. CMD:bw(playerid, params[])
  8720. {
  8721.     new gracz;
  8722.     if(sscanf(params, "u", gracz))
  8723.         return Tip(playerid, "/bw [gracz]");
  8724.     if(Player[gracz][pBW] == 0)
  8725.     {
  8726.         Player[gracz][pBW] = TIME_BW;
  8727.     }
  8728.     else
  8729.     {
  8730.         Player[gracz][pBW] = 0;
  8731.         TogglePlayerControllable(gracz, true);
  8732.         setHP(gracz, 100);
  8733.         SetCameraBehindPlayer(gracz);
  8734.     }
  8735.     return 1;
  8736. }
  8737.  
  8738. CMD:kick(playerid, params[])
  8739. {
  8740.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8741.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8742.     new gracz, powod[64];
  8743.     if(sscanf(params, "us[64]", gracz, powod))
  8744.         return Tip(playerid, "/kick [gracz] [powód]");
  8745.     if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  8746.     return Kara(0, gracz, playerid, powod, 0);
  8747. }
  8748.  
  8749. CMD:warn(playerid, params[])
  8750. {
  8751.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8752.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8753.     new gracz, powod[64];
  8754.     if(sscanf(params, "us[64]", gracz, powod))
  8755.         return Tip(playerid, "/warn [gracz] [powód]");
  8756.     if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  8757.     return Kara(1, gracz, playerid, powod, 0);
  8758. }
  8759.  
  8760. CMD:gs(playerid, params[])
  8761.     return cmd_gamescore(playerid, params);
  8762.  
  8763. CMD:gamescore(playerid, params[])
  8764. {
  8765.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8766.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8767.     new gracz, powod[64], gs;
  8768.     if(sscanf(params, "uds[64]", gracz, gs, powod))
  8769.         return Tip(playerid, "/gamescore [gracz] [ilosc] [powód]");
  8770.     if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  8771.     IPB[gracz][ipb_GameScore] += gs;
  8772.     return Kara(8, gracz, playerid, powod, 0);
  8773. }
  8774.  
  8775. CMD:gmx(playerid, params[])
  8776. {
  8777.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_MAX))
  8778.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8779.     for(new nr = 0; nr < MAX_OBIEKT; nr++){
  8780.             if(Obiekt[nr][oAktywny] == 1){
  8781.                 ZapiszObiekt(nr);
  8782.             }
  8783.     }
  8784.     for(new nr = 0; nr < MAX_ITEM; nr++){
  8785.             if(Przedmiot[nr][iAktywny] == 1){
  8786.                 ZapiszPrzedmiot(nr);
  8787.                 if(Przedmiot[nr][iTyp] == 1 && Przedmiot[nr][iUsed] == 1)
  8788.                 {
  8789.                     Przedmiot[nr][iUsed] = 0;
  8790.                 }
  8791.             }
  8792.     }
  8793.     for(new nr = 0; nr < MAX_GRUPY; nr++){
  8794.             if(Grupa[nr][gAktywna] == 1){
  8795.                 ZapiszGrupe(nr);
  8796.             }
  8797.     }
  8798.     foreach(Player, p)
  8799.     {
  8800.             if(Login(p) == 1)
  8801.             {
  8802.                 Global_Data_Save(p);
  8803.                 SavePlayerStats(p, SAVE_PLAYER_BASIC);
  8804.                 SavePlayerStats(p, SAVE_PLAYER_POS);
  8805.                 SavePlayerStats(p, SAVE_PLAYER_GROUP);
  8806.                 OnPlayerDisconnect(p, 0);
  8807.             }
  8808.     }
  8809.     //dostarczanie produktów
  8810.     for(new p = 0; p < MAX_ITEM; p++)
  8811.     {
  8812.         if(Paczka[p][pAktywna] == 1)
  8813.         {
  8814.             new powtorzenia = 0;
  8815.             for(new nr = 1; nr < MAX_ITEM; nr++)
  8816.             {
  8817.                 if(Przedmiot[nr][iAktywny] == 0)
  8818.                 {
  8819.                     Przedmiot[nr][iAktywny]     = 1;
  8820.                     Przedmiot[nr][iTyp]         = Paczka[p][pTyp];
  8821.                     Przedmiot[nr][iWartosc1]    = Paczka[p][pValue1];
  8822.                     Przedmiot[nr][iWartosc2]    = Paczka[p][pValue2];
  8823.                     Przedmiot[nr][iWartosc3]    = Paczka[p][pValue3];
  8824.                     Przedmiot[nr][iOwner]       = Paczka[p][pOwner];
  8825.                     Przedmiot[nr][iOwnerUID]    = Paczka[p][pOwnerUID];
  8826.                     Przedmiot[nr][iWaga]        = Paczka[p][pWaga];
  8827.                     Przedmiot[nr][iUsed]        = 0;
  8828.                     Przedmiot[nr][iVir]         = 0;
  8829.                     Przedmiot[nr][iPrice]       = Paczka[p][pPrice];
  8830.                     Przedmiot[nr][iFlaga]       = Paczka[p][pFlaga];
  8831.                     Przedmiot[nr][iFlagaUID]    = Paczka[p][pFlagaUID];
  8832.                     strmid(Przedmiot[nr][iNazwa],  Paczka[p][pNazwa], 0, 64, 64);
  8833.                     ZapiszPrzedmiot(nr);
  8834.                     powtorzenia++;
  8835.                     if(powtorzenia == Paczka[p][pIlosc])
  8836.                     {
  8837.                         break;
  8838.                     }
  8839.                     Paczka[p][pAktywna] = 0;
  8840.                 }
  8841.             }
  8842.         }
  8843.     }
  8844.     //koniec
  8845.     for(new v = 0; v < MAX_VEHICLES; v++)
  8846.     {
  8847.         if(Pojazd[v][vSpawn] == 1)
  8848.         {
  8849.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  8850.             {
  8851.                 if(PojazdUID[veh] == v)
  8852.                 {
  8853.                     ZapiszPojazd(veh);
  8854.                 }
  8855.             }
  8856.         }
  8857.     }
  8858.     for(new d = 0; d < MAX_DRZWI; d++)
  8859.     {
  8860.         if(Drzwi[d][dAktywne] == 1)
  8861.         {
  8862.             ZapiszDrzwi(d);
  8863.         }
  8864.     }
  8865.     return SetTimerEx("Restart", 3000, 0, "");
  8866. }
  8867.  
  8868. CMD:blok(playerid, params[])
  8869. {
  8870.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8871.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8872.     new gracz, powod[64], czas;
  8873.     if(sscanf(params, "dds[64]", gracz, czas, powod))
  8874.         return Tip(playerid, "/blok [gracz] [czas - 0 dla kary wiecznej] [powód]");
  8875.     if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  8876.     return Kara(3, gracz, playerid, powod, czas);
  8877. }
  8878.  
  8879.  
  8880. CMD:logi(playerid, params[])
  8881. {
  8882.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_MAX))
  8883.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8884.     return dShowPlayerDialog(playerid, 200, DIALOG_STYLE_LIST, ""ServName"Logi", "1\tDezaktywacja kar\n2\tNadawanie kar", "Wybierz", "Anuluj");
  8885. }
  8886.  
  8887. //teleportacje
  8888.  
  8889. CMD:tm(playerid, params[])
  8890. {
  8891.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8892.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8893.     new gracz, Float:Pos[3];
  8894.     if(sscanf(params, "u", gracz))
  8895.         return Tip(playerid, "/tm [gracz]");
  8896.     if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  8897.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  8898.     SetPlayerPos(gracz, Pos[0], Pos[1]+2, Pos[2]);
  8899.     SetPVarInt(gracz, "Teleport", 1);
  8900.     SetPVarInt(playerid, "Teleport", 1);
  8901.     return SetPlayerVirtualWorld(gracz, GetPlayerVirtualWorld(playerid));
  8902. }
  8903.  
  8904. CMD:to(playerid, params[])
  8905. {
  8906.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8907.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8908.     new gracz, Float:Pos[3];
  8909.     if(sscanf(params, "u", gracz))
  8910.         return Tip(playerid, "/to [gracz]");
  8911.     if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  8912.     GetPlayerPos(gracz, Pos[0], Pos[1], Pos[2]);
  8913.     SetPlayerPos(playerid, Pos[0], Pos[1]+2, Pos[2]);
  8914.     SetPVarInt(gracz, "Teleport", 1);
  8915.     SetPVarInt(playerid, "Teleport", 1);
  8916.     return SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(gracz));
  8917. }
  8918.  
  8919. CMD:ptp(playerid, params[])
  8920. {
  8921.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8922.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8923.     new gracz1, gracz2, Float:Pos[3];
  8924.     if(sscanf(params, "uu", gracz1, gracz2))
  8925.         return Tip(playerid, "/ptp [gracz 1] [gracz 2]");
  8926.     if(IsPlayerLogged(gracz1) == 0 || IsPlayerLogged(gracz2) == 0) return NoLogin(playerid);
  8927.     SetPVarInt(gracz1, "Teleport", 1);
  8928.     SetPVarInt(gracz2, "Teleport", 1);
  8929.     GetPlayerPos(gracz2, Pos[0], Pos[1], Pos[2]);
  8930.     SetPlayerPos(gracz1, Pos[0], Pos[1]+2, Pos[2]);
  8931.     return SetPlayerVirtualWorld(gracz1, GetPlayerVirtualWorld(gracz2));
  8932. }
  8933.  
  8934. CMD:tp(playerid, params[])
  8935. {
  8936.     if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8937.         return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  8938.     new vir, int, Float:Pos[3];
  8939.     if(sscanf(params, "fffdd", Pos[0], Pos[1], Pos[2], int, vir))
  8940.         return Tip(playerid, "/tp [pos X] [pos Y] [pos Z] [int] [vir]");
  8941.     SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  8942.     SetPlayerInterior(playerid, int);
  8943.     SetPVarInt(playerid, "Teleport", 1);
  8944.     return SetPlayerVirtualWorld(playerid, vir);
  8945. }
  8946.  
  8947. CMD:set(playerid, params[])
  8948. {
  8949.     if((Player[playerid][pAdmin] & ADMIN_PERM_GM))
  8950.     {
  8951.         new sub[80],rest[80], gracz, value;
  8952.         if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/set [skin, hp]");
  8953.         if(!strcmp(sub, "skin", true))
  8954.         {
  8955.             if(sscanf(rest, "ud", gracz, value))
  8956.                 return Tip(playerid, "/set skin [gracz] [skin (0 - 299)]");
  8957.             if(value < 0 || value > 299)
  8958.                 return Tip(playerid, "Podano błędne ID skina");
  8959.             Player[gracz][pSkin] = value;
  8960.             SetPlayerSkin(gracz, value);
  8961.         }
  8962.         return 1;
  8963.     }
  8964.     return 1;
  8965. }
  8966.  
  8967. CMD:ap(playerid, params[])
  8968. {
  8969.     if((Player[playerid][pAdmin] & ADMIN_PERM_ITEM))
  8970.         return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tStworz przedmiot\n2\tEdytuj przedmiot", "Wybierz", "Anuluj");
  8971.     return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~przedmiotami~w~ na serwerze.", 3);
  8972. }
  8973.  
  8974. CMD:av(playerid, params[])
  8975. {
  8976.     if((Player[playerid][pAdmin] & ADMIN_PERM_VEHICLE))
  8977.     {
  8978.         new sub[80],rest[80], v, value2, val[32];
  8979.         if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/av [stworz | spawn | fix | hp | respawn | przypisz | tankuj | rejestruj]");
  8980.         if(!strcmp(sub, "stworz", true))
  8981.         {
  8982.             new veh;
  8983.             if(sscanf(rest, "d", veh))
  8984.                 return Tip(playerid, "/av stworz [model]");
  8985.             for(v = 1; v < MAX_VEHICLES; v++)
  8986.             {
  8987.                 new file[40];
  8988.                 format(file, sizeof(file), "Pojazdy/%d.ini", v);
  8989.                 if(Pojazd[v][vAktywny] == 0 && !DOF2_FileExists(file))
  8990.                 {
  8991.                     Pojazd[v][vAktywny]         = 1;
  8992.                     Pojazd[v][vModel]           = veh;
  8993.                     Pojazd[v][vOwner]           = 1;
  8994.                     Pojazd[v][vOwnerUID]        = Player[playerid][pUID];
  8995.                     Pojazd[v][vKolor1]          = 1;
  8996.                     Pojazd[v][vKolor2]          = 1;
  8997.                     Pojazd[v][vPrzebieg]        = 0.0;
  8998.                     Pojazd[v][vHP]              = 1000.0;
  8999.                     GetPlayerPos(playerid, Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ]);
  9000.                     GetPlayerFacingAngle(playerid, Pojazd[v][vRot]);
  9001.                     Pojazd[v][vVir]             = GetPlayerVirtualWorld(playerid);
  9002.                     Pojazd[v][vReje]            = 0;
  9003.                     Pojazd[v][vPanels]          = 0;
  9004.                     Pojazd[v][vDoors]           = 0;
  9005.                     Pojazd[v][vLights]          = 0;
  9006.                     Pojazd[v][vTires]           = 0;
  9007.                     Pojazd[v][vPaliwoTyp]       = 1;
  9008.                     Pojazd[v][vPaliwo]          = PaliwoMax(veh);
  9009.                     Pojazd[v][vPaliwoMax]       = PaliwoMax(veh);
  9010.                     //MySQL
  9011.                     new query[256];
  9012.                     format(query, sizeof(query), "INSERT INTO `1veh` (`uid`,`model`,`marka`,`owner`,`owner_uid`,`HP`,`przebieg`) VALUES ('%d', '%d', '%s', '%d', '%d', %f, %f)", v, Pojazd[v][vModel], GetVehicleName(v), Pojazd[v][vOwner], Pojazd[v][vOwnerUID], Pojazd[v][vHP], Pojazd[v][vPrzebieg]);
  9013.                     mysql_query_ex(query);
  9014.                     //tworzenie
  9015.                     PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
  9016.                     Pojazd[v][vSpawn] = 1;
  9017.                     PojazdUID[PojazdModel[v]] = v;
  9018.                     if(Pojazd[v][vReje] == 0)
  9019.                     {
  9020.                         SetVehicleNumberPlate(PojazdModel[v], " ");
  9021.                     }
  9022.                     else if(Pojazd[v][vReje] == 1)
  9023.                     {
  9024.                         format(String, sizeof(String), "SA %04d", v);
  9025.                         SetVehicleNumberPlate(PojazdModel[v], String);
  9026.                     }
  9027.                     SetVehicleToRespawn(PojazdModel[v]);
  9028.                     UstawParametryPojazdu(PojazdModel[v]);
  9029.                     format(String, sizeof(String), "Utworzono pojazd ~y~%s~w~ (UID: %d) jako ~r~Administrator~w~.", GetVehicleName(v), v);
  9030.                     InfoBoxShow(2, playerid, String, 3);
  9031.                     ZapiszPojazd(PojazdModel[v]);
  9032.                     break;
  9033.                 }
  9034.             }
  9035.             return 1;
  9036.         }
  9037.         else if(!strcmp(sub, "usun", true))
  9038.         {
  9039.             if(sscanf(rest, "d", v))
  9040.                 return Tip(playerid, "/av usun [identyfikator]");
  9041.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9042.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9043.             Pojazd[v][vAktywny] = 0;
  9044.             //Kasowanie z MySQL
  9045.             new query[128];
  9046.             format(query, 128, "DELETE FROM `1veh` WHERE uid = '%d'", v), mysql_query_ex(query);
  9047.            
  9048.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9049.             {
  9050.                 if(PojazdUID[veh] == v)
  9051.                 {
  9052.                     for(new p = 0; p < MAX_ITEM; p++)
  9053.                     {
  9054.                         if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 8 && Przedmiot[p][iOwnerUID] == v && Przedmiot[p][iTyp] == 5)
  9055.                         {
  9056.                             Przedmiot[p][iAktywny] = 0;
  9057.                             ZapiszPrzedmiot(p);
  9058.                         }
  9059.                     }
  9060.                     ZapiszPojazd(veh);
  9061.                     DestroyVehicle(PojazdModel[v]);
  9062.                 }
  9063.             }
  9064.             return 1;
  9065.         }
  9066.         else if(!strcmp(sub, "spawn", true))
  9067.         {
  9068.             if(sscanf(rest, "d", v))
  9069.                 return Tip(playerid, "/av spawn [identyfikator]");
  9070.             if(Pojazd[v][vAktywny] == 1)
  9071.             {
  9072.                 if(Pojazd[v][vSpawn] == 1)
  9073.                 {
  9074.                     foreach(Player, p)
  9075.                     {
  9076.                         if(GetPlayerVehicleID(p) == PojazdModel[v])
  9077.                         {
  9078.                             return InfoBoxShow(2, playerid, "Nie mozesz odspawnowac tego ~y~pojazdu~w~, poniewaz ktos znajduje sie w srodku.", 3);
  9079.                         }
  9080.                         if(GetPVarInt(p, "OffeVeh") == PojazdModel[v])
  9081.                         {
  9082.                             SetPVarInt(p, "OffeVeh", 0);
  9083.                             SetPVarInt(p, "OffeVehTime", 0);
  9084.                             Tip(p, "Naprawa pojazdu została anulowana, pojazd został odspawnowany.");
  9085.                             TextDrawHideForPlayer(p, TDOffe[p]);
  9086.                             Offer[p][oBlock] = 0;
  9087.                         }
  9088.                     }
  9089.                     UpdateDynamic3DTextLabelText(Text3D:Veh3DText[PojazdModel[v]], KOL_NAME, " ");
  9090.                     format(String, sizeof(String), "Odspawnowano pojazd ~y~%s~w~ (UID: %d) jako ~r~Administrator~w~.", GetVehicleName(v), v);
  9091.                     InfoBoxShow(2, playerid, String, 3);
  9092.                     ZapiszPojazd(PojazdModel[v]);
  9093.                     DestroyVehicle(PojazdModel[v]);
  9094.                     Pojazd[v][vSpawn] = 0;
  9095.                 }
  9096.                 else
  9097.                 {
  9098.                     PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
  9099.                     Pojazd[v][vSpawn] = 1;
  9100.                     PojazdUID[PojazdModel[v]] = v;
  9101.                     if(Pojazd[v][vReje] == 0)
  9102.                     {
  9103.                         SetVehicleNumberPlate(PojazdModel[v], " ");
  9104.                     }
  9105.                     else if(Pojazd[v][vReje] == 1)
  9106.                     {
  9107.                         format(String, sizeof(String), "SA %04d", v);
  9108.                         SetVehicleNumberPlate(PojazdModel[v], String);
  9109.                     }
  9110.                     SetVehicleToRespawn(PojazdModel[v]);
  9111.                     UstawParametryPojazdu(PojazdModel[v]);
  9112.                     format(String, sizeof(String), "Zespawnowano pojazd ~y~%s~w~ (UID: %d) jako ~r~Administrator~w~.", GetVehicleName(v), v);
  9113.                     InfoBoxShow(2, playerid, String, 3);
  9114.                 }
  9115.             }
  9116.             else
  9117.             {
  9118.                 InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9119.             }
  9120.             return 1;
  9121.         }
  9122.         else if(!strcmp(sub, "fix", true))
  9123.         {
  9124.             new Float:valueHP;
  9125.             if(sscanf(rest, "df", v, valueHP))
  9126.                 return Tip(playerid, "/av fix [identyfikator] [poziom HP]");
  9127.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9128.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9129.             Pojazd[v][vHP]      = valueHP;
  9130.             Pojazd[v][vPanels]  = 0;
  9131.             Pojazd[v][vDoors]   = 0;
  9132.             Pojazd[v][vLights]  = 0;
  9133.             Pojazd[v][vTires]   = 0;
  9134.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9135.             {
  9136.                 if(PojazdUID[veh] == v)
  9137.                 {
  9138.                     foreach(Player, p)
  9139.                     {
  9140.                         if(GetPlayerState(p) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == veh)
  9141.                         {
  9142.                             SetPVarInt(p, "Fix", gettime()+3);
  9143.                         }
  9144.                     }
  9145.                     SetVehicleHealth(veh, Pojazd[v][vHP]);
  9146.                     UpdateVehicleDamageStatus(veh, Pojazd[v][vPanels], Pojazd[v][vDoors], Pojazd[v][vLights], Pojazd[v][vTires]);
  9147.                     ZapiszPojazd(veh);
  9148.                 }
  9149.             }
  9150.             format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal naprawiony ~g~pomyslnie~w~.", GetVehicleName(v), v);
  9151.             return InfoBoxShow(2, playerid, String, 5);
  9152.         }
  9153.         else if(!strcmp(sub, "hp", true))
  9154.         {
  9155.             new Float:valueHP;
  9156.             if(sscanf(rest, "df", v, valueHP))
  9157.                 return Tip(playerid, "/av hp [identyfikator] [poziom HP]");
  9158.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9159.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9160.             Pojazd[v][vHP]      = valueHP;
  9161.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9162.             {
  9163.                 if(PojazdUID[veh] == v)
  9164.                 {
  9165.                     foreach(Player, p)
  9166.                     {
  9167.                         if(GetPlayerState(p) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == veh)
  9168.                         {
  9169.                             SetPVarInt(p, "Fix", gettime()+3);
  9170.                         }
  9171.                     }
  9172.                     SetVehicleHealth(veh, Pojazd[v][vHP]);
  9173.                     ZapiszPojazd(veh);
  9174.                 }
  9175.             }
  9176.             format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal naprawiony ~g~pomyslnie~w~.", GetVehicleName(v), v);
  9177.             return InfoBoxShow(2, playerid, String, 5);
  9178.         }
  9179.         else if(!strcmp(sub, "respawn", true))
  9180.         {
  9181.             if(sscanf(rest, "d", v))
  9182.                 return Tip(playerid, "/av respawn [identyfikator]");
  9183.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9184.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9185.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9186.             {
  9187.                 if(PojazdUID[veh] == v)
  9188.                 {
  9189.                     ZapiszPojazd(veh);
  9190.                     SetVehicleToRespawn(veh);
  9191.                 }
  9192.             }
  9193.             format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal zrespawnowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
  9194.             return InfoBoxShow(2, playerid, String, 5);
  9195.         }
  9196.         else if(!strcmp(sub, "rejestruj", true))
  9197.         {
  9198.             if(sscanf(rest, "d", v))
  9199.                 return Tip(playerid, "/av rejestruj [identyfikator]");
  9200.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9201.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9202.             if(Pojazd[v][vReje] == 1) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ jest zarejestrowany.", 3);
  9203.             Pojazd[v][vReje] = 1;
  9204.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9205.             {
  9206.                 if(PojazdUID[veh] == v)
  9207.                 {
  9208.                     ZapiszPojazd(veh);
  9209.                     SetVehicleToRespawn(veh);
  9210.                 }
  9211.             }
  9212.             format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal zarejestrowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
  9213.             return InfoBoxShow(2, playerid, String, 5);
  9214.         }
  9215.         else if(!strcmp(sub, "przypisz", true))
  9216.         {
  9217.             if(sscanf(rest, "ds[32]d", v, val, value2)) return Tip(playerid, "/av przypisz [identyfikator] [gracz / grupa] [oid]");
  9218.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9219.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9220.             if(!strcmp(val, "gracz"))
  9221.             {
  9222.                 if(IsPlayerLogged(value2) == 0) return NoLogin(playerid);
  9223.                 Pojazd[v][vOwner] = 1;
  9224.                 Pojazd[v][vOwnerUID] = Player[value2][pUID];
  9225.                 format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal przepisany ~g~pomyslnie~w~ na gracza ~y~%s~w~.", GetVehicleName(v), v, CharName(value2));
  9226.                 InfoBoxShow(2, playerid, String, 5);
  9227.             }
  9228.             if(!strcmp(val, "grupa"))
  9229.             {
  9230.                 if(Grupa[value2][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9231.                 Pojazd[v][vOwner] = 2;
  9232.                 Pojazd[v][vOwnerUID] = value2;
  9233.                 format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal przepisany ~g~pomyslnie~w~ na grupe ~y~%s~w~ (UID: %d).", GetVehicleName(v), v, Grupa[value2][gNazwa], value2);
  9234.                 InfoBoxShow(2, playerid, String, 5);
  9235.             }
  9236.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9237.             {
  9238.                 if(PojazdUID[veh] == v)
  9239.                 {
  9240.                     ZapiszPojazd(veh);
  9241.                 }
  9242.             }
  9243.             return 1;
  9244.         }
  9245.         else if(!strcmp(sub, "tankuj", true))
  9246.         {
  9247.             if(sscanf(rest, "d", v))
  9248.                 return Tip(playerid, "/av respawn [identyfikator]");
  9249.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9250.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9251.             Pojazd[v][vPaliwo] = Pojazd[v][vPaliwoMax];
  9252.             format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal zatankowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
  9253.             return InfoBoxShow(2, playerid, String, 5);
  9254.         }
  9255.         else if(!strcmp(sub, "kolor", true))
  9256.         {
  9257.             new k1, k2;
  9258.             if(sscanf(rest, "ddd", v, k1, k2))
  9259.                 return Tip(playerid, "/av kolor [identyfikator] [kolor 1] [kolor 2]");
  9260.             if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
  9261.             if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
  9262.             Pojazd[v][vKolor1] = k1;
  9263.             Pojazd[v][vKolor2] = k2;
  9264.             for(new veh = 0; veh < MAX_VEHICLES; veh++)
  9265.             {
  9266.                 if(PojazdUID[veh] == v)
  9267.                 {
  9268.                     ChangeVehicleColor(veh, Pojazd[v][vKolor1], Pojazd[v][vKolor2]);
  9269.                     ZapiszPojazd(veh);
  9270.                 }
  9271.             }
  9272.             format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal przemalowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
  9273.             return InfoBoxShow(2, playerid, String, 5);
  9274.         }
  9275.         return 1;
  9276.     }
  9277.     return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~pojazdami~w~ na serwerze.", 3);
  9278. }
  9279.  
  9280.  
  9281.  
  9282. CMD:mdoor(playerid, params[])
  9283. {
  9284.     new cena = 0, nazwa[64];
  9285.     if(Sluzba(playerid) == 0)
  9286.         return Info(playerid, "Wejdź na służbę grupy, która posiada uprawnienia do tworzenia budynków.");
  9287.     if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_MAYOR))
  9288.         return Info(playerid, "Nie posiadasz uprawnień do tworzenia budynków.");
  9289.     if(sscanf(params, "ds[64]", cena, nazwa))
  9290.         return Tip(playerid, "/mdoor [cena] [nazwa]");
  9291.  
  9292.  
  9293.     new Float:Pos[3];
  9294.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  9295.     for(new nr = 1; nr < MAX_DRZWI; nr++)
  9296.     {
  9297.         new file[40];
  9298.         format(file, sizeof(file), "Drzwi/%d.ini", nr);
  9299.         if(Drzwi[nr][dAktywne] == 0 && !DOF2_FileExists(file))
  9300.         {
  9301.             format(String, sizeof(String), "Utworzone zostały drzwi %s (UID: %d).\nPo 24 godzinach każdy gracz będzie mógł je kupić za kwotę $%d.\nPieniądze ze sprzedaży trafią na konto rządu.", nazwa, nr, cena), Info(playerid, String);
  9302.             Drzwi[nr][dAktywne]     = 1;
  9303.             Drzwi[nr][dCreateTime]  = gettime();
  9304.             Drzwi[nr][dCreatePrice] = cena;
  9305.             Drzwi[nr][dOwner]       = 0;
  9306.             Drzwi[nr][dOwnerUID]    = Player[playerid][pUID];
  9307.             Drzwi[nr][dZewVir]      = GetPlayerVirtualWorld(playerid);
  9308.             Drzwi[nr][dIntZew]      = GetPlayerInterior(playerid);
  9309.             Drzwi[nr][dWewVir]      = nr;
  9310.             Drzwi[nr][dPickup]      = 1239;
  9311.             Drzwi[nr][dObiekty]     = 25;
  9312.             strmid(Drzwi[nr][dNazwa], nazwa, 0, 64, 64);
  9313.             Drzwi[nr][dWewPosX]     = Pos[0];
  9314.             Drzwi[nr][dWewPosY]     = Pos[1];
  9315.             Drzwi[nr][dWewPosZ]     = Pos[2];
  9316.             Drzwi[nr][dZewPosX]     = Pos[0];
  9317.             Drzwi[nr][dZewPosY]     = Pos[1];
  9318.             Drzwi[nr][dZewPosZ]     = Pos[2];
  9319.             Drzwi[nr][dStatus]      = 1;
  9320.             ZapiszDrzwi(nr);
  9321.             DrzwiPickup[nr] = CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
  9322.             break;
  9323.         }
  9324.     }
  9325.     return 1;
  9326. }
  9327.  
  9328. CMD:mgroup(playerid, params[])
  9329. {
  9330.     if(Player[playerid][pMayor] == 1)
  9331.     {
  9332.         return 1;
  9333.     }
  9334.     return Info(playerid, "Nie posiadasz wystarczających uprawnień do użycia tej komendy.");
  9335. }
  9336.  
  9337. CMD:ad(playerid, params[])
  9338. {
  9339.     if((Player[playerid][pAdmin] & ADMIN_PERM_DOOR))
  9340.     {
  9341.         new sub[80],rest[80], value1, value2, val[32], nazwa[32], query[512];
  9342.         if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/ad [stworz | usun | goto | wejscie (pickup) | wyjscie | interior | exitvw | entervw | typ | przypisz | pickup]");
  9343.         if(!strcmp(sub, "stworz", true))
  9344.         {
  9345.             new Float:Pos[3];
  9346.             GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  9347.             if(sscanf(rest, "s[32]", nazwa)) return Tip(playerid, "/ad stworz [nazwa]");
  9348.             for(new nr = 1; nr < MAX_DRZWI; nr++)
  9349.             {
  9350.                 new file[40];
  9351.                 format(file, sizeof(file), "Drzwi/%d.ini", nr);
  9352.                 if(Drzwi[nr][dAktywne] == 0 && !DOF2_FileExists(file))
  9353.                 {
  9354.                     format(String, sizeof(String), "Utworzone zostały drzwi %s (UID: %d).", nazwa, nr), Info(playerid, String);
  9355.                     Drzwi[nr][dAktywne]     = 1;
  9356.                     Drzwi[nr][dOwner]       = 1;
  9357.                     Drzwi[nr][dOwnerUID]    = Player[playerid][pUID];
  9358.                     Drzwi[nr][dZewVir]      = GetPlayerVirtualWorld(playerid);
  9359.                     Drzwi[nr][dIntZew]      = GetPlayerInterior(playerid);
  9360.                     Drzwi[nr][dWewVir]      = nr;
  9361.                     Drzwi[nr][dPickup]      = 1239;
  9362.                     Drzwi[nr][dObiekty]     = 25;
  9363.                     strmid(Drzwi[nr][dNazwa], nazwa, 0, 64, 64);
  9364.                     Drzwi[nr][dWewPosX]     = Pos[0];
  9365.                     Drzwi[nr][dWewPosY]     = Pos[1];
  9366.                     Drzwi[nr][dWewPosZ]     = Pos[2];
  9367.                     Drzwi[nr][dZewPosX]     = Pos[0];
  9368.                     Drzwi[nr][dZewPosY]     = Pos[1];
  9369.                     Drzwi[nr][dZewPosZ]     = Pos[2];
  9370.                     Drzwi[nr][dStatus]      = 1;
  9371.                     ZapiszDrzwi(nr);
  9372.                     DrzwiPickup[nr] = CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
  9373.                     format(query, sizeof(query), "INSERT INTO `1drzwi` (`uid`,`owner`,`owner_uid`,`name`) VALUES ('%d', '%d', '%d', '%s')", nr, Drzwi[nr][dOwner], Drzwi[nr][dOwnerUID], Drzwi[nr][dNazwa]);
  9374.                     mysql_query_ex(query);
  9375.                     GetPlayerFacingAngle(playerid, Drzwi[nr][dZewRot]);
  9376.                     break;
  9377.                 }
  9378.             }
  9379.             return 1;
  9380.         }
  9381.         else if(!strcmp(sub, "wejscie", true))
  9382.         {
  9383.             if(sscanf(rest, "d", value1)) return Tip(playerid, "/ad wejscie [identyfikator]");
  9384.             DestroyDynamicPickup(DrzwiPickup[value1]);
  9385.             GetPlayerPos(playerid, Drzwi[value1][dZewPosX], Drzwi[value1][dZewPosY], Drzwi[value1][dZewPosZ]);
  9386.             GetPlayerFacingAngle(playerid, Drzwi[value1][dZewRot]);
  9387.             return CreateDynamicPickup(Drzwi[value1][dPickup], 2, Drzwi[value1][dZewPosX], Drzwi[value1][dZewPosY], Drzwi[value1][dZewPosZ], Drzwi[value1][dZewVir]), ZapiszDrzwi(value1);
  9388.         }
  9389.         else if(!strcmp(sub, "usun", true))
  9390.         {
  9391.             if(sscanf(rest, "d", value1)) return Tip(playerid, "/ad usun [identyfikator]");
  9392.             if(Drzwi[value1][dAktywne] == 0)
  9393.                 return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
  9394.             Drzwi[value1][dAktywne]     = 0;
  9395.             DestroyDynamicPickup(DrzwiPickup[value1]);
  9396.             ZapiszDrzwi(value1);
  9397.             format(query, 128, "DELETE FROM `1drzwi` WHERE uid = '%d'", value1), mysql_query_ex(query);
  9398.             return InfoBoxShow(2, playerid, "Drzwi zostaly pomyslnie ~r~usuniete~w~.", 3);
  9399.         }
  9400.         else if(!strcmp(sub, "przypisz", true))
  9401.         {
  9402.             if(sscanf(rest, "ds[32]d", value1, val, value2)) return Tip(playerid, "/ad przypisz [identyfikator] [gracz / grupa] [oid]");
  9403.             if(Drzwi[value1][dAktywne] == 0)
  9404.                 return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
  9405.             if(!strcmp(val, "gracz"))
  9406.             {
  9407.                 if(IsPlayerLogged(value2) == 0) return NoLogin(playerid);
  9408.                 Drzwi[value1][dOwner] = 1;
  9409.                 Drzwi[value1][dOwnerUID] = Player[value2][pUID];
  9410.                 format(String, sizeof(String), "Drzwi %s (UID: %d) zostały przypisane pomyślnie.\nTyp właściciela:\t\t%s\nWłaściciel:\t\t\t%s", Drzwi[value1][dNazwa], value1, "Gracz", CharName(value2)), Info(playerid, String);
  9411.                 return ZapiszDrzwi(value1);
  9412.             }
  9413.             if(!strcmp(val, "grupa"))
  9414.             {
  9415.                 if(Grupa[value2][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9416.                 Drzwi[value1][dOwner] = 2;
  9417.                 Drzwi[value1][dOwnerUID] = value2;
  9418.                 format(String, sizeof(String), "Drzwi %s (UID: %d) zostały przypisane pomyślnie.\nTyp właściciela:\t\t%s\nNazwa grupy:\t\t\t%s (UID: %d)", Drzwi[value1][dNazwa], value1, "Grupa", Grupa[value2][gNazwa], value2), Info(playerid, String);
  9419.                 return ZapiszDrzwi(value1);
  9420.             }
  9421.             return 1;
  9422.         }
  9423.         else if(!strcmp(sub, "goto", true))
  9424.         {
  9425.             if(sscanf(rest, "d", value1))
  9426.                 return Tip(playerid, "/ad goto [identyfikator]");
  9427.             if(Drzwi[value1][dAktywne] == 0)
  9428.                 return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
  9429.             SetPlayerInterior(playerid, 0);
  9430.             SetPVarInt(playerid, "Teleport", 1);
  9431.             SetPlayerPos(playerid, Drzwi[value1][dZewPosX], Drzwi[value1][dZewPosY], Drzwi[value1][dZewPosZ]);
  9432.             return SetPlayerVirtualWorld(playerid, Drzwi[value1][dZewVir]);
  9433.         }
  9434.         else if(!strcmp(sub, "pickup", true))
  9435.         {
  9436.             if(sscanf(rest, "d", value1))
  9437.                 return Tip(playerid, "/ad pickup [identyfikator]");
  9438.             if(Drzwi[value1][dAktywne] == 0)
  9439.                 return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
  9440.             SetPVarInt(playerid, "rpDoorPickUp", value1);
  9441.             return dShowPlayerDialog(playerid, 202, DIALOG_STYLE_LIST, ""ServName"Drzwi", "1\t1240\tCzerwone serce\n2\t1242\tArmour\n3\t1239\tInfo pickup\n4\t1272\tNiebieski dom\n5\t1273\tZielony dom\n6\t1212\tBanknoty\n7\t1241\tPiguła\n8\t1247\tGwiazda LSPD\n9\t1274\tDolar\n10\t1275\tKoszulka\n11\t1314\tDwoje ludzi\n12\t1318\tBiała strzałka", "Wybierz", "Anuluj");
  9442.         }
  9443.         else if(!strcmp(sub, "wyjscie", true))
  9444.         {
  9445.             if(sscanf(rest, "d", value1))
  9446.                 return Tip(playerid, "/ad wyjscie [identyfikator]");
  9447.             GetPlayerPos(playerid, Drzwi[value1][dWewPosX], Drzwi[value1][dWewPosY], Drzwi[value1][dWewPosZ]);
  9448.             Drzwi[value1][dIntWew] = GetPlayerInterior(playerid);
  9449.             InfoBoxShow(2, playerid, "Edycja drzwi zakonczona ~g~sukcesem~w~.", 3);
  9450.             GetPlayerFacingAngle(playerid, Drzwi[value1][dWewRot]);
  9451.             return ZapiszDrzwi(value1);
  9452.         }
  9453.         else if(!strcmp(sub, "wejscie", true))
  9454.         {
  9455.             if(sscanf(rest, "d", value1))
  9456.                 return Tip(playerid, "/ad wejscie [identyfikator]");
  9457.             return ZapiszDrzwi(value1);
  9458.         }
  9459.         else if(!strcmp(sub, "interior", true))
  9460.         {
  9461.             new int[32], ints[3076];
  9462.             for(new nr = 1; nr < sizeof(IntArray2); nr++)
  9463.             {
  9464.                 format(int, sizeof(int), "%d\t%s", nr, IntName[nr]);
  9465.                 format(ints, sizeof(ints), "%s%s\n", ints, int);
  9466.             }
  9467.             return dShowPlayerDialog(playerid, 998, DIALOG_STYLE_LIST, ""ServName"Drzwi", ints, "Wybierz", "Anuluj");
  9468.         }
  9469.         else if(!strcmp(sub, "zamknij", true))
  9470.         {
  9471.             if(sscanf(rest, "d", value1))
  9472.                 return Tip(playerid, "/ad zamknij [identyfikator]");
  9473.             if(Drzwi[value1][dStatus] == 1)
  9474.             {
  9475.                 Drzwi[value1][dStatus] = 0;
  9476.                 format(String, sizeof(String), "Drzwi %s (UID: %d) zostały otwarte.", Drzwi[value1][dNazwa], value1), Info(playerid, String);
  9477.             }
  9478.             else
  9479.             {
  9480.                 Drzwi[value1][dStatus] = 1;
  9481.                 format(String, sizeof(String), "Drzwi %s (UID: %d) zostały zamknięte.", Drzwi[value1][dNazwa], value1), Info(playerid, String);
  9482.             }
  9483.             return ZapiszDrzwi(value1);
  9484.         }
  9485.         else if(!strcmp(sub, "entervw", true))
  9486.         {
  9487.             if(sscanf(rest, "dd", value1, value2))
  9488.                 return Tip(playerid, "/ad entervw [identyfikator] [virtual]");
  9489.             Drzwi[value1][dZewVir] = value2;
  9490.             return format(String, sizeof(String), "Virtual World wejściowy drzwi %s (UID: %d) został zmieniony na %d.", Drzwi[value1][dNazwa], value1, value2), Info(playerid, String), ZapiszDrzwi(value1);
  9491.         }
  9492.         else if(!strcmp(sub, "exitvw", true))
  9493.         {
  9494.             if(sscanf(rest, "dd", value1, value2))
  9495.                 return Tip(playerid, "/ad exitvw [identyfikator] [virtual]");
  9496.             Drzwi[value1][dWewVir] = value2;
  9497.             return format(String, sizeof(String), "Virtual World wyjściowy drzwi %s (UID: %d) został zmieniony na %d.", Drzwi[value1][dNazwa], value1, value2), Info(playerid, String), ZapiszDrzwi(value1);
  9498.         }
  9499.         return 1;
  9500.     }
  9501.     return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~drzwiami~w~ na serwerze.", 3);
  9502. }
  9503.  
  9504. CMD:ag(playerid, params[])
  9505. {
  9506.     if((Player[playerid][pAdmin] & ADMIN_PERM_GROUP))
  9507.     {
  9508.         new sub[80],rest[80], gracz, id, value[256], text[256], valueINT;
  9509.         if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/ag [stworz | lider | zapros | wypros | panel | kolor | payday]"), Tip(playerid, "/ag [nazwa | pub | tag | lista | usun | flagi | typ | produkt]");
  9510.         if(!strcmp(sub, "stworz", true))
  9511.         {
  9512.             new nazwa[64];
  9513.             if(sscanf(rest, "s[64]", nazwa)) return Tip(playerid, "/ag stworz [nazwa]");
  9514.             for(new nr = 1; nr < MAX_GRUPY; nr++)
  9515.             {
  9516.                 new file[40];
  9517.                 format(file, sizeof(file), "Grupy/%d.ini", nr);
  9518.                 if(Grupa[nr][gAktywna] == 0 && !DOF2_FileExists(file))
  9519.                 {
  9520.                     Grupa[nr][gAktywna] = 1;
  9521.                     Grupa[nr][gOwner] = 0;
  9522.                     Grupa[nr][gPunkty] = 0;
  9523.                     Grupa[nr][gPayDay] = 100;
  9524.                     Grupa[nr][gTyp] = 1;
  9525.                     strmid(Grupa[nr][gNazwa], nazwa, 0, 64, 64);
  9526.                     strmid(Grupa[nr][gTag], "NONE", 0, 64, 64);
  9527.                     Grupa[nr][gBank] = 0;
  9528.                     Grupa[nr][gKolor] = -1;
  9529.                     Grupa[nr][gKolorZone] = -1;
  9530.                     //flagi
  9531.                     Grupa[nr][gFlagPerm] =  3;
  9532.                     Grupa[nr][gVehLimit] =  5;
  9533.                     ZapiszGrupe(nr);
  9534.                     GrupaInfo(playerid, nr);
  9535.                     break;
  9536.                 }
  9537.             }
  9538.             return  1;
  9539.         }
  9540.         else if(!strcmp(sub, "lider", true))
  9541.         {
  9542.             if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag lider [gracz] [grupa]");
  9543.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9544.             if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  9545.             if(GrupaSlot(gracz, id) != 0) return format(String, sizeof(String), "~w~Gracz juz jest czlonkiem ~y~grupy~w~ o ~y~UID~w~ %d.", id), InfoBoxShow(2, playerid, String, 3);
  9546.             if(pGrupa[gracz][1] == 0 || Grupa[pGrupa[gracz][1]][gAktywna] == 0)
  9547.             {
  9548.                 pGrupa[gracz][1] = id, pGrupaPerm[gracz][1] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9549.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9550.             }
  9551.             if(pGrupa[gracz][2] == 0 || Grupa[pGrupa[gracz][2]][gAktywna] == 0)
  9552.             {
  9553.                 pGrupa[gracz][2] = id, pGrupaPerm[gracz][2] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9554.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9555.             }
  9556.             if(pGrupa[gracz][3] == 0 || Grupa[pGrupa[gracz][3]][gAktywna] == 0)
  9557.             {
  9558.                 pGrupa[gracz][3] = id, pGrupaPerm[gracz][3] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9559.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9560.             }
  9561.             if(pGrupa[gracz][4] == 0 || Grupa[pGrupa[gracz][4]][gAktywna] == 0)
  9562.             {
  9563.                 pGrupa[gracz][4] = id, pGrupaPerm[gracz][4] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9564.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9565.             }
  9566.             if(pGrupa[gracz][5] == 0 || Grupa[pGrupa[gracz][5]][gAktywna] == 0)
  9567.             {
  9568.                 pGrupa[gracz][5] = id, pGrupaPerm[gracz][5] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9569.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9570.             }
  9571.             return InfoBoxShow(2, playerid, "Gracz posiada zajete wszystkie sloty grupowe, nie mozesz go zaprosic.", 3);
  9572.         }
  9573.         else if(!strcmp(sub, "zapros", true))
  9574.         {
  9575.             if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag zapros [gracz] [grupa]");
  9576.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9577.             if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  9578.             if(GrupaSlot(gracz, id) != 0) return format(String, sizeof(String), "~w~Gracz juz jest czlonkiem ~y~grupy~w~ o ~y~UID~w~ %d.", id), InfoBoxShow(2, playerid, String, 3);
  9579.             if(pGrupa[gracz][1] == 0)
  9580.             {
  9581.                 pGrupa[gracz][1] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9582.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9583.             }
  9584.             if(pGrupa[gracz][2] == 0)
  9585.             {
  9586.                 pGrupa[gracz][2] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9587.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9588.             }
  9589.             if(pGrupa[gracz][3] == 0)
  9590.             {
  9591.                 pGrupa[gracz][3] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9592.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9593.             }
  9594.             if(pGrupa[gracz][4] == 0)
  9595.             {
  9596.                 pGrupa[gracz][4] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9597.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9598.             }
  9599.             if(pGrupa[gracz][5] == 0)
  9600.             {
  9601.                 pGrupa[gracz][5] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9602.                 return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9603.             }
  9604.             return InfoBoxShow(2, playerid, "Gracz posiada zajete wszystkie sloty grupowe, nie mozesz go zaprosic.", 3);
  9605.         }
  9606.         else if(!strcmp(sub, "wypros", true))
  9607.         {
  9608.             if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag wypros [gracz] [grupa]");
  9609.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9610.             if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  9611.             if(pGrupa[gracz][1] == id)
  9612.             {
  9613.                 pGrupa[gracz][1] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9614.                 return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9615.             }
  9616.             if(pGrupa[gracz][2] == id)
  9617.             {
  9618.                 pGrupa[gracz][2] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9619.                 return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9620.             }
  9621.             if(pGrupa[gracz][3] == id)
  9622.             {
  9623.                 pGrupa[gracz][3] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9624.                 return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9625.             }
  9626.             if(pGrupa[gracz][4] == id)
  9627.             {
  9628.                 pGrupa[gracz][4] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9629.                 return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9630.             }
  9631.             if(pGrupa[gracz][5] == id)
  9632.             {
  9633.                 pGrupa[gracz][5] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
  9634.                 return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
  9635.             }
  9636.             format(String, sizeof(String), "~w~Gracz nie jest czlonkiem ~y~grupy~w~ o ~y~UID~w~ %d.", id);
  9637.             return InfoBoxShow(2, playerid, String, 3);
  9638.         }
  9639.         else if(!strcmp(sub, "panel", true))
  9640.         {
  9641.             if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag panel [gracz] [grupa]");
  9642.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9643.             return ZapiszGrupe(id);
  9644.         }
  9645.         else if(!strcmp(sub, "kolor", true))
  9646.         {
  9647.             if(sscanf(rest, "ds[256]", id, value)) return Tip(playerid, "/ag kolor [identyfikator] [kolor]");
  9648.             if(strlen(value)!=6) return InfoBoxShow(2, playerid, "Kolor ~b~~h~RGB~w~ nie moze miec wiecej niz 6 znakow.", 3);
  9649.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9650.             format(text, sizeof(text), "0x%sBB", value);
  9651.             Grupa[id][gKolor] = hexstring(text);
  9652.             format(text, sizeof(text), "0x%sAA", value);
  9653.             Grupa[id][gKolorZone] = hexstring(text);
  9654.             InfoBoxShow(2, playerid, "Kolor rozpoznawczy grupy zostal zmieniony.", 3);
  9655.             return ZapiszGrupe(id);
  9656.         }
  9657.         else if(!strcmp(sub, "payday", true))
  9658.         {
  9659.             if(sscanf(rest, "dd", id, valueINT)) return Tip(playerid, "/ag payday [identyfikator] [dotacja]");
  9660.             if(valueINT > 1000) return InfoBoxShow(2, playerid, "Kwota wyplaty nie moze przekraczac ~g~$1000~w~.", 3);
  9661.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9662.             Grupa[id][gPayDay] = valueINT;
  9663.             GrupaInfo(playerid, id);
  9664.             return ZapiszGrupe(id);
  9665.         }
  9666.         else if(!strcmp(sub, "nazwa", true))
  9667.         {
  9668.             if(sscanf(rest, "ds[64]", id, value)) return Tip(playerid, "/ag nazwa [identyfikator] [nazwa]");
  9669.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9670.             strmid(Grupa[id][gNazwa], value, 0, 64, 64);
  9671.             return GrupaInfo(playerid, id), ZapiszGrupe(id);
  9672.         }
  9673.         else if(!strcmp(sub, "tag", true))
  9674.         {
  9675.             if(sscanf(rest, "ds[8]", id, value)) return Tip(playerid, "/ag tag [identyfikator] [tag]");
  9676.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9677.             if(strlen(value) >= 5)
  9678.                 return Info(playerid, "Wpisany przez Ciebie tag jest zbyt długi.");
  9679.             strmid(Grupa[id][gTag], value, 0, 64, 64);
  9680.             return GrupaInfo(playerid, id), ZapiszGrupe(id);
  9681.         }
  9682.         else if(!strcmp(sub, "usun", true))
  9683.         {
  9684.             if(sscanf(rest, "d", id)) return Tip(playerid, "/ag usun [idenfytikator]");
  9685.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9686.             for(new nr = 1; nr < MAX_GRUPY; nr++)
  9687.             {
  9688.                 new file[40];
  9689.                 format(file, sizeof(file), "Grupy/%d.ini", nr);
  9690.                 if(Grupa[nr][gAktywna] == 1 && Grupa[nr][gOwner] == id && id != nr)
  9691.                 {
  9692.                     Grupa[nr][gAktywna] = 0;
  9693.                     ZapiszGrupe(nr);
  9694.                 }
  9695.             }
  9696. /*          for(new d = 1; d < MAX_DRZWI; d++)
  9697.             {
  9698.                 if(Drzwi[d][dOwner] == 2 && Drzwi[d][dOwnerUID] == id)
  9699.                 {
  9700.                     Drzwi[d][dAktywne] = 0;
  9701.                     DestroyDynamicPickup(DrzwiPickup[d]);
  9702.                     ZapiszDrzwi(d);
  9703.                 }
  9704.             }
  9705.             for(new v = 1; v < MAX_POJAZDY; v++)
  9706.             {
  9707.                 if(Pojazd[v][vOwner] == 2 && Pojazd[v][vOwnerUID] == id)
  9708.                 {
  9709.                     Pojazd[v][vAktywny] = 0, ZapiszPojazd(v);
  9710.                 }
  9711.             }
  9712. */
  9713.             Grupa[id][gAktywna] = 0;
  9714.             ZapiszGrupe(id);
  9715.             return Info(playerid, "Grupa została pomyślnie usunięta.");
  9716.         }
  9717.         else if(!strcmp(sub, "lista", true))
  9718.         {
  9719.             new grupa[128], grupy[1024], grup = 0;
  9720.             format(grupa, sizeof(grupa), "{AAC5E3}UID\tNazwa{FFFFFF}");
  9721.             for(new nr = 1; nr < MAX_GRUPY; nr++)
  9722.             {
  9723.                 if(Grupa[nr][gAktywna] == 1 && Grupa[nr][gOwner] == 0)
  9724.                 {
  9725.                     new grupe = 0;
  9726.                     for(new nrg = 1; nrg < MAX_GRUPY; nrg++)
  9727.                     {
  9728.                         if(Grupa[nrg][gAktywna] == 1 && Grupa[nrg][gOwner] == nr)
  9729.                         {
  9730.                             grupe++;
  9731.                         }
  9732.                     }
  9733.                     ListItem[playerid][grup] = nr;
  9734.  
  9735.                     if(grupe == 0)
  9736.                     format(grupa, sizeof(grupa), "%d\t%s", nr, Grupa[nr][gNazwa]);
  9737.                     else
  9738.                     format(grupa, sizeof(grupa), "%d\t%s (%d)", nr, Grupa[nr][gNazwa], grupe);
  9739.  
  9740.                     format(grupy, sizeof(grupy), "%s%s\n", grupy, grupa);
  9741.                     grup++;
  9742.                 }
  9743.             }
  9744.             if(grup == 0) return Info(playerid, "Nie istnieją żadne grupy.");
  9745.             dShowPlayerDialog(playerid, 9950, DIALOG_STYLE_LIST, ""ServName"Grupy", grupy, "Wybierz", "");
  9746.         }
  9747.         else if(!strcmp(sub, "typ", true))
  9748.         {
  9749.             new typ[32], typy[512];
  9750.             if(sscanf(rest, "d", id)) return Tip(playerid, "/ag typ [grupa]");
  9751.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9752.             SetPVarInt(playerid, "GroupType", id);
  9753.             for(new t = 1; t < sizeof(TypGrupy); t++)
  9754.             {
  9755.                 new tmp = t;
  9756.                 format(typ, sizeof(typ), "%d\t%s", t, TypGrupy[tmp]);
  9757.                 format(typy, sizeof(typy), "%s%s\n", typy, typ);
  9758.             }
  9759.             return dShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, ""ServName"Typ grupy", typy, "Wybierz", "Anuluj");
  9760.         }
  9761.         else if(!strcmp(sub, "produkt", true))
  9762.         {
  9763.             if(sscanf(rest, "d", id)) return Tip(playerid, "/ag produkt [grupa]");
  9764.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9765.             SetPVarInt(playerid, "GrupaDodajProdukt", id);
  9766.             return dShowPlayerDialog(playerid, 1001, DIALOG_STYLE_INPUT, ""ServName"Dodawanie produktów", "[typ] [w 1] [w 2] [w 3] [waga] [cena] [ilość] [nazwa]", "Dodaj", "Anuluj");
  9767.         }
  9768.         else if(!strcmp(sub, "perm", true))
  9769.         {
  9770.             new perm;
  9771.             if(sscanf(rest, "dd", id, perm)) return Tip(playerid, "/ag produkt [grupa] [perm]");
  9772.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9773.             Grupa[id][gFlagPerm] = perm, ZapiszGrupe(id);
  9774.         }
  9775.         else if(!strcmp(sub, "bank", true))
  9776.         {
  9777.             new perm;
  9778.             if(sscanf(rest, "dd", id, perm)) return Tip(playerid, "/ag bank [grupa] [kwota]");
  9779.             if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
  9780.             Grupa[id][gBank] = perm, ZapiszGrupe(id);
  9781.         }
  9782.         return 1;
  9783.     }
  9784.     return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~grupami~w~ na serwerze.", 3);
  9785. }
  9786. // System obiektów
  9787.  
  9788. CMD:mgate(playerid, params[])
  9789. {
  9790.     if(Obiekt(playerid) == 0)
  9791.         return Tip(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  9792.     if(Obiekt[Obiekt(playerid)][oGate] == 0)
  9793.     {
  9794.         Tip(playerid, "Funkcja bramy dla tego obiektu została włączona.");
  9795.         Obiekt[Obiekt(playerid)][oGate] = 1;
  9796.     }
  9797.     else
  9798.     {
  9799.         Tip(playerid, "Funkcja bramy dla tego obiektu została wyłączona.");
  9800.         Obiekt[Obiekt(playerid)][oGate] = 0;
  9801.     }
  9802.     return 1;
  9803. }
  9804.  
  9805. CMD:mc(playerid, params[])
  9806. {
  9807.     new model;
  9808.     if(sscanf(params, "d", model))
  9809.         return Tip(playerid, "/mc [model obiektu]");
  9810.     if((Player[playerid][pAdmin] & ADMIN_PERM_GROUP))
  9811.     {
  9812.         for(new nr = 1; nr < MAX_OBIEKT; nr++)
  9813.         {
  9814.             if(Obiekt[nr][oAktywny] == 0)
  9815.             {
  9816.                 Obiekt[nr][oAktywny]    = 1;
  9817.                 Obiekt[nr][oModel]      = model;
  9818.                 Obiekt[nr][oVir]        = GetPlayerVirtualWorld(playerid);
  9819.                 Obiekt[nr][oTyp]        = 0; // obiekt nie jest bramą
  9820.                 //edycja tekstury
  9821.                 strmid(Obiekt[Obiekt(playerid)][oMatTxdname], " ", 0, 32, 32);
  9822.                 strmid(Obiekt[Obiekt(playerid)][oMatTexture], " ", 0, 32, 32);
  9823.                 Obiekt[Obiekt(playerid)][oMatModel] = 0;
  9824.                 Obiekt[Obiekt(playerid)][oMatIndex] = 0;
  9825.                 GetPlayerPos(playerid, Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ]);
  9826.                 MapObiekt[nr] = CreateDynamicObject(Obiekt[nr][oModel], Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ], Obiekt[nr][oRotX], Obiekt[nr][oRotY], Obiekt[nr][oRotZ], Obiekt[nr][oVir]);
  9827.                 ZapiszObiekt(nr);
  9828.                 setObiekt(playerid, nr);
  9829.                 EditDynamicObject(playerid, MapObiekt[nr]);
  9830.                 break;
  9831.             }
  9832.         }
  9833.         return 1;
  9834.     }
  9835.     for(new p = 0; p < MAX_DRZWI; p++)
  9836.     {
  9837.         if(Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
  9838.         {
  9839.             if(pDrzwi(playerid, p) != 0)
  9840.             {
  9841.                 if(DoorObject(p) >= Drzwi[p][dObiekty])
  9842.                     return Info(playerid, "Przekroczyłeś dopuszczalną ilość stworzonych obiektów w tych drzwiach.");
  9843.                 for(new nr = 1; nr < MAX_OBIEKT; nr++)
  9844.                 {
  9845.                     if(Obiekt[nr][oAktywny] == 0)
  9846.                     {
  9847.                         Obiekt[nr][oAktywny]    = 1;
  9848.                         Obiekt[nr][oModel]      = model;
  9849.                         Obiekt[nr][oVir]        = GetPlayerVirtualWorld(playerid);
  9850.                         Obiekt[nr][oTyp]        = 0; // obiekt nie jest bramą
  9851.                         GetPlayerPos(playerid, Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ]);
  9852.                         MapObiekt[nr] = CreateDynamicObject(Obiekt[nr][oModel], Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ], Obiekt[nr][oRotX], Obiekt[nr][oRotY], Obiekt[nr][oRotZ], Obiekt[nr][oVir]);
  9853.                         ZapiszObiekt(nr);
  9854.                         EditDynamicObject(playerid, MapObiekt[nr]);
  9855.                         break;
  9856.                     }
  9857.                 }
  9858.             }
  9859.             else
  9860.             {
  9861.                 Info(playerid, "Nie jesteś właścicielem tych drzwi.");
  9862.             }
  9863.             break;
  9864.         }
  9865.         if(p >= MAX_DRZWI - 1)
  9866.             return InfoBoxShow(2, playerid, "Nie znajdujesz sie w zadnym z ~y~budynkow~w~.", 3);
  9867.     }
  9868.     return 1;
  9869. }
  9870.  
  9871. CMD:md(playerid, params[])
  9872. {
  9873.     if(Obiekt(playerid) == 0)
  9874.         return Tip(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  9875.     CancelEdit(playerid), SetPVarInt(playerid, "objectedit", 0);
  9876.     DestroyDynamicObject(MapObiekt[Obiekt(playerid)]);
  9877.     Obiekt[Obiekt(playerid)][oAktywny]  = 0;
  9878.     format(String, sizeof(String), "Obiekty/%d.ini", Obiekt(playerid));
  9879.     setObiekt(playerid, 0);
  9880.     InfoBoxShow(2, playerid, "Edycja obiektow zostala ~r~zakonczona~w~.", 3);
  9881.     ClearAnimations(playerid);
  9882.     return DOF2_RemoveFile(String);
  9883. }
  9884.  
  9885. CMD:msel(playerid, params[])
  9886. {
  9887.     if((Player[playerid][pAdmin] & ADMIN_PERM_GROUP))
  9888.     {
  9889.         if(GetPVarInt(playerid, "objectedit") == 0)
  9890.             return SelectObject(playerid), SetPVarInt(playerid, "objectedit", 1);
  9891.         return CancelEdit(playerid), Tip(playerid, "Edycja obiektów zakończona."), SetPVarInt(playerid, "objectedit", 0);
  9892.     }
  9893.     for(new p = 0; p < MAX_DRZWI; p++)
  9894.     {
  9895.         if(Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
  9896.         {
  9897.             if(pDrzwi(playerid, p) != 0)
  9898.             {
  9899.                 if(GetPVarInt(playerid, "objectedit") == 0)
  9900.                     return SelectObject(playerid), SetPVarInt(playerid, "objectedit", 1);
  9901.                 return CancelEdit(playerid), Tip(playerid, "Edycja obiektów zakończona."), SetPVarInt(playerid, "objectedit", 0);
  9902.             }
  9903.             else
  9904.             {
  9905.                 Info(playerid, "Nie jesteś właścicielem tych drzwi.");
  9906.             }
  9907.             break;
  9908.         }
  9909.         if(p >= MAX_DRZWI - 1)
  9910.             return InfoBoxShow(2, playerid, "Nie znajdujesz sie w zadnym z ~y~budynkow~w~.", 3);
  9911.     }
  9912.     return 1;
  9913. }
  9914.  
  9915.  
  9916. CMD:mmat(playerid, params[])
  9917. {
  9918.     if(Obiekt(playerid) == 0)
  9919.         return Tip(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  9920.     new materialindex, modelid, txdname[128], texturename[128];
  9921.     if(sscanf(params, "dds[128]s[128]", materialindex, modelid, txdname, texturename))
  9922.         return Tip(playerid, "/mmat [index] [model] [txdname] [texturename]");
  9923.     InfoBoxShow(2, playerid, "Tekstura zostala nalozona na ~y~obiekt~w~.", 3);
  9924.     strmid(Obiekt[Obiekt(playerid)][oMatTxdname], txdname, 0, 32, 32);
  9925.     strmid(Obiekt[Obiekt(playerid)][oMatTexture], texturename, 0, 32, 32);
  9926.     Obiekt[Obiekt(playerid)][oMatModel] = modelid;
  9927.     Obiekt[Obiekt(playerid)][oMatIndex] = materialindex;
  9928.     ZapiszObiekt(Obiekt(playerid));
  9929.     return SetDynamicObjectMaterial(Obiekt(playerid), materialindex, modelid, txdname,  texturename, 0xFFFFFFFF);
  9930. }
  9931.  
  9932. //
  9933. CMD:d(playerid, params[])
  9934. {
  9935.     new wiadomosc[200];
  9936.     if(Sluzba(playerid) == 0 || !(Grupa[Sluzba(playerid)][gFlagPerm] & G_FLAG_DEPARTMENT)) return InfoBoxShow(2, playerid, "Musisz byc na sluzbie ~y~grupy~w~, ktora ma uprawnienia do korzystania z czatu departamentowego.", 3);
  9937.     if(sscanf(params, "s[200]", wiadomosc))
  9938.         return Tip(playerid, "/d [wiadomość]");
  9939.     format(String, sizeof(String),"%s (słuchawka): %s", CharName(playerid), wiadomosc);
  9940.     PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  9941.     foreach(Player, p)
  9942.     {
  9943.         if((Grupa[Sluzba(p)][gFlagPerm] & G_FLAG_DEPARTMENT))
  9944.         {
  9945.             format(String, sizeof(String), "** (%s) %s: %s **", Grupa[Sluzba(playerid)][gTag], CharName(playerid), wiadomosc);
  9946.             SendClientMessage(p, 0x41B51AFF, String);
  9947.         }
  9948.     }
  9949.     return 1;
  9950. }
  9951.  
  9952. CMD:ame(playerid, params[])
  9953. {
  9954.     new desc[128];
  9955.     if(sscanf(params, "s[128]", desc))
  9956.         return Tip(playerid, "/ame [Akcja]");
  9957.     if(strlen(desc) > 120 || strlen(desc) < 30)
  9958.         return Info(playerid, "Opis powinien mieć od 30 do 120 znaków.");
  9959.     desc[0] = chrtolower(desc[0]);
  9960.     format(String, sizeof(String), "** %s **", WordWrap(desc, 7));
  9961.     return UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pAme], COLOR_PURPLE, String), SetPVarInt(playerid, "rpAme", gettime()+5);
  9962. }
  9963.  
  9964. CMD:me(playerid, params[])
  9965. {
  9966.     new text[128], string[256];
  9967.     if(sscanf(params, "s[128]", text))
  9968.     {
  9969.         Tip(playerid, "/me [Akcja]");
  9970.         return 1;
  9971.     }
  9972.     text[0] = chrtolower(text[0]);
  9973.  
  9974.     if(strlen(text) < 78)
  9975.     {
  9976.         format(string, sizeof(string), "** %s %s", CharName(playerid), text);
  9977.         ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  9978.     }
  9979.     else
  9980.     {
  9981.         new pos = strfind(text, " ", true, strlen(text) / 2);
  9982.         if(pos != -1)
  9983.         {
  9984.             new text2[64];
  9985.  
  9986.             strmid(text2, text, pos + 1, strlen(text));
  9987.             strdel(text, pos, strlen(text));
  9988.  
  9989.             format(string, sizeof(string), "** %s %s ...", CharName(playerid), text);
  9990.             ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  9991.  
  9992.             format(string, sizeof(string), "            ...%s", text2);
  9993.             ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  9994.         }
  9995.     }
  9996.     return 1;
  9997. }
  9998.  
  9999. CMD:ja(playerid, params[]) return cmd_me(playerid, params);
  10000.  
  10001. CMD:do(playerid, params[])
  10002. {
  10003.     new text[128], string[256];
  10004.     if(sscanf(params, "s[128]", text))
  10005.     {
  10006.         Tip(playerid, "/do [Sytuacja]");
  10007.         return 1;
  10008.     }
  10009.     text[0] = chrtoupper(text[0]);
  10010.  
  10011.     if(strlen(text) < 78)
  10012.     {
  10013.         format(string, sizeof(string), "** %s (( %s ))", text, CharName(playerid));
  10014.         ProxDetector(10.0, playerid, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
  10015.     }
  10016.     else
  10017.     {
  10018.         new pos = strfind(text, " ", true, strlen(text) / 2);
  10019.         if(pos != -1)
  10020.         {
  10021.             new text2[64];
  10022.  
  10023.             strmid(text2, text, pos + 1, strlen(text));
  10024.             strdel(text, pos, strlen(text));
  10025.  
  10026.             format(string, sizeof(string), "** %s...", text);
  10027.             ProxDetector(10.0, playerid, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
  10028.  
  10029.             format(string, sizeof(string), "            ...%s (( %s ))", text2, CharName(playerid));
  10030.             ProxDetector(10.0, playerid, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
  10031.         }
  10032.     }
  10033.     return 1;
  10034. }
  10035.  
  10036. CMD:sprobuj(playerid, params[])
  10037. {
  10038.     new text[128], string[256];
  10039.     if(sscanf(params, "s[128]", text))
  10040.     {
  10041.         Tip(playerid, "/sprobuj [Akcja np. podnieść teczkę]");
  10042.         return 1;
  10043.     }
  10044.     new loss = random(2);
  10045.     switch(loss)
  10046.     {
  10047.         case 0:
  10048.         {
  10049.             if(Player[playerid][pSex] == CHAR_SEX_MALE)
  10050.             {
  10051.                 format(string, sizeof(string), "*** %s zawiódł próbując %s", CharName(playerid), text);
  10052.                 ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10053.             }
  10054.             else
  10055.             {
  10056.                 format(string, sizeof(string), "*** %s zawiodła próbując %s", CharName(playerid), text);
  10057.                 ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10058.             }
  10059.         }
  10060.         case 1:
  10061.         {
  10062.             if(Player[playerid][pSex] == CHAR_SEX_MALE)
  10063.             {
  10064.                 format(string, sizeof(string), "*** %s odniósł sukces próbując %s", CharName(playerid), text);
  10065.                 ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10066.             }
  10067.             else
  10068.             {
  10069.                 format(string, sizeof(string), "*** %s odniosła sukces próbując %s", CharName(playerid), text);
  10070.                 ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10071.             }
  10072.         }
  10073.     }
  10074.     return 1;
  10075. }
  10076.  
  10077.  
  10078. CMD:a(playerid, params[])
  10079. {
  10080.     new adm[64], list[512], admin = 0;
  10081.     foreach(Player, p)
  10082.     {
  10083.         if(Status(p) == 2)
  10084.         {
  10085.             if(GetPVarInt(p, "Grupa") == 4)
  10086.             format(adm, sizeof(adm), "%d\t{BB0000}Administrator\t{FFFFFF}%d\t%s", p, 0, CharName(p));
  10087.             else
  10088.             format(adm, sizeof(adm), "%d\t{0D7715}GameMaster\t{FFFFFF}%d\t%s", p, 0, CharName(p));
  10089.             format(list, sizeof(list), "%s%s\n", list, adm);
  10090.             admin++;
  10091.         }
  10092.     }
  10093.     if(admin == 0) return InfoBoxShow(2, playerid, "Brak ~r~administratorow~w~ na sluzbie.", 3);
  10094.     return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Administracja", list, "Wybierz", "Anuluj");
  10095. }
  10096.  
  10097. CMD:paczka(playerid, params[])
  10098. {
  10099.     if(Player[playerid][pJob] != 2)
  10100.         return InfoBoxShow(2, playerid, "Ta komenda przeznaczona jest dla ~y~kurierow~w~, Twoja ~y~postac~w~ nie moze pobierac ~y~paczek~w~.", 3);
  10101.     if(GetPVarInt(playerid, "rpPaczka") == 0)
  10102.     {
  10103.         if(InDoor(playerid) != 5)
  10104.         {
  10105.             InfoBoxShow(2, playerid, "Nie znajdujesz sie w ~y~magazynie~w~. System zaznaczyl Ci ~y~budynek~w~, do ktorego masz sie udac na mapie.", 3);
  10106.             return SetPlayerMapIcon(playerid, 0, Drzwi[5][dZewPosX], Drzwi[5][dZewPosY], Drzwi[5][dZewPosZ], 51, 0, MAPICON_GLOBAL_CHECKPOINT);
  10107.         }
  10108.         new paczki = 0, pack[64], list[1024];
  10109.         for(new i = 0; i < MAX_ITEM; i++)
  10110.         {
  10111.             if(Paczka[i][pAktywna] == 1 && Paczka[i][pDostarcza] == 0)
  10112.             {
  10113.                 ListItem[playerid][paczki] = i;
  10114.                 new typ = Paczka[i][pTyp];
  10115.                 if(typ == 1 || typ == 6 || typ == 9 || typ == 14 || typ == 15)
  10116.                 format(pack, sizeof(pack), "%d\t{F0F2C8}%s{FFFFFF}", i, Drzwi[Paczka[i][pDoor]][dNazwa]);
  10117.                 else
  10118.                 format(pack, sizeof(pack), "{FFFFFF}%d\t%s{FFFFFF}", i, Drzwi[Paczka[i][pDoor]][dNazwa]);
  10119.                 format(list, sizeof(list), "%s%s\n", list, pack);
  10120.                 paczki++;
  10121.             }
  10122.         }
  10123.         if(paczki == 0)
  10124.             return InfoBoxShow(2, playerid, "W ~y~magazynie~w~ nie odnaleziono zadnych paczek, ktore oczekuja na dostarczenie.", 3);
  10125.         return dShowPlayerDialog(playerid, 2501, DIALOG_STYLE_LIST, ""ServName"Paczki", list, "Wybierz", "Anuluj");
  10126.     }
  10127.     if(InDoor(playerid) == Paczka[GetPVarInt(playerid, "rpPaczka")][pDoor])
  10128.     {
  10129.         new p = GetPVarInt(playerid, "rpPaczka");
  10130.         if(Paczka[p][pAktywna] == 1)
  10131.         {
  10132.             new powtorzenia = 0, ilosc, cena, cash;
  10133.             for(new nr = 1; nr < MAX_ITEM; nr++)
  10134.             {
  10135.                 if(Przedmiot[nr][iAktywny] == 0)
  10136.                 {
  10137.                     ilosc = Paczka[p][pIlosc], cena = Paczka[p][pPrice];
  10138.                     cash = ilosc*cena;
  10139.                     Przedmiot[nr][iAktywny]     = 1;
  10140.                     Przedmiot[nr][iTyp]         = Paczka[p][pTyp];
  10141.                     Przedmiot[nr][iWartosc1]    = Paczka[p][pValue1];
  10142.                     Przedmiot[nr][iWartosc2]    = Paczka[p][pValue2];
  10143.                     Przedmiot[nr][iWartosc3]    = Paczka[p][pValue3];
  10144.                     Przedmiot[nr][iOwner]       = Paczka[p][pOwner];
  10145.                     Przedmiot[nr][iOwnerUID]    = Paczka[p][pOwnerUID];
  10146.                     Przedmiot[nr][iWaga]        = Paczka[p][pWaga];
  10147.                     Przedmiot[nr][iUsed]        = 0;
  10148.                     Przedmiot[nr][iVir]         = 0;
  10149.                     Przedmiot[nr][iPrice]       = Paczka[p][pPrice];
  10150.                     Przedmiot[nr][iFlaga]       = Paczka[p][pFlaga];
  10151.                     Przedmiot[nr][iFlagaUID]    = Paczka[p][pFlagaUID];
  10152.                     strmid(Przedmiot[nr][iNazwa],  Paczka[p][pNazwa], 0, 64, 64);
  10153.                     ZapiszPrzedmiot(nr);
  10154.                     powtorzenia++;
  10155.                     if(powtorzenia == Paczka[p][pIlosc])
  10156.                     {
  10157.                         Paczka[p][pAktywna] = 0;
  10158.                         Paczka[p][pDostarcza] = 0;
  10159.                         break;
  10160.                     }
  10161.                 }
  10162.             }
  10163.             RemovePlayerMapIcon(playerid, 0);
  10164.             SetPVarInt(playerid, "rpPaczka", 0);
  10165.             if(GetPVarInt(playerid, "rpSpecialPack") == 0)
  10166.             {
  10167.                 if(cash > 0 && cash <= 100)
  10168.                     return sKasa(playerid, 10), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~10~w~ za dostarczenie paczki.", 3);
  10169.                 else if(cash > 100 && cash <= 200)
  10170.                     return sKasa(playerid, 20), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~20~w~ za dostarczenie paczki.", 3);
  10171.                 else if(cash > 200 && cash <= 500)
  10172.                     return sKasa(playerid, 30), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~30~w~ za dostarczenie paczki.", 3);
  10173.                 else if(cash > 500)
  10174.                     return sKasa(playerid, 40), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~40~w~ za dostarczenie paczki.", 3);
  10175.             }
  10176.             else
  10177.             {
  10178.                 if(cash > 0 && cash <= 100)
  10179.                     return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 15/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 15, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~15~w~ za dostarczenie paczki.", 3);
  10180.                 else if(cash > 100 && cash <= 200)
  10181.                     return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 25/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 25, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~25~w~ za dostarczenie paczki.", 3);
  10182.                 else if(cash > 200 && cash <= 500)
  10183.                     return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 35/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 35, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~35~w~ za dostarczenie paczki.", 3);
  10184.                 else if(cash > 500)
  10185.                     return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 45/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 45, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~45~w~ za dostarczenie paczki.", 3);
  10186.             }
  10187.         }
  10188.     }
  10189.     else
  10190.     {
  10191.         InfoBoxShow(2, playerid, "Aby dostarczyc ~y~paczke~w~ musisz znajdowac sie we wnetrzu budynku, do ktorego jest ona zaadresowana.", 6);
  10192.     }
  10193.     return 1;
  10194. }
  10195.  
  10196. CMD:wedkuj(playerid, params[])
  10197. {
  10198.     if(GetPVarInt(playerid, "rpWedka1") != 0)
  10199.         return Tip(playerid, "Łowisz już ryby");
  10200.     for(new nr = 1; nr < MAX_ITEM; nr++)
  10201.     {
  10202.         if(Przedmiot[nr][iTyp] == 21 && Przedmiot[nr][iAktywny] == 1)
  10203.         {
  10204.             if(Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
  10205.             {
  10206.                 if(Przedmiot[nr][iWartosc2] == 3 && Przedmiot[nr][iUsed] == 1)
  10207.                 {
  10208.                     SetPVarInt(playerid, "rpWedka1", nr);
  10209.                     SetPVarInt(playerid, "rpWedka2", gettime()+60);
  10210.                     SetPVarInt(playerid, "rpWedka3", 0);
  10211.                     break;
  10212.                 }
  10213.             }
  10214.         }
  10215.         if(nr == MAX_ITEM -1)
  10216.             return InfoBoxShow(2, playerid, "Aby moc ~y~lowic~w~ ryby, musisz miec w uzyciu wedke.", 6);
  10217.     }
  10218.     return ApplyAnimation(playerid, "SWORD", "sword_block", 50.0, 0, 1, 0, 1, 1);
  10219. }
  10220.  
  10221. CMD:id(playerid, params[])
  10222. {
  10223.     if(isnull(params)) return Tip(playerid, "/id [część nicku]");
  10224.     new player[64], list[1024];
  10225.     for(new i = 0; i < MAX_PLAYERS; i ++)
  10226.     {
  10227.         if(Login(i))
  10228.         {
  10229.             if(strfind(NickSAMP(i), params, false, 0) != -1)
  10230.             {
  10231.                 format(player, sizeof(player), "%d\t%s", i, CharName(i));
  10232.                 format(list, sizeof(list), "%s%s\n", list, player);
  10233.             }
  10234.             if(i == MAX_PLAYERS - 1)
  10235.                 return InfoBoxShow(2, playerid, "~r~Nie odnaleziono~w~ zadnego ~y~gracza~w~.", 6);
  10236.         }
  10237.     }
  10238.     return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Gracze", list, "Wybierz", "Anuluj");
  10239. }
  10240.  
  10241. CMD:pokoj(playerid, params[])
  10242. {
  10243.     return cmd_hotel(playerid, params);
  10244. }
  10245.  
  10246. CMD:praca(playerid, params[])
  10247. {
  10248.     if(InDoor(playerid) == 18)
  10249.     {
  10250.         dShowPlayerDialog(playerid, 997, DIALOG_STYLE_LIST, ""ServName"Praca dorywcza", "1\tMechanik\n2\tKurier\n3\tRybak", "Wybierz", "Anuluj");
  10251.     }
  10252.     else
  10253.     {
  10254.         Info(playerid, "Aby podjąć pracę, musisz znajdować się w budynku urzędu miasta.");
  10255.     }
  10256.     return 1;
  10257. }
  10258.  
  10259. CMD:hotel(playerid, params[])
  10260. {
  10261.     new sub[80],rest[80];
  10262.     if(sscanf(params, "s[80]S()[80]", sub, rest))
  10263.         return Tip(playerid, "/hotel [zamelduj, wymelduj, wejdz, wyjdz, info]");
  10264.     if(InDoor(playerid) == 0)
  10265.         return InfoBoxShow(2, playerid, "Aby wynajac pokoj, musisz znajdowac sie w ~y~budynku~w~.", 3);
  10266.     if(Drzwi[InDoor(playerid)][dOwner] == 2)
  10267.     {
  10268.         if(Grupa[Drzwi[InDoor(playerid)][dOwnerUID]][gTyp] != 10)
  10269.             return InfoBoxShow(2, playerid, "~y~Budynek~w~, w ktorym sie znajdujesz ~r~nie jest podpisany~w~ pod skrypt hotelu.", 3);
  10270.     }
  10271.     else
  10272.     {
  10273.         return InfoBoxShow(2, playerid, "~y~Budynek~w~, w ktorym sie znajdujesz ~r~nie jest podpisany~w~ pod skrypt hotelu.", 3);
  10274.     }
  10275.     if(!strcmp(sub, "zamelduj"))
  10276.     {
  10277.         new nazwa[16];
  10278.         if(sscanf(rest, "s[16]", nazwa))
  10279.             return Tip(playerid, "/hotel zamelduj [maly, sredni, duzy]");
  10280.         if(Player[playerid][pSpawn] == 2 && Player[playerid][pSpawnID] == InDoor(playerid))
  10281.             return Info(playerid, "Jesteś już zameldowany w tym hotelu.");
  10282.         Player[playerid][pSpawn] = 2;
  10283.         Player[playerid][pSpawnID] = InDoor(playerid);
  10284.         if(!strcmp(rest, "maly"))
  10285.         {
  10286.             SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
  10287.             SetPlayerInterior(playerid, IntArray2[49][0]);
  10288.             SetPlayerPos(playerid, IntArray[49][0], IntArray[49][1], IntArray[49][2]);
  10289.             SetPlayerFacingAngle(playerid, IntArray[49][3]);
  10290.             Player[playerid][pSpawnTyp] = 1;
  10291.             InfoBoxShow(2, playerid, "Swietnie! ~y~Zameldowales~w~ sie w hotelu, od teraz co noc z Twojego konta bedzie pobierana oplata w kwocie ~g~$~y~10~w~ za wynajecie pokoju.", 5);
  10292.         }
  10293.         else if(!strcmp(rest, "sredni"))
  10294.         {
  10295.             SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
  10296.             SetPlayerInterior(playerid, IntArray2[58][0]);
  10297.             SetPlayerPos(playerid, IntArray[58][0], IntArray[58][1], IntArray[58][2]);
  10298.             SetPlayerFacingAngle(playerid, IntArray[58][3]);
  10299.             Player[playerid][pSpawnTyp] = 2;
  10300.             InfoBoxShow(2, playerid, "Swietnie! ~y~Zameldowales~w~ sie w hotelu, od teraz co noc z Twojego konta bedzie pobierana oplata w kwocie ~g~$~y~20~w~ za wynajecie pokoju.", 5);
  10301.         }
  10302.         else if(!strcmp(rest, "duzy"))
  10303.         {
  10304.             Player[playerid][pSpawnTyp] = 3;
  10305.             InfoBoxShow(2, playerid, "Swietnie! ~y~Zameldowales~w~ sie w hotelu, od teraz co noc z Twojego konta bedzie pobierana oplata w kwocie ~g~$~y~30~w~ za wynajecie pokoju.", 5);
  10306.         }
  10307.         format(String, sizeof(String), "* %s odebrał klucz do pokoju od recepcjonisty.", CharName(playerid));
  10308.         return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10309.     }
  10310.     else if(!strcmp(sub, "wymelduj"))
  10311.     {
  10312.         if(Player[playerid][pSpawn] == 2)
  10313.         {
  10314.             if(Player[playerid][pSpawnID] != InDoor(playerid))
  10315.                 return Info(playerid, "Nie jesteś zameldowany w tym hotelu.");
  10316.             Player[playerid][pSpawn]    = 0;
  10317.             Player[playerid][pSpawnID]  = 0;
  10318.         }
  10319.         else
  10320.         {
  10321.             Info(playerid, "Nie jesteś zameldowany w hotelu.");
  10322.         }
  10323.         return 1;
  10324.     }
  10325.     else if(!strcmp(sub, "info"))
  10326.     {
  10327.         //informacje
  10328.         return 1;
  10329.     }
  10330.     else if(!strcmp(sub, "wejdz"))
  10331.     {
  10332.         if(Player[playerid][pSpawn] == 2)
  10333.         {
  10334.             if(Player[playerid][pSpawnID] == InDoor(playerid))
  10335.             {
  10336.                 format(String, sizeof(String), "* %s wszedł do pokoju hotelowego.", CharName(playerid)), ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10337.                 if(Player[playerid][pSpawnTyp] == 1)
  10338.                 {
  10339.                     SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
  10340.                     SetPlayerInterior(playerid, IntArray2[49][0]);
  10341.                     SetPlayerPos(playerid, IntArray[49][0], IntArray[49][1], IntArray[49][2]);
  10342.                     return SetPlayerFacingAngle(playerid, IntArray[49][3]);
  10343.                 }
  10344.                 else if(Player[playerid][pSpawnTyp] == 2)
  10345.                 {
  10346.  
  10347.                 }
  10348.                 else if(Player[playerid][pSpawnTyp] == 3)
  10349.                 {
  10350.  
  10351.                 }
  10352.             }
  10353.             else
  10354.             {
  10355.                 Info(playerid, "Nie wynajmujesz pokoju w tym hotelu.");
  10356.             }
  10357.         }
  10358.         else
  10359.         {
  10360.             Info(playerid, "Budynek, w którym się znajdujesz nie jest własnością grupy.");
  10361.         }
  10362.         return 1;
  10363.     }
  10364.     else if(!strcmp(sub, "wyjdz"))
  10365.     {
  10366.         if(Player[playerid][pSpawn] == 2)
  10367.         {
  10368.             if(Player[playerid][pSpawnTyp] == 1)
  10369.             {
  10370.                 if(GetPlayerInterior(playerid) == IntArray2[49][0] && GetPlayerVirtualWorld(playerid) == Player[playerid][pUID]+1000)
  10371.                 {
  10372.                     //wychodzenie
  10373.                 }
  10374.                 else
  10375.                 {
  10376.                     Info(playerid, "Nie znajdujesz się w pokoju hotelowym.");
  10377.                 }
  10378.             }
  10379.             if(Player[playerid][pSpawnTyp] == 2)
  10380.             {
  10381.                 if(GetPlayerInterior(playerid) == IntArray2[58][0] && GetPlayerVirtualWorld(playerid) == Player[playerid][pUID]+1000)
  10382.                 {
  10383.                     //wychodzenie
  10384.                 }
  10385.                 else
  10386.                 {
  10387.                     Info(playerid, "Nie znajdujesz się w pokoju hotelowym.");
  10388.                 }
  10389.             }
  10390.             else if(Player[playerid][pSpawnTyp] == 3)
  10391.             {
  10392.                 if(GetPlayerInterior(playerid) == IntArray2[49][0] && GetPlayerVirtualWorld(playerid) == Player[playerid][pUID]+1000)
  10393.                 {
  10394.                     //wychodzenie
  10395.                 }
  10396.                 else
  10397.                 {
  10398.                     Info(playerid, "Nie znajdujesz się w pokoju hotelowym.");
  10399.                 }
  10400.             }
  10401.             return 1;
  10402.         }
  10403.         else
  10404.         {
  10405.             Info(playerid, "Nie jesteś zameldowany w hotelu.");
  10406.         }
  10407.         return 1;
  10408.     }
  10409.     return 1;
  10410. }
  10411.  
  10412. CMD:premium(playerid, params[])
  10413. {
  10414.     new premiumInfo[2048], info[1024];
  10415.     if(!strcmp(params, "zakup"))
  10416.     {
  10417.         strcat(info, "Witaj w panelu usług premium.\nMożesz tutaj zamienić swoje GameScore na wirtualne €.\nDzięki nim będziesz mógł skorzystać z całej gamy usług, które Ci oferujemy!\n\n", sizeof(info));
  10418.         strcat(info, "{B3D341}Pakiet 1:{AAC5E3} 10 wirtualnych € za 300 punktów GameScore.\n", sizeof(info));
  10419.         strcat(info, "{B3D341}Pakiet 2:{AAC5E3} 25 wirtualnych € za 600 punktów GameScore.\n", sizeof(info));
  10420.         strcat(info, "{B3D341}Pakiet 3:{AAC5E3} 50 wirtualnych € za 1100 punktów GameScore.\n", sizeof(info));
  10421.         strcat(info, "\nW poniższym okienku wpisz idetyfikator pakietu, który chcesz zakupić.\nPamiętaj, że decyzja jest nieodwołalna.\n", sizeof(info));
  10422.         return dShowPlayerDialog(playerid, 56, DIALOG_STYLE_INPUT, ""ServName"Usługi premium", info, "Wybierz", "Anuluj");
  10423.     }
  10424.     else if(!strcmp(params, "przekaz"))
  10425.     {
  10426.         return 1;
  10427.     }
  10428.     else if(!strcmp(params, "info"))
  10429.     {
  10430.         strcat(info, "\t{B3D341}»{AAC5E3} Konto premium (7 dni).\n", sizeof(info));
  10431.         strcat(info, "\t{B3D341}»{AAC5E3} Konto premium (14 dni).\n", sizeof(info));
  10432.         strcat(info, "\t{B3D341}»{AAC5E3} Konto premium (31 dni).\n", sizeof(info));
  10433.         strcat(info, "\t{B3D341}»{AAC5E3} Stworzenie przedmiotu.\n", sizeof(info));
  10434.         strcat(info, "\t{B3D341}»{AAC5E3} Blokada postaci.\n", sizeof(info));
  10435.         strcat(info, "\t{B3D341}»{AAC5E3} Edycja profilu CSS i HTML.\n", sizeof(info));
  10436.         strcat(info, "\t{B3D341}»{AAC5E3} Stworzenie nowej grupy.\n", sizeof(info));
  10437.         strcat(info, "\t{B3D341}»{AAC5E3} 10 etykiet tekstowych.\n", sizeof(info));
  10438.         strcat(info, "\t{B3D341}»{AAC5E3} Zmiana tożsamości.\n", sizeof(info));
  10439.         strcat(info, "\t{B3D341}»{AAC5E3} Usunięcie postaci.\n", sizeof(info));
  10440.         strcat(info, "\t{B3D341}»{AAC5E3} Własny interior.\n", sizeof(info));
  10441.         strcat(info, "\t{B3D341}»{AAC5E3} Pakiet obiektów #25.\n", sizeof(info));
  10442.  
  10443.         format(premiumInfo, 1024, "Za pomocą opcji komendy /premium możesz zakupić wirtualne € za GameScore.\nPosiadanie wirtualnych € pozwala Ci na szereg opcji Premium.\nLista dostępnych usług:\n\n%s", info);
  10444.         return Info(playerid, premiumInfo);
  10445.     }
  10446.     else if(!strcmp(params, "aktywuj"))
  10447.     {
  10448.         new uslugi = 0;
  10449.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_1))
  10450.             uslugi ++, format(info, sizeof(info), "%s»\tKonto premium (7 dni)\n", info);
  10451.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_2))
  10452.             uslugi ++, format(info, sizeof(info), "%s»\tKonto premium (14 dni)\n", info);
  10453.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_3))
  10454.             uslugi ++, format(info, sizeof(info), "%s»\tKonto premium (31 dni)\n", info);
  10455.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_4))
  10456.             uslugi ++, format(info, sizeof(info), "%s»\tStworzenie przedmiotu\n", info);
  10457.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_5))
  10458.             uslugi ++, format(info, sizeof(info), "%s»\tBlokada postaci\n", info);
  10459.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_6))
  10460.             uslugi ++, format(info, sizeof(info), "%s»\tEdycja profilu CSS i HTML\n", info);
  10461.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_7))
  10462.             uslugi ++, format(info, sizeof(info), "%s»\tStworzenie nowej grupy\n", info);
  10463.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_8))
  10464.             uslugi ++, format(info, sizeof(info), "%s»\t10 etykiet tekstowych\n", info);
  10465.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_9))
  10466.             uslugi ++, format(info, sizeof(info), "%s»\tZmiana tożsamości\n", info);
  10467.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_10))
  10468.             uslugi ++, format(info, sizeof(info), "%s»\tUsunięcie postaci\n", info);
  10469.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_11))
  10470.             uslugi ++, format(info, sizeof(info), "%s»\tWłasny interior\n", info);
  10471.         if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_12))
  10472.             uslugi ++, format(info, sizeof(info), "%s»\tPakiet obiektów #25\n", info);
  10473.  
  10474.         return dShowPlayerDialog(playerid, 57, DIALOG_STYLE_LIST, ""ServName"Usługi premium", info, "Aktywuj", "Anuluj");
  10475.         //usługa wybierana za pomocą zmiennej ListItem
  10476.     }
  10477.     Tip(playerid, "/premium [zakup, przekaz, aktywuj, info]");
  10478.     return dShowPlayerDialog(playerid, 55, DIALOG_STYLE_LIST, ""ServName"Usługi premium", "1\t€10\tKonto premium (7 dni)\n2\t€19\tKonto premium (14 dni)\n3\t€27\tKonto premium (31 dni)\n4\t€4\tStworzenie przedmiotu\n5\t€7\tBlokada postaci\n6\t€5\tEdycja profilu CSS i HTML\n7\t€10\tStworzenie nowej grupy\n8\t€8\t10 etykiet tekstowych\n9\t€10\tZmiana tożsamości\n10\t€8\tUsunięcie postaci\n11\t€4\tWłasny interior\n12\t€0\tPakiet obiektów #25", "Wybierz", "Anuluj");
  10479. }
  10480.  
  10481. CMD:stats(playerid, params[])
  10482. {
  10483.     new gracz = playerid;
  10484.     if(GetPVarInt(playerid, "Grupa") == 4)
  10485.     {
  10486.         if(!sscanf(params, "u", gracz))
  10487.         if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  10488.     }
  10489.     new timexo[3], stats[3000], postac[128], timex[3], grupy[256], grupa[64], other[256], jobs[16], zone = PlayerInZone(gracz), strefa[32], drzwi[16];
  10490.  
  10491.     if(Player[gracz][pJob] == 1)
  10492.     {
  10493.         format(jobs, sizeof(jobs), "Mechanik");
  10494.     }
  10495.     else if(Player[gracz][pJob] == 2)
  10496.     {
  10497.         format(jobs, sizeof(jobs), "Kurier");
  10498.     }
  10499.     else if(Player[gracz][pJob] == 3)
  10500.     {
  10501.         format(jobs, sizeof(jobs), "Rybak");
  10502.     }
  10503.     else
  10504.     {
  10505.         format(jobs, sizeof(jobs), "Brak");
  10506.     }
  10507.  
  10508.     format(postac, sizeof(postac), "{FFFFFF}%s (%s, %d, %d) [%s]", CharName(gracz), Player[gracz][pName], Player[gracz][pUID], Player[gracz][pGID], Player[gracz][pIP]);
  10509.     FullTime(Player[gracz][pOnline], timexo[0], timexo[1], timexo[2]);
  10510.     FullTime(Player[gracz][pDutyAll], timex[0], timex[1], timex[2]);
  10511.     new grups = 0;
  10512.     for(new slot = 1; slot < 6; slot++)
  10513.     {
  10514.         if(pGrupa[gracz][slot] != 0 && Grupa[pGrupa[gracz][slot]][gAktywna] == 1)
  10515.         {
  10516.             grups ++;
  10517.             if((pGrupaPerm[playerid][slot] & PERM_LEADER))
  10518.             format(grupa, sizeof(grupa), "\tSlot %d\t\t{AAC5E3}%s (%d){FFFFFF}", slot, Grupa[pGrupa[gracz][slot]][gNazwa], pGrupa[gracz][slot]);
  10519.             else
  10520.             format(grupa, sizeof(grupa), "\tSlot %d\t\t%s (%d)", slot, Grupa[pGrupa[gracz][slot]][gNazwa], pGrupa[gracz][slot]);
  10521.             format(grupy, sizeof(grupy), "%s%s\n", grupy, grupa);
  10522.         }
  10523.     }
  10524.     if(grups != 0)
  10525.     {
  10526.         SetPVarInt(playerid, "GrupyGracza", grups);
  10527.     }
  10528.     format(other, sizeof(other), "\n1\tUkrywanie postaci\n2\tAnimacja chodzenia\n3\tStyl rozmowy\n4\tSzybki komputer\n5\tLicznik prędkości\n6\tStacja radiowa\n7\tWyświetlanie stref");
  10529.     if(!grups)
  10530.     {
  10531.         format(grupy, sizeof(grupy), "\tBrak przynależności"), SetPVarInt(playerid, "GrupyGracza", 1);
  10532.     }
  10533.  
  10534.     new useattachslot = 0;
  10535.     if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_1))
  10536.         useattachslot++;
  10537.     if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_2))
  10538.         useattachslot++;
  10539.     if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_3))
  10540.         useattachslot++;
  10541.     if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_4))
  10542.         useattachslot++;
  10543.     if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_5))
  10544.         useattachslot++;
  10545.  
  10546.     if(zone == 0)
  10547.         format(strefa, 32, "Strefa neutralna");
  10548.         else
  10549.         format(strefa, 32, "%d (%s, %dkm/h)", zone, GangZoneInfo[zone][gNazwa], GangZoneInfo[zone][gSpeed]);
  10550.  
  10551.     if(InDoor(gracz) == 0)
  10552.         format(drzwi, 16, "Poza budynkiem");
  10553.         else
  10554.         format(drzwi, 16, "%d", InDoor(gracz));
  10555.  
  10556.     format(stats, sizeof(stats), "Czas gry:\t\t%dh. i %dm.\nSiła:\t\t\t%dj\nHP:\t\t\t%.0f\nSłużba:\t\t\t%dh. i %dm.\nPieniądze:\t\t$%d\nBank:\t\t\t$%d\nEuro:\t\t\t€%d\nDług:\t\t\t$%d\nStrefa:\t\t\t%s\nDrzwi:\t\t\t%s\nWyjeżdżone:\t\t%.0fkm\nSkin:\t\t\t%d", timexo[0], timexo[1], Player[gracz][pSila], getHP(gracz), timex[0], timex[1], dKasa(gracz), Player[gracz][pBank], IPB[playerid][ipb_PremiumScore], Player[playerid][pDlug], strefa, drzwi, Player[gracz][pWyjezdzone], GetPlayerSkin(playerid));
  10557.     format(stats, sizeof(stats), "%s\nTelefon:\t\t%d\nPraca dorywcza:\t%s\nDoczepione obiekty:\t%d\nGrupy:\n%s\n----%s", stats, Player[playerid][pTelefon], jobs, useattachslot, grupy, other);
  10558.     return dShowPlayerDialog(playerid, 9990, DIALOG_STYLE_LIST, postac, stats, "Wybierz", "Anuluj");
  10559. }
  10560.  
  10561. CMD:pomoc(playerid, params[])
  10562. {
  10563.     new info[1024];
  10564.     strcat(info, "1\tWprowadzenie do gry.\n", sizeof(info));
  10565.     strcat(info, "2\tModuł pojazdów.\n", sizeof(info));
  10566.     strcat(info, "3\tModuł przedmiotów.\n", sizeof(info));
  10567.     strcat(info, "4\tModuł grup.\n", sizeof(info));
  10568.     strcat(info, "5\tModuł drzwi.\n", sizeof(info));
  10569.     strcat(info, "6\tOferty.\n", sizeof(info));
  10570.     return dShowPlayerDialog(playerid, 9992, DIALOG_STYLE_LIST, ""ServName"Pomoc", info, "Wybierz", "Anuluj");
  10571. }
  10572.  
  10573. CMD:akceptujsmierc(playerid, params[])
  10574. {
  10575.     if(Player[playerid][pBW] > 0)
  10576.     {
  10577.         new info[256];
  10578.         DodajPrzedmiot(playerid, Nick(playerid), 17, Player[playerid][pUID], gettime()+86400*2, 7, 0, 80000);
  10579.         if(sscanf(params, "s[256]", info))
  10580.         {
  10581.             return Kara(7, playerid, -1, "-", 9999);
  10582.         }
  10583.         return Kara(7, playerid, -1, info, 9999);
  10584.     }
  10585.     return Tip(playerid, "Twoja postać musi być w stanie BW.");
  10586. }
  10587.  
  10588. //komendy systemu przedmiotów
  10589.  
  10590. CMD:p(playerid, params[])
  10591. {
  10592.     if(isnull(params))
  10593.         return ShowPlayerItem(playerid);
  10594.     if(!strcmp(params, "podnies"))
  10595.     {
  10596.         new Itemy[1024], Item[128], list = 1;
  10597.         for(new p = 0; p < MAX_ITEM; p++)
  10598.         {
  10599.             if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 7)
  10600.             {
  10601.                 if(IsPlayerInRangeOfPoint(playerid, 2.0, Przedmiot[p][iPosX], Przedmiot[p][iPosY], Przedmiot[p][iPosZ]) && GetPlayerVirtualWorld(playerid) == Przedmiot[p][iVir])
  10602.                 {
  10603.                     format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
  10604.                     format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  10605.                     ListItem[playerid][list] = p;
  10606.                     list++;
  10607.                 }
  10608.             }
  10609.         }
  10610.         if(list == 1) return InfoBoxShow(2, playerid, "W okolicy Twojej postaci nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
  10611.         format(Itemy, sizeof(Itemy), "%s", Itemy);
  10612.         return dShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, ""ServName"Przedmioty w pobliżu", Itemy, "Podnies", "Anuluj");
  10613.     }
  10614.     else if(!strcmp(params, "lista"))
  10615.     {
  10616.         if(GetPVarInt(playerid, "Grupa") != 4) return PlayerPlaySound(playerid, 1085, 0, 0, 0);
  10617.         new gracz = -1, Itemy[1024], Item[128], list = 1;
  10618.         if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
  10619.         for(new p = 0; p < MAX_ITEM; p++)
  10620.         {
  10621.             if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[gracz][pUID])
  10622.             {
  10623.                 format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
  10624.                 format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  10625.                 list++;
  10626.             }
  10627.         }
  10628.         if(list == 1) return InfoBoxShow(2, playerid, "Ten gracz nie posiada zadnych ~y~przedmiotow~w~.", 3);
  10629.         format(Itemy, sizeof(Itemy), "%s", Itemy);
  10630.         return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Przedmioty gracza", Itemy, "Rozumiem", "");
  10631.     }
  10632.     for(new i = 0; i < MAX_ITEM; i ++)
  10633.     {
  10634.         if(Przedmiot[i][iAktywny] == 1 && Przedmiot[i][iOwner] == 1 && Przedmiot[i][iOwnerUID] == Player[playerid][pUID])
  10635.         {
  10636.             if(strfind(Przedmiot[i][iNazwa], params, false, 0) != -1)
  10637.                 return UseItem(playerid, i);
  10638.             if(i == MAX_ITEM - 1)
  10639.                 return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
  10640.         }
  10641.     }
  10642.     return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
  10643. }
  10644.  
  10645. CMD:u(playerid, params[])
  10646. {
  10647.     if(GetPVarInt(playerid, "ItemTDPage") != 0)
  10648.     {
  10649.         SetPVarInt(playerid, "ItemTDPage", 0);
  10650.         TextDrawHideForPlayer(playerid, ItemTD0[playerid]);
  10651.         TextDrawHideForPlayer(playerid, ItemTD1[playerid]);
  10652.         TextDrawHideForPlayer(playerid, ItemTD2[playerid]);
  10653.         TextDrawHideForPlayer(playerid, ItemTD3[playerid]);
  10654.         TextDrawHideForPlayer(playerid, ItemTD4[playerid]);
  10655.         TextDrawHideForPlayer(playerid, ItemTD5[playerid]);
  10656.         TextDrawHideForPlayer(playerid, ItemTD6[playerid]);
  10657.         TextDrawHideForPlayer(playerid, ItemTD7[playerid]);
  10658.         TextDrawHideForPlayer(playerid, ItemTD8[playerid]);
  10659.         TextDrawHideForPlayer(playerid, ItemTD9[playerid]);
  10660.         return TextDrawHideForPlayer(playerid, ItemTD10[playerid]);
  10661.     }
  10662.     SetPVarInt(playerid, "ItemTDPage", 1);
  10663.     for(new i = 0; i < 100; i ++)
  10664.     {
  10665.         ListItemTD[playerid][i] = 0;
  10666.     }
  10667.     new found = 0;
  10668.     for(new i = 0; i < MAX_ITEM; i ++)
  10669.     {
  10670.         if(Przedmiot[i][iAktywny] == 1 && Przedmiot[i][iOwner] == 1 && Przedmiot[i][iOwnerUID] == Player[playerid][pUID])
  10671.         {
  10672.             ListItemTD[playerid][found] = i;
  10673.             found++;
  10674.             if(found == 99)
  10675.             {
  10676.                 break;
  10677.             }
  10678.         }
  10679.     }
  10680.     if(GetPVarInt(playerid, "ItemTDPage") == 1)
  10681.     {
  10682.         TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (1) ~>~");
  10683.         TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
  10684.         new rekord = 1, StringItem[64];
  10685.         for(new i = 0; i < 10; i ++)
  10686.         {
  10687.             if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
  10688.             {
  10689.                 format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  10690.             }
  10691.             else
  10692.             {
  10693.                 format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
  10694.             }
  10695.             if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
  10696.             {
  10697.                 StringItem = "Brak przedmiotu";
  10698.             }
  10699.             if(rekord == 1)
  10700.                 TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
  10701.             else if(rekord == 2)
  10702.                 TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
  10703.             else if(rekord == 3)
  10704.                 TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
  10705.             else if(rekord == 4)
  10706.                 TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
  10707.             else if(rekord == 5)
  10708.                 TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
  10709.             else if(rekord == 6)
  10710.                 TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
  10711.             else if(rekord == 7)
  10712.                 TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
  10713.             else if(rekord == 8)
  10714.                 TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
  10715.             else if(rekord == 9)
  10716.                 TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
  10717.             else if(rekord == 10)
  10718.                 TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
  10719.             if(rekord < 10)
  10720.             {
  10721.                 rekord++;
  10722.             }
  10723.         }
  10724.     }
  10725.     return 1;
  10726. }
  10727.  
  10728. //telefon
  10729.  
  10730. CMD:test(playerid, params[])
  10731. {
  10732.     SpawnPlayer(playerid);
  10733.     return 1;
  10734. }
  10735.  
  10736. CMD:sms(playerid, params[])
  10737. {
  10738.     new numer, tresc[128], sms[256];
  10739.     if(sscanf(params, "ds[128]", numer, tresc))
  10740.         return Tip(playerid, "/sms [numer] [treść]");
  10741.     if(numer == 444)//wiadomość dla organizacji
  10742.     {
  10743.         return 1;
  10744.     }
  10745.     foreach(Player, p)
  10746.     {
  10747.         if(Player[p][pTelefon] == numer && p != playerid && Login(p) == 1)
  10748.         {
  10749.             format(sms, sizeof(sms), "[SMS] » %d: %s", numer, tresc);
  10750.             SendClientMessage(p, 0xFFF000FF, sms);
  10751.             format(sms, sizeof(sms), "[SMS] « %d: %s", numer, tresc);
  10752.             SendClientMessage(p, 0xFFF000FF, sms);
  10753.             format(String, sizeof(String), "* %s wysyła SMS.", CharName(playerid));
  10754.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10755.             format(String, sizeof(String), "** %s otrzymał SMS-a. **", CharName(p));
  10756.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10757.             break;
  10758.         }
  10759.     }
  10760.     return 1;
  10761. }
  10762.  
  10763. CMD:plac(playerid, params[])
  10764. {
  10765.     new player, cash;
  10766.     if(sscanf(params, "ud", player, cash))
  10767.         return Tip(playerid, "/plac [gracz] [kwota]");
  10768.     if(IsPlayerLogged(player) == 0 || playerid == player) return NoLogin(playerid);
  10769.     if(!PlayerToPlayer(5.0, playerid, player))
  10770.         return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  10771.     if(dKasa(playerid) < cash || cash <= 0)
  10772.         return Tip(playerid, "Nie posiadasz wystarczającej ilości gotówki lub podana kwota jest błędna.");
  10773.     ApplyAnimation(playerid, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0, 1);
  10774.     format(String, sizeof(String), "* %s podaje gotówkę %s.", CharName(playerid), CharName(player));
  10775.     ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  10776.     return sKasa(playerid, -cash), sKasa(player, cash);
  10777. }
  10778.  
  10779. //komendy drzwi
  10780.  
  10781. CMD:drzwi(playerid, params[])
  10782. {
  10783.     new info[2048];
  10784.     for(new p = 0; p < MAX_DRZWI; p++)
  10785.     {
  10786.         if(Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, Drzwi[p][dZewPosX], Drzwi[p][dZewPosY], Drzwi[p][dZewPosZ]) && Drzwi[p][dZewVir] == GetPlayerVirtualWorld(playerid) || Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
  10787.         {
  10788.             SetPVarInt(playerid, "rpDrzwi", p);
  10789.             if(pDrzwiOwner(playerid, p) != 0 && Drzwi[p][dCreatePrice] == 0)
  10790.             {
  10791.                 strcat(info, "1\tZmień nazwę drzwi\n", sizeof(info));
  10792.                 strcat(info, "2\tPokaż informacje o drzwiach\n", sizeof(info));
  10793.                 if(Drzwi[p][dOwner] == OWNER_PLAYER)
  10794.                 {
  10795.                     strcat(info, "3\tPrzekaż budynek dla gracza\n", sizeof(info));
  10796.                     strcat(info, "4\tPrzypisz budynek pod grupę\n", sizeof(info));
  10797.                 }
  10798.                 else
  10799.                 {
  10800.                     strcat(info, "5\tPrzypisz budynek pod postać\n", sizeof(info));
  10801.                 }
  10802.                 strcat(info, "6\tZmień pozycję wewnętrzną\n", sizeof(info));
  10803.                 strcat(info, "7\tPrzypisz obiekty do drzwi\n", sizeof(info));
  10804.                 strcat(info, "8\tPrzypisz etykiety do drzwi\n", sizeof(info));
  10805.                 strcat(info, "9\tZmień interior (widoczność na świat)\n", sizeof(info));
  10806.                 if(Drzwi[p][dOwner] == OWNER_PLAYER)
  10807.                 {
  10808.                     strcat(info, "10\tWynajmij pokój dla gracza\n", sizeof(info));
  10809.                 }
  10810.             }
  10811.             else
  10812.             {
  10813.                 if(Drzwi[p][dCreatePrice] == 0 || Drzwi[p][dCreateTime] == 0)
  10814.                 {
  10815.                     strcat(info, "2\tPokaż informacje o drzwiach\n", sizeof(info));
  10816.                 }
  10817.             }
  10818.  
  10819.             if(Drzwi[p][dCreatePrice] != 0 && Drzwi[p][dCreateTime] != 0)
  10820.             {
  10821.                 strcat(info, "2\tPokaż informacje o drzwiach\n", sizeof(info));
  10822.                 strcat(info, "9\tDokonaj zakupu drzwi\n", sizeof(info));
  10823.             }
  10824.  
  10825.             dShowPlayerDialog(playerid, 250, DIALOG_STYLE_LIST, ""ServName"Drzwi", info, "Wybierz", "Anuluj");
  10826.             break;
  10827.         }
  10828.         if(p >= MAX_DRZWI - 1)
  10829.             return InfoBoxShow(2, playerid, "W okolicy Twojej postaci nie odnaleziono zadnych ~y~budynkow~w~.", 3);
  10830.     }
  10831.     return 1;
  10832. }
  10833.  
  10834. CMD:v(playerid, params[])
  10835. {
  10836.     new v;
  10837.     if(!strcmp(params, "zaparkuj") || !strcmp(params, "parkuj"))
  10838.     {
  10839.         v = CarUID(GetPlayerVehicleID(playerid));
  10840.         if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  10841.             return InfoBoxShow(2, playerid, "Aby uzyc tej ~y~komendy~w~, musisz znajdowac sie za kierownica ~y~pojazdu~w~.", 3);
  10842.         if(pPojazd(playerid, GetPlayerVehicleID(playerid)) == 0)
  10843.             return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania tym ~y~pojazdem~w~.", 3);
  10844.         NadpiszParametryPojazdu(GetPlayerVehicleID(playerid));
  10845.         GetVehiclePos(GetPlayerVehicleID(playerid), Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ]);
  10846.         GetVehicleZAngle(GetPlayerVehicleID(playerid), Pojazd[v][vRot]);
  10847.         DestroyVehicle(PojazdModel[v]);
  10848.         PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
  10849.         Pojazd[v][vSpawn] = 1;
  10850.         PojazdUID[PojazdModel[v]] = v;
  10851.         if(Pojazd[v][vReje] == 0)
  10852.         {
  10853.             SetVehicleNumberPlate(PojazdModel[v], " ");
  10854.         }
  10855.         else if(Pojazd[v][vReje] == 1)
  10856.         {
  10857.             format(String, sizeof(String), "SA %04d", v);
  10858.             SetVehicleNumberPlate(PojazdModel[v], String);
  10859.         }
  10860.         SetVehicleToRespawn(PojazdModel[v]);
  10861.         UstawParametryPojazdu(PojazdModel[v]);
  10862.         return PutPlayerInVehicle(playerid, PojazdModel[v], 0);
  10863.     }
  10864.     else if(!strcmp(params, "z"))
  10865.     {
  10866.         new info[128], Float:vPos[3];
  10867.         for(new vv = 0; vv < MAX_VEHICLES; vv++)
  10868.         {
  10869.             GetVehiclePos(vv, vPos[0], vPos[1], vPos[2]);
  10870.             if(IsPlayerInRangeOfPoint(playerid, 4.0, vPos[0], vPos[1], vPos[2]) && GetVehicleVirtualWorld(vv) == GetPlayerVirtualWorld(playerid) && pPojazd(playerid, vv) != 0)
  10871.             {
  10872.                 GetVehicleParamsEx(vv, engine, lights, alarm, doors, bonnet, boot, objective);
  10873.                 if(doors == 1)
  10874.                 {
  10875.                     format(info, sizeof(info), "Pojazd ~y~%s~w~ (UID: %d) zostaly ~g~otwarty~w~.", GetVehicleName(CarUID(vv)), CarUID(vv));
  10876.                     SetVehicleParamsEx(vv, engine, lights, alarm, 0, bonnet, boot, objective);
  10877.                 }
  10878.                 else
  10879.                 {
  10880.                     format(info, sizeof(info), "Pojazd ~y~%s~w~ (UID: %d) zostaly ~r~zamkniety~w~.", GetVehicleName(CarUID(vv)), CarUID(vv));
  10881.                     SetVehicleParamsEx(vv, engine, lights, alarm, 1, bonnet, boot, objective);
  10882.                 }
  10883.                 InfoBoxShow(2, playerid, info, 3);
  10884.                 break;
  10885.             }
  10886.         }
  10887.         return 1;
  10888.     }
  10889.     else if(!strcmp(params, "info"))
  10890.     {
  10891.         if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  10892.             return InfoBoxShow(2, playerid, "Aby uzyc tej ~y~komendy~w~, musisz znajdowac sie za kierownica ~y~pojazdu~w~.", 3);
  10893.         if(pPojazd(playerid, GetPlayerVehicleID(playerid)) == 0)
  10894.             return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania tym ~y~pojazdem~w~.", 3);
  10895.         return VehInfo(playerid, GetPlayerVehicleID(playerid));
  10896.     }
  10897.     if(!IsPlayerInAnyVehicle(playerid))
  10898.     {
  10899.         new big_str[2048], type[128], pojazdy;
  10900.         for(new veh = 0; veh < MAX_POJAZDY; veh++)
  10901.         {
  10902.             if(Pojazd[veh][vAktywny] == 1)
  10903.             {
  10904.                 if(Pojazd[veh][vOwner] == 1 && Pojazd[veh][vOwnerUID] == Player[playerid][pUID])
  10905.                 {
  10906.                     new spawned[32];
  10907.                     if(Pojazd[veh][vSpawn] == 1)
  10908.                     spawned = "{AAC5E3}Zespawnowany{FFFFFF}";
  10909.                     else
  10910.                     spawned = "{FFFFFF}Odspawnowany{FFFFFF}";
  10911.                     format(type, sizeof(type), "%d\t%s\t\t%s", veh, spawned, GetVehicleName(veh));
  10912.                     format(big_str, sizeof(big_str), "%s%s\n", big_str, type);
  10913.                     ListItem[playerid][pojazdy] = veh;
  10914.                     pojazdy++;
  10915.                 }
  10916.             }
  10917.         }
  10918.         if(pojazdy) dShowPlayerDialog(playerid, 500, DIALOG_STYLE_LIST, ""ServName"Pojazdy", big_str, "(Un)Spawn", "");
  10919.         else InfoBoxShow(2, playerid, "Do tej ~y~postaci~w~ nie sa przypisane zadne ~y~pojazdy~w~.", 3);
  10920.     }
  10921.     else
  10922.     {
  10923.  
  10924.     }
  10925.     return Tip(playerid, "/v [info | zamknij (z) | parkuj]");
  10926. }
  10927.  
  10928. CMD:g(playerid, params[])
  10929. {
  10930.     new opcja[16], grupa, parametry[60];
  10931.     if(!sscanf(params, "ds[16]S()[60]", grupa, opcja, parametry))
  10932.     {
  10933.         if(grupa < 1 || grupa > 5) return Tip(playerid, "Masz dostęp tylko do pięciu slotów grupowych.");
  10934.         if(strcmp(opcja, "sluzba", true) == 0 || strcmp(opcja, "duty", true) == 0)
  10935.         {
  10936.             if(pGrupa[playerid][grupa] == 0) return InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
  10937.             if(Grupa[pGrupa[playerid][grupa]][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa, na ktorej sluzbe chcesz wejsc prawdopodobnie zostala usunieta.", 3);
  10938.             if(Sluzba(playerid) != pGrupa[playerid][grupa])
  10939.             {
  10940.                 setSluzba(playerid, pGrupa[playerid][grupa]);
  10941.                 format(String, sizeof(String), "Pomyslnie rozpoczeto sluzbe w grupie ~y~%s~w~.", Grupa[pGrupa[playerid][grupa]][gNazwa]);
  10942.                 return InfoBoxShow(2, playerid, String, 4);
  10943.             }
  10944.             if(Sluzba(playerid) == pGrupa[playerid][grupa])
  10945.             {
  10946.                 setSluzba(playerid, 0);
  10947.                 format(String, sizeof(String), "Pomyslnie zakonczono sluzbe w grupie ~y~%s~w~.", Grupa[pGrupa[playerid][grupa]][gNazwa]);
  10948.                 return InfoBoxShow(2, playerid, String, 4);
  10949.             }
  10950.             return 1;
  10951.         }
  10952.         else if(strcmp(opcja, "info", true) == 0)
  10953.         {
  10954.             if(pGrupa[playerid][grupa] == 0) return InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
  10955.             if(Grupa[pGrupa[playerid][grupa]][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa, na ktorej sluzbe chcesz wejsc prawdopodobnie zostala usunieta.", 3);
  10956.             return GrupaInfo(playerid, pGrupa[playerid][grupa]);
  10957.         }
  10958.         else if(strcmp(opcja, "magazyn", true) == 0)
  10959.         {
  10960.             new Itemy[2048], list = 0, Item[64];
  10961.             if(pGrupa[playerid][grupa] == 0) return InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
  10962.             if(Grupa[pGrupa[playerid][grupa]][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa, na ktorej sluzbe chcesz wejsc prawdopodobnie zostala usunieta.", 3);
  10963.             for(new p = 0; p < MAX_ITEM; p++)
  10964.             {
  10965.                 if(Przedmiot[p][iAktywny] == 1)
  10966.                 {
  10967.                     if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == pGrupa[playerid][grupa])
  10968.                     {
  10969.                         Przedmiot[p][iMagazyn] = 0;
  10970.                     }
  10971.                 }
  10972.             }
  10973.             for(new p = 0; p < MAX_ITEM; p++)
  10974.             {
  10975.                 if(Przedmiot[p][iAktywny] == 1)
  10976.                 {
  10977.                     if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == pGrupa[playerid][grupa] && Przedmiot[p][iMagazyn] == 0)
  10978.                     {
  10979.                         ListItem[playerid][list] = p;
  10980.                         new ilosc = 1;
  10981.                         for(new i = 0; i < MAX_ITEM; i++)
  10982.                         {
  10983.                             if(Przedmiot[i][iAktywny] == 1)
  10984.                             {
  10985.                                 if(Przedmiot[i][iOwner] == 3 && Przedmiot[i][iOwnerUID] == pGrupa[playerid][grupa] && Przedmiot[i][iMagazyn] == 0 && !strcmp(Przedmiot[p][iNazwa], Przedmiot[i][iNazwa]))
  10986.                                 {
  10987.                                     if(i != p)
  10988.                                     {
  10989.                                         Przedmiot[i][iMagazyn] = 1;
  10990.                                         ilosc++;
  10991.                                     }
  10992.                                 }
  10993.                             }
  10994.                         }
  10995.                         format(Item, sizeof(Item), "%d\tx%d\t(€%d) $%d\t\t%s", p, ilosc, Przedmiot[p][iPremiumPrice], Przedmiot[p][iPrice], Przedmiot[p][iNazwa]);
  10996.                         format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  10997.                         list++;
  10998.                     }
  10999.                 }
  11000.             }
  11001.             if(list == 0) return InfoBoxShow(2, playerid, "W magazynie ~y~grupy~w~, nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
  11002.             return dShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, ""ServName"Magazyn grupy", Itemy, "Wybierz", "Anuluj");
  11003.         }
  11004.         else if(strcmp(opcja, "v", true) == 0 || strcmp(opcja, "pojazdy", true) == 0)
  11005.         {
  11006.             new big_str[1024], type[128], pojazdy;
  11007.             for(new veh = 0; veh < MAX_POJAZDY; veh++)
  11008.             {
  11009.                 if(Pojazd[veh][vAktywny] == 1)
  11010.                 {
  11011.                     if(Pojazd[veh][vOwner] == 2 && Pojazd[veh][vOwnerUID] == pGrupa[playerid][grupa])
  11012.                     {
  11013.                         format(type, sizeof(type), "%d\t%s", veh, GetVehicleName(veh));
  11014.                         format(big_str, sizeof(big_str), "%s%s\n", big_str, type);
  11015.                         ListItem[playerid][pojazdy] = veh;
  11016.                         pojazdy++;
  11017.                     }
  11018.                 }
  11019.             }
  11020.             if(pojazdy) dShowPlayerDialog(playerid, 500, DIALOG_STYLE_LIST, ""ServName"Pojazdy", big_str, "(Un)Spawn", "");
  11021.             else return InfoBoxShow(2, playerid, "Do tej ~y~grupy~w~ nie sa przypisane zadne ~y~pojazdy~w~.", 3);
  11022.         }
  11023.         //Rozpoczynamy tworzenie komend dla lidera grupy.
  11024.         else if(strcmp(opcja, "opcje", true) == 0)
  11025.         {
  11026.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11027.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11028.             //opcje
  11029.             return 1;
  11030.         }
  11031.  
  11032.         else if(strcmp(opcja, "zapros", true) == 0)
  11033.         {
  11034.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11035.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11036.             //opcje
  11037.             return 1;
  11038.         }
  11039.         else if(strcmp(opcja, "wypros", true) == 0)
  11040.         {
  11041.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11042.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11043.             //opcje
  11044.             return 1;
  11045.         }
  11046.         else if(strcmp(opcja, "payday", true) == 0)
  11047.         {
  11048.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11049.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11050.             //opcje
  11051.             return 1;
  11052.         }
  11053.         else if(strcmp(opcja, "wplac", true) == 0)
  11054.         {
  11055.             if(InDoor(playerid) != 19)
  11056.                 return Info(playerid, "Aby wpłacić pieniądze na konto grupy, musisz znajdować się w budynku banku.");
  11057.             new kwota;
  11058.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11059.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11060.             if(sscanf(parametry, "d", kwota))
  11061.                 return Tip(playerid, "/g [slot] wplac [kwota]");
  11062.             if(dKasa(playerid) < kwota || kwota < 0)
  11063.                 return Tip(playerid, "Nie posiadasz wystarczającej ilości gotówki.");
  11064.             format(String, sizeof(String), "* %s wpłaca pieniądze na konto grupy.", CharName(playerid));
  11065.             ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  11066.             format(String, sizeof(String), "Wpłaciłeś $%d na konto organizacji %s (UID: %d).\nNowy stan konta to $%d.", kwota, Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], Grupa[pGrupa[playerid][grupa]][gBank] + kwota);
  11067.             return sKasa(playerid, -kwota), Grupa[pGrupa[playerid][grupa]][gBank] += kwota, Info(playerid, String), ZapiszGrupe(pGrupa[playerid][grupa]), SavePlayerStats(playerid, SAVE_PLAYER_CASH);
  11068.         }
  11069.         else if(strcmp(opcja, "wyplac", true) == 0)
  11070.         {
  11071.             if(InDoor(playerid) != 19)
  11072.                 return Info(playerid, "Aby wpłacić pieniądze na konto grupy, musisz znajdować się w budynku banku.");
  11073.             new kwota;
  11074.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11075.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11076.             if(sscanf(parametry, "d", kwota))
  11077.                 return Tip(playerid, "/g [slot] wyplac [kwota]");
  11078.             if(Grupa[pGrupa[playerid][grupa]][gBank] < kwota || kwota < 0)
  11079.                 return Info(playerid, "Na koncie grupy nie ma wystarczającej ilości pieniędzy.");
  11080.             format(String, sizeof(String), "Wypłaciłeś $%d z konta organizacji %s (UID: %d).\nNowy stan konta to $%d.", kwota, Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], Grupa[pGrupa[playerid][grupa]][gBank] - kwota);
  11081.             return Grupa[pGrupa[playerid][grupa]][gBank] -= kwota,  sKasa(playerid, kwota), Info(playerid, String), ZapiszGrupe(pGrupa[playerid][grupa]), SavePlayerStats(playerid, SAVE_PLAYER_CASH);
  11082.         }
  11083.         //uprawnienia
  11084.         else if(strcmp(opcja, "permlist", true) == 0)
  11085.         {
  11086.             new permlist[1024], permformat[512], perm = 0;
  11087.  
  11088.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_IC))
  11089.                 strcat(permformat, "1\tCzat InCharacter.\n", sizeof(permformat)), perm++;
  11090.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_OOC))
  11091.                 strcat(permformat, "2\tCzat Out Of Character.\n", sizeof(permformat)), perm++;
  11092.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_COLOR))
  11093.                 strcat(permformat, "4\tKolorowy nick na służbie.\n", sizeof(permformat)), perm++;
  11094.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_DEPARTMENT))
  11095.                 strcat(permformat, "8\tTag grupy pod nickiem.\n", sizeof(permformat)), perm++;
  11096.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_SPAWN))
  11097.                 strcat(permformat, "16\tSpawn w budynku organizacji.\n", sizeof(permformat)), perm++;
  11098.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_ARREST))
  11099.                 strcat(permformat, "32\tAresztowanie / przetrzymywanie.\n", sizeof(permformat)), perm++;
  11100.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_BLOCADE))
  11101.                 strcat(permformat, "64\tStawianie blokad na drodze.\n", sizeof(permformat)), perm++;
  11102.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_WEAPONS))
  11103.                 strcat(permformat, "128\tUżywanie oflagowanych broni.\n", sizeof(permformat)), perm++;
  11104.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_911))
  11105.                 strcat(permformat, "256\tListowanie na 911.\n", sizeof(permformat)), perm++;
  11106.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_RACE))
  11107.                 strcat(permformat, "512\tTworzenie wyścigów.\n", sizeof(permformat)), perm++;
  11108.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_LEAVE))
  11109.                 strcat(permformat, "1024\tOpuszczanie grupy.\n", sizeof(permformat)), perm++;
  11110.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_TAX))
  11111.                 strcat(permformat, "2048\tObowiązkowy podatek.\n", sizeof(permformat)), perm++;
  11112.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_MASK))
  11113.                 strcat(permformat, "4096\tUżywanie kominiarek.\n", sizeof(permformat)), perm++;
  11114.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_SEARCHING))
  11115.                 strcat(permformat, "8192\tPrzeszukiwanie.\n", sizeof(permformat)), perm++;
  11116.             if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_DRIVEBY))
  11117.                 strcat(permformat, "16384\tDriveBy.\n", sizeof(permformat)), perm++;
  11118.  
  11119.             if(!perm)
  11120.                 strcat(permformat, "0\tBrak przypisanych uprawnień dla grupy.\n", sizeof(permformat));
  11121.  
  11122.             format(permlist, sizeof(permlist), "Uprawnienia dla grupy %s (UID: %d) są następujące:\n%s", Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], permformat);
  11123.             return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, ""ServName"Uprawnienia", permlist, "Zamknij", "");
  11124.         }
  11125.         else if(strcmp(opcja, "perm", true) == 0)
  11126.         {
  11127.             new permlist[512], permformat[256], perm = 0;
  11128.  
  11129.             if((pGrupaPerm[playerid][grupa] & PERM_OFFER))
  11130.                 strcat(permformat, "1\tSkładanie ofert grupowych.\n", sizeof(permformat)), perm++;
  11131.             if((pGrupaPerm[playerid][grupa] & PERM_CARS))
  11132.                 strcat(permformat, "2\tProwadzenie pojazdów grupowych.\n", sizeof(permformat)), perm++;
  11133.             if((pGrupaPerm[playerid][grupa] & PERM_DOORS))
  11134.                 strcat(permformat, "4\tOtwieranie / zamykanie drzwi.\n", sizeof(permformat)), perm++;
  11135.             if((pGrupaPerm[playerid][grupa] & PERM_ORDER))
  11136.                 strcat(permformat, "8\tZamawianie produktów.\n", sizeof(permformat)), perm++;
  11137.             if((pGrupaPerm[playerid][grupa] & PERM_CHAT))
  11138.                 strcat(permformat, "16\tKorzystanie z czatu OOC.\n", sizeof(permformat)), perm++;
  11139.             if((pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11140.                 strcat(permformat, "32\tZarządzanie grupą.\n", sizeof(permformat)), perm++;
  11141.             if((pGrupaPerm[playerid][grupa] & PERM_MAYOR))
  11142.                 strcat(permformat, "64\tGubernator / Burmistrz.\n", sizeof(permformat)), perm++;
  11143.  
  11144.             if(!perm)
  11145.                 strcat(permformat, "0\tBrak przypisanych uprawnień w grupie.\n", sizeof(permformat));
  11146.  
  11147.             format(permlist, sizeof(permlist), "Uprawnienia członka grupy %s (UID: %d) są następujące:\n%s", Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], permformat);
  11148.             return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, ""ServName"Uprawnienia", permlist, "Zamknij", "");
  11149.         }
  11150.         else if(strcmp(opcja, "rank", true) == 0)
  11151.         {
  11152.             if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
  11153.                 return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
  11154.             new permformat[1024], perm[2048];
  11155.             strcat(permformat, "1\tSkładanie ofert grupowych.\n", sizeof(permformat)), strcat(permformat, "2\tProwadzenie pojazdów grupowych.\n", sizeof(permformat));
  11156.             strcat(permformat, "4\tOtwieranie / zamykanie drzwi.\n", sizeof(permformat)), strcat(permformat, "8\tZamawianie produktów.\n", sizeof(permformat));
  11157.             strcat(permformat, "16\tKorzystanie z czatu OOC.\n", sizeof(permformat)), strcat(permformat, "32\tZarządzanie grupą.\n", sizeof(permformat));
  11158.             format(perm, sizeof(perm), "Witaj w panelu nadawania uprawnień dla członka grupy %s (UID: %d).\nAby ustawić uprawnienia dla członka grupy - dodaj dodaj poniższe liczby do siebie a następnie wpisz sumę w okienku.\n%s", Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], permformat);
  11159.             return dShowPlayerDialog(playerid, 9998, DIALOG_STYLE_INPUT, ""ServName"Uprawnienia", perm, "Dalej", "Anuluj");
  11160.         }
  11161.         return 1;
  11162.     }
  11163.     Tip(playerid, "/g [slot] [duty, info, magazyn, pojazdy, zapros, wypros, opcje, wplac, wyplac, online, przebierz, perm]");
  11164.     new grupai[64], grupy[256], grupyx;
  11165.     for(new slot = 1; slot < 6; slot++)
  11166.     {
  11167.         if(pGrupa[playerid][slot] != 0 && Grupa[pGrupa[playerid][slot]][gAktywna] == 1)
  11168.         {
  11169.             grupyx ++;
  11170.             if((pGrupaPerm[playerid][slot] & PERM_LEADER))
  11171.             format(grupai, sizeof(grupai), "%d\t{AAC5E3}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
  11172.             else
  11173.             format(grupai, sizeof(grupai), "%d\t{FFFFFF}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
  11174.             format(grupy, sizeof(grupy), "%s%s\n", grupy, grupai);
  11175.         }
  11176.     }
  11177.     if(!grupyx) return InfoBoxShow(2, playerid, "Twoja postac nie jest czlonkiem zadnej z grup.", 3);
  11178.     return dShowPlayerDialog(playerid, 110, DIALOG_STYLE_LIST, ""ServName"Grupy", grupy, "Wybierz", "Anuluj");
  11179. }
  11180.  
  11181. CMD:blokuj(playerid, params[])
  11182. {
  11183.     if(Sluzba(playerid) == 0)
  11184.         return Tip(playerid, "Wejdź na służbę grupy, aby móc skorzystać z tej komendy.");
  11185.     //robimy pętle itd.
  11186.     return 1;
  11187. }
  11188.  
  11189. //komendy dotyczące grup (/kup, /podaj, /ubranie)
  11190.  
  11191. CMD:o(playerid, params[])
  11192. {
  11193.     if(Offer[playerid][oBlock] == 1)
  11194.         return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej jesteś w trakcie wykonywania którejś.");
  11195.     new sub[80],rest[80], gracz = INVALID_PLAYER_ID, offeinfo[512], info[2048];
  11196.     if(sscanf(params, "s[80]S()[80]", sub, rest))
  11197.     {
  11198.         Tip(playerid, "/o [pojazd, powitanie, przedmiot] {parametry}");
  11199.         if(Sluzba(playerid) != 0)
  11200.         {
  11201.             new offecmd[256];
  11202.             if(Grupa[Sluzba(playerid)][gTyp] == 1 || Grupa[Sluzba(playerid)][gTyp] == 2 || Grupa[Sluzba(playerid)][gTyp] == 8 || Grupa[Sluzba(playerid)][gTyp] == 10)
  11203.                 offecmd = "/o [produkt] {parametry}";
  11204.             else if(Grupa[Sluzba(playerid)][gTyp] == 13)
  11205.                 offecmd = "/o [produkt, odblokowanie, mandat, przetrzymanie] {parametry}";
  11206.             else
  11207.                 offecmd = "/o [produkt] {parametry}";
  11208.             format(String, sizeof(String), "%s", offecmd);
  11209.             return Tip(playerid, String);
  11210.         }
  11211.         return 1;
  11212.     }
  11213.     if(strcmp(sub, "pojazd", true) == 0 || strcmp(sub, "auto", true) == 0)//Typ oferty = 1, Parametry (UID, kwota)
  11214.     {
  11215.         if(!IsPlayerInAnyVehicle(playerid))
  11216.             return Tip(playerid, "Aby skorzystać z tej oferty, musisz znajdować się w pojeździe.");
  11217.         if(Pojazd[CarUID(GetPlayerVehicleID(playerid))][vOwner] == OWNER_PLAYER && Pojazd[CarUID(GetPlayerVehicleID(playerid))][vOwnerUID] == Player[playerid][pUID])
  11218.         {
  11219.             new kwota = 0;
  11220.             if(sscanf(rest, "ud", gracz, kwota))
  11221.                 return Tip(playerid, "/o pojazd [gracz] [cena]");
  11222.             //warunki podstawowe
  11223.             if(IsPlayerLogged(gracz) == 0)// || gracz == playerid)
  11224.                 return NoLogin(playerid);
  11225.             if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  11226.                 return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
  11227.             if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
  11228.                 return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
  11229.             //warunki dodatkowe
  11230.             if(kwota < 0 || kwota > 9999999)
  11231.                 return Tip(playerid, "Wprowadzona przez Ciebie kwota jest błędna.");
  11232.             //warunki zabezpieczające
  11233.             if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
  11234.                 return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
  11235.             if(!PlayerToPlayer(5.0, playerid, gracz))
  11236.                 return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  11237.             //koniec warunków
  11238.             Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
  11239.             printf("[offe] %s wysłał ofertę dla %s. Typ oferty: Kupno pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(CarUID(GetPlayerVehicleID(playerid))), CarUID(GetPlayerVehicleID(playerid)), kwota);
  11240.             Offer[playerid][oCustomerID]    = gracz;
  11241.             Offer[gracz][oCustomerID]       = playerid;
  11242.             Offer[playerid][oType]          = OFFER_VEHICLE;
  11243.             Offer[playerid][oItemUID]       = CarUID(GetPlayerVehicleID(playerid));
  11244.             Offer[playerid][oPrice]         = kwota;
  11245.             format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d, sampID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\nInne:\n\tPrzebieg:\t%.02f km\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Kupno pojazdu", GetVehicleName(CarUID(GetPlayerVehicleID(playerid))), CarUID(GetPlayerVehicleID(playerid)), GetPlayerVehicleID(playerid), cName(playerid), kwota, Pojazd[CarUID(GetPlayerVehicleID(playerid))][vPrzebieg]);
  11246.             dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
  11247.         }
  11248.         else
  11249.         {
  11250.             Info(playerid, "Nie posiadasz uprawnień do sprzedaży tego pojazdu.");
  11251.         }
  11252.         return 1;
  11253.     }
  11254.     else if(strcmp(sub, "drzwi", true) == 0)//Typ oferty = 2, Parametry (Gracz, powitanie)
  11255.     {
  11256.         if(InDoor(playerid) == 0)
  11257.             return Info(playerid, "Nie znajdujesz się w żadnym z budynków.");
  11258.         if(Drzwi[InDoor(playerid)][dOwner] == OWNER_PLAYER && Drzwi[InDoor(playerid)][dOwnerUID] == Player[playerid][pUID])
  11259.         {
  11260.             new kwota = 0;
  11261.             if(sscanf(rest, "ud", gracz, kwota))
  11262.                 return Tip(playerid, "/o drzwi [gracz] [cena]");
  11263.             //warunki podstawowe
  11264.             if(IsPlayerLogged(gracz) == 0 || gracz == playerid)
  11265.                 return NoLogin(playerid);
  11266.             if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  11267.                 return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
  11268.             if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
  11269.                 return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
  11270.             //warunki dodatkowe
  11271.             if(kwota < 0 || kwota > 9999999)
  11272.                 return Tip(playerid, "Wprowadzona przez Ciebie kwota jest błędna.");
  11273.             //warunki zabezpieczające
  11274.             if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
  11275.                 return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
  11276.             if(!PlayerToPlayer(5.0, playerid, gracz))
  11277.                 return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  11278.             //koniec warunków
  11279.             Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
  11280.             printf("[offe] %s wysłał ofertę dla %s. Typ oferty: Kupno drzwi, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), Drzwi[InDoor(playerid)][dNazwa], InDoor(playerid), kwota);
  11281.             Offer[playerid][oCustomerID]    = gracz;
  11282.             Offer[gracz][oCustomerID]       = playerid;
  11283.             Offer[playerid][oType]          = OFFER_DOORS;
  11284.             Offer[playerid][oItemUID]       = InDoor(playerid);
  11285.             Offer[playerid][oPrice]         = kwota;
  11286.             dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_MSGBOX, String, offeinfo, "Akceptuj", "Odrzuć");
  11287.             format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Kupno drzwi", Drzwi[InDoor(playerid)][dNazwa], InDoor(playerid), cName(playerid), kwota);
  11288.             dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
  11289.         }
  11290.         else
  11291.         {
  11292.             Info(playerid, "Nie posiadasz uprawnień do sprzedaży tego budynku.");
  11293.         }
  11294.         return 1;
  11295.     }
  11296.     else if(strcmp(sub, "powitanie", true) == 0)//Typ oferty = 3, Parametry (Gracz, powitanie)
  11297.     {
  11298.         new typ = 0;
  11299.         if(sscanf(rest, "ud", gracz, typ))
  11300.             return Tip(playerid, "/o powitanie [gracz] [typ (0 - 7)]");
  11301.         //warunki podstawowe
  11302.         if(IsPlayerLogged(gracz) == 0 || gracz == playerid)
  11303.             return NoLogin(playerid);
  11304.         if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  11305.             return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
  11306.         if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
  11307.             return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
  11308.         //warunki dodatkowe
  11309.         if(!IsPlayerInAnyVehicle(gracz))
  11310.             return Tip(playerid, "Gracz, któremu chcesz zaoferować usługę musi znajdować się w pojeździe.");
  11311.         //warunki zabezpieczające
  11312.         if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
  11313.             return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
  11314.         if(!PlayerToPlayer(5.0, playerid, gracz))
  11315.             return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  11316.         //koniec warunków
  11317.         return 1;
  11318.     }
  11319.     else if(strcmp(sub, "produkt", true) == 0)//Typ oferty = 4, Parametry (Gracz)
  11320.     {
  11321.         if(Sluzba(playerid) == 0)
  11322.             return Info(playerid, "Wejdź na służbę grupy, z której chcesz zaoferować produkty.");
  11323.         if(InDoor(playerid) == 0)
  11324.             return Info(playerid, "Aby zaoferować jakikolwiek produkt, musisz znajdować się w budynku.");
  11325.         if(Drzwi[InDoor(playerid)][dOwner] == 2 && Drzwi[InDoor(playerid)][dOwnerUID] == Sluzba(playerid))
  11326.         {
  11327.             //oferta
  11328.         }
  11329.         else
  11330.         {
  11331.             Info(playerid, "W tym momencie nie możesz zaoferować żadnego produktu.\nDrzwi, w których się znajdujesz mogą nie być własnością grupy, z której produkt chcesz zaoferować.");
  11332.         }
  11333.         return 1;
  11334.     }
  11335.     else if(strcmp(sub, "przedmiot", true) == 0)//Typ oferty = 5, Parametry (Gracz, cena)
  11336.     {
  11337.         return 1;
  11338.     }
  11339.     else if(strcmp(sub, "przetrzymanie", true) == 0)//Typ oferty = 6, Parametr (Gracz)
  11340.     {
  11341.         return 1;
  11342.     }
  11343.     else if(strcmp(sub, "naprawe", true) == 0)//Typ oferty = 7, Parametr (Gracz)
  11344.     {
  11345.         if(Grupa[Sluzba(playerid)][gTyp] != 9)
  11346.             return Info(playerid, "Aby skorzystać z tej komendy musisz znajdować się na służbie grupy o typie Warsztat.");
  11347.         if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_OFFER))
  11348.             return Info(playerid, "Nie posiadasz uprawnień do składania ofert.");
  11349.         if(sscanf(rest, "u", gracz))
  11350.             return Tip(playerid, "/o naprawe [gracz]");
  11351.         //warunki podstawowe
  11352.         if(IsPlayerLogged(gracz) == 0 || playerid == gracz)
  11353.             return NoLogin(playerid);
  11354.         if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  11355.             return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
  11356.         if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
  11357.             return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
  11358.         //warunki dodatkowe
  11359.         if(!IsPlayerInAnyVehicle(gracz))
  11360.             return Tip(playerid, "Gracz, któremu chcesz zaoferować usługę musi znajdować się w pojeździe.");
  11361.         //warunki zabezpieczające
  11362.         if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
  11363.             return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
  11364.         if(!PlayerToPlayer(5.0, playerid, gracz))
  11365.             return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  11366.         //koniec warunków
  11367.         Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
  11368.         new Float:HP;
  11369.         GetVehicleHealth(GetPlayerVehicleID(gracz), HP);
  11370.         new Float:hpdonaprawy = 1000 - HP;
  11371.         new price2 = floatval(hpdonaprawy)*1;
  11372.         Offer[playerid][oCustomerID]    = gracz;
  11373.         Offer[gracz][oCustomerID]       = playerid;
  11374.         Offer[playerid][oType]          = OFFER_REPAIR;
  11375.         Offer[playerid][oItemUID]       = CarUID(GetPlayerVehicleID(gracz));
  11376.         Offer[playerid][oPrice]         = price2;
  11377.         Offer[playerid][oBlock]         = 1;
  11378.         Offer[playerid][oGroupUID]      = Sluzba(playerid);
  11379.         if(IsBoat(GetPlayerVehicleID(gracz)) == 1)
  11380.         {
  11381.             Offer[playerid][oPrice] = Offer[playerid][oPrice]/2;
  11382.         }
  11383.         printf("[offe] %s wysłał ofertę dla %s. Typ oferty: Naprawa pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[playerid][oItemUID]), CarUID(Offer[playerid][oItemUID]), Offer[playerid][oPrice]);
  11384.         format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d, sampID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Naprawa pojazdu", GetVehicleName(CarUID(GetPlayerVehicleID(gracz))), CarUID(GetPlayerVehicleID(gracz)), GetPlayerVehicleID(gracz), cName(playerid), price2);
  11385.         return dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
  11386.     }
  11387.     else if(strcmp(sub, "rejestracja", true) == 0)//Typ oferty = 8, Parametr (Gracz, UID wozu)
  11388.     {
  11389.         new vUID = INVALID_VEHICLE_ID;
  11390.         if(Grupa[Sluzba(playerid)][gTyp] != 14)
  11391.             return Info(playerid, "Aby skorzystać z tej komendy musisz znajdować się na służbie grupy o typie Rząd.");
  11392.         if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_OFFER))
  11393.             return Info(playerid, "Nie posiadasz uprawnień do składania ofert.");
  11394.         if(sscanf(rest, "ud", gracz, vUID))
  11395.             return Tip(playerid, "/o rejestracje [gracz] [identyfikator pojazdu]");
  11396.         //warunki podstawowe
  11397.         if(IsPlayerLogged(gracz) == 0 || gracz == playerid)
  11398.             return NoLogin(playerid);
  11399.         if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  11400.             return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
  11401.         if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
  11402.             return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
  11403.         //warunki dodatkowe
  11404.         if(Drzwi[InDoor(playerid)][dOwner] == OWNER_GROUP && Drzwi[InDoor(playerid)][dOwnerUID] == Sluzba(playerid))
  11405.         {
  11406.             if(Pojazd[vUID][vOwner] == OWNER_PLAYER && Pojazd[vUID][vOwnerUID] == Player[gracz][pUID])//dodać do sprawdzenia czy jest w grupach, pod które podpisane jest auto
  11407.             {
  11408.                 if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
  11409.                     return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
  11410.                 if(!PlayerToPlayer(5.0, playerid, gracz))
  11411.                     return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  11412.                 if(Pojazd[vUID][vReje] == 1)
  11413.                     return Tip(playerid, "Pojazd jest już zarejestrowany.");
  11414.                 Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
  11415.                 Offer[playerid][oCustomerID]    = gracz;
  11416.                 Offer[gracz][oCustomerID]       = playerid;
  11417.                 Offer[playerid][oType]          = OFFER_REGISTER;
  11418.                 Offer[playerid][oItemUID]       = vUID;
  11419.                 Offer[playerid][oPrice]         = 200;
  11420.                 Offer[playerid][oBlock]         = 1;
  11421.                 Offer[playerid][oGroupUID]      = Sluzba(playerid);
  11422.                 format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Rejestracja pojazdu", GetVehicleName(vUID), vUID, cName(playerid), Offer[playerid][oPrice]);
  11423.                 dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
  11424.             }
  11425.             else
  11426.             {
  11427.                 Tip(playerid, "Gracz nie posiada uprawnień do rejestracji tego pojazdu.");
  11428.             }
  11429.         }
  11430.         else
  11431.         {
  11432.             Info(playerid, "Nie znajdujesz się w budynku, który należy do Rządu.");
  11433.         }
  11434.         return 1;
  11435.     }
  11436.     else if(strcmp(sub, "montaz", true) == 0)//Typ oferty = 9, Parametr (Gracz, wóz, komponent)
  11437.     {
  11438. //      new komponent, vuid;
  11439.         if(Grupa[Sluzba(playerid)][gTyp] != 9)
  11440.             return Info(playerid, "Aby skorzystać z tej komendy musisz znajdować się na służbie grupy o typie Warsztat.");
  11441.         if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_OFFER))
  11442.             return Info(playerid, "Nie posiadasz uprawnień do składania ofert.");
  11443.         if(sscanf(rest, "udd", gracz))
  11444.             return Tip(playerid, "/o montaz [gracz] [identyfikator pojazdu] [komponent]");
  11445.         //warunki podstawowe
  11446.         if(IsPlayerLogged(gracz) == 0 || playerid == gracz)
  11447.             return NoLogin(playerid);
  11448.         if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
  11449.             return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
  11450.         if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
  11451.             return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
  11452.         //warunki dodatkowe
  11453.         if(!IsPlayerInAnyVehicle(gracz))
  11454.             return Tip(playerid, "Gracz, któremu chcesz zaoferować usługę musi znajdować się w pojeździe.");
  11455.         //owner pojazdu, owner komponentu
  11456.         //warunki zabezpieczające
  11457.         if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
  11458.             return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
  11459.         if(!PlayerToPlayer(5.0, playerid, gracz))
  11460.             return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
  11461.         //koniec warunków
  11462.     }
  11463.     else
  11464.     {
  11465.         new offe[64];
  11466.         format(offe, sizeof(offe), "System nie rozpoznał usługi '%s'.", params), Tip(playerid, offe);
  11467.     }
  11468.     return 1;
  11469. }
  11470.  
  11471. CMD:podaj(playerid, params[])
  11472. {
  11473.     new Itemy[2048], list = 0, Item[64], gracz;
  11474.     for(new d = 0; d < MAX_DRZWI; d++)
  11475.     {
  11476.         if(Drzwi[d][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]) && Drzwi[d][dWewVir] == GetPlayerVirtualWorld(playerid))
  11477.         {
  11478.             if(Drzwi[d][dOwner] == 2)
  11479.             {
  11480.                 if(pGrupa[playerid][1] == Drzwi[d][dOwnerUID] || pGrupa[playerid][2] == Drzwi[d][dOwnerUID] || pGrupa[playerid][3] == Drzwi[d][dOwnerUID] || pGrupa[playerid][4] == Drzwi[d][dOwnerUID] || pGrupa[playerid][5] == Drzwi[d][dOwnerUID])
  11481.                 {
  11482.                     //konfiguracja oferty
  11483.                     if(sscanf(params, "d", gracz))
  11484.                         return Tip(playerid, "/podaj [id / nick]");
  11485.                     if(Sluzba(playerid) != Drzwi[d][dOwnerUID])
  11486.                         return InfoBoxShow(2, playerid, "Aby zaoferowac jakikolwiek ~y~produkt~w~ w tym ~y~budynku~w~, musisz byc na sluzbie ~y~grupy~w~, do ktorej ten budynek nalezy.", 4);
  11487.                     if(IsPlayerLogged(gracz) == 0 || gracz == playerid) return NoLogin(playerid);
  11488.                     SetPVarInt(gracz,       "rpOffePlayer",     playerid);
  11489.                     SetPVarInt(gracz,       "rpOffeDoor",       InDoor(playerid));
  11490.                     SetPVarInt(gracz,       "rpOffeGroup",      Sluzba(playerid));
  11491.                     SetPVarInt(playerid,    "rpOffeClient",     gracz);
  11492.                     //koniec konfigurowania ofert
  11493.                     for(new p = 0; p < MAX_ITEM; p++)
  11494.                     {
  11495.                         if(Przedmiot[p][iAktywny] == 1)
  11496.                         {
  11497.                             if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID])
  11498.                             {
  11499.                                 Przedmiot[p][iMagazyn] = 0;
  11500.                             }
  11501.                         }
  11502.                     }
  11503.                     for(new p = 0; p < MAX_ITEM; p++)
  11504.                     {
  11505.                         if(Przedmiot[p][iAktywny] == 1)
  11506.                         {
  11507.                             if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[p][iMagazyn] == 0)
  11508.                             {
  11509.                                 ListItem[playerid][list] = p;
  11510.                                 new ilosc = 1;
  11511.                                 for(new i = 0; i < MAX_ITEM; i++)
  11512.                                 {
  11513.                                     if(Przedmiot[i][iAktywny] == 1)
  11514.                                     {
  11515.                                         if(Przedmiot[i][iOwner] == 3 && Przedmiot[i][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[i][iMagazyn] == 0 && !strcmp(Przedmiot[p][iNazwa], Przedmiot[i][iNazwa]))
  11516.                                         {
  11517.                                             if(i != p)
  11518.                                             {
  11519.                                                 Przedmiot[i][iMagazyn] = 1;
  11520.                                                 ilosc++;
  11521.                                             }
  11522.                                         }
  11523.                                     }
  11524.                                 }
  11525.                                 format(Item, sizeof(Item), "%d\tx%d\t$%d\t%s", p, ilosc, Przedmiot[p][iPrice], Przedmiot[p][iNazwa]);
  11526.                                 format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  11527.                                 list++;
  11528.                             }
  11529.                         }
  11530.                     }
  11531.                     if(list == 0) return InfoBoxShow(2, playerid, "W magazynie ~y~grupy~w~, nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
  11532.                     return dShowPlayerDialog(playerid, 1002, DIALOG_STYLE_LIST, ""ServName"Składanie oferty", Itemy, "Wybierz", "Anuluj");
  11533.                 }
  11534.                 else
  11535.                 {
  11536.                     Tip(playerid, "Brak uprawnień do składania ofert w tym budynku.");
  11537.                 }
  11538.             }
  11539.             break;
  11540.         }
  11541.         if(d >= MAX_DRZWI - 1)
  11542.             return InfoBoxShow(2, playerid, "Nie znajdujesz sie we wnetrzu ~y~budynku~w~.", 3);
  11543.     }
  11544.     return 1;
  11545. }
  11546.  
  11547. CMD:kup(playerid, params[])
  11548. {
  11549.         new Itemy[2048], list = 0, Item[64], d = InDoor(playerid);
  11550.         if(Drzwi[d][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]) && Drzwi[d][dWewVir] == GetPlayerVirtualWorld(playerid))
  11551.         {
  11552.             if(Drzwi[d][dOwner] == 2)
  11553.             {
  11554.                 if(Grupa[Drzwi[d][dOwnerUID]][gTyp] == 2)
  11555.                 {
  11556.                     for(new p = 0; p < MAX_ITEM; p++)
  11557.                     {
  11558.                         if(Przedmiot[p][iAktywny] == 1)
  11559.                         {
  11560.                             if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID])
  11561.                             {
  11562.                                 Przedmiot[p][iMagazyn] = 0;
  11563.                             }
  11564.                         }
  11565.                     }
  11566.                     for(new p = 0; p < MAX_ITEM; p++)
  11567.                     {
  11568.                         if(Przedmiot[p][iAktywny] == 1)
  11569.                         {
  11570.                             if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[p][iMagazyn] == 0)
  11571.                             {
  11572.                                 ListItem[playerid][list] = p;
  11573.                                 new ilosc = 1;
  11574.                                 for(new i = 0; i < MAX_ITEM; i++)
  11575.                                 {
  11576.                                     if(Przedmiot[i][iAktywny] == 1)
  11577.                                     {
  11578.                                         if(Przedmiot[i][iOwner] == 3 && Przedmiot[i][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[i][iMagazyn] == 0 && !strcmp(Przedmiot[p][iNazwa], Przedmiot[i][iNazwa]))
  11579.                                         {
  11580.                                             if(i != p)
  11581.                                             {
  11582.                                                 Przedmiot[i][iMagazyn] = 1;
  11583.                                                 ilosc++;
  11584.                                             }
  11585.                                         }
  11586.                                     }
  11587.                                 }
  11588.                                 format(Item, sizeof(Item), "%d\tx%d\t(€%d) $%d\t\t%s", p, ilosc, Przedmiot[p][iPremiumPrice], Przedmiot[p][iPrice], Przedmiot[p][iNazwa]);
  11589.                                 format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
  11590.                                 list++;
  11591.                             }
  11592.                         }
  11593.                     }
  11594.                     if(list == 0) return InfoBoxShow(2, playerid, "W magazynie ~y~sklepu~w~, nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
  11595.                     return dShowPlayerDialog(playerid, 1003, DIALOG_STYLE_LIST, ""ServName"Sklep", Itemy, "Wybierz", "Anuluj");
  11596.                 }
  11597.                 return InfoBoxShow(2, playerid, "Budynek, w ktorym sie znajdujesz nie nalezy do ~y~sklepu samoobslugowego~w~.", 3);
  11598.             }
  11599.             else
  11600.             {
  11601.                 return InfoBoxShow(2, playerid, "Budynek, w ktorym sie znajdujesz nie nalezy do ~y~sklepu samoobslugowego~w~.", 3);
  11602.             }
  11603.         }
  11604.         return 1;
  11605. }
  11606.  
  11607.  
  11608. CMD:w(playerid, params[])
  11609. {
  11610.     new gracz, text[200];
  11611.     if(sscanf(params, "us[200]", gracz, text))
  11612.         return Tip(playerid, "/w [ID gracza / część nicku] [wiadomość]");
  11613.     if(IsPlayerLogged(gracz) == 0 || gracz == playerid) return NoLogin(playerid);
  11614.     if(GetPVarInt(gracz, "AFK") > 3)
  11615.     {
  11616.         InfoBoxShow(2, playerid, "~y~Gracz~w~, do ktorego wyslales wiadomosc znajduje sie aktualnie zdala od komputera.", 3);
  11617.     }
  11618.     SetPVarInt(gracz, "ReplayPriv", playerid);
  11619.     if(strlen(text) > 75)
  11620.     {
  11621.         new linia[76];
  11622.         format(linia, sizeof(linia), text);
  11623.         strdel(linia, 76, strlen(linia));
  11624.         format(String, sizeof(String), "(( » [%d] %s: %s ... ))", gracz, CharName(gracz), linia);
  11625.         SendClientMessage(playerid, 0xFFC973FF, String);
  11626.         format(String, sizeof(String),"(( « [%d] %s: %s ... ))", playerid, CharName(playerid), linia);
  11627.         SendClientMessage(gracz, 0xFDAE33FF, String);
  11628.         strdel(text, 0, 75);
  11629.         format(String, sizeof(String), "(( ... %s ))", text);
  11630.         SendClientMessage(playerid, 0xFFC973FF, String);
  11631.         format(String, sizeof(String), "(( ... %s ))", text);
  11632.         SendClientMessage(gracz, 0xFDAE33FF, String);
  11633.         return 1;
  11634.     }
  11635.     else
  11636.     {
  11637.         format(String, sizeof(String),"(( » [%d] %s: %s ))", gracz, CharName(gracz), text);
  11638.         SendClientMessage(playerid,0xFFC973FF,String);
  11639.         format(String, sizeof(String),"(( « [%d] %s: %s ))", playerid, CharName(playerid), text);
  11640.         SendClientMessage(gracz, 0xFDAE33FF, String);
  11641.     }
  11642.     return SetPVarInt(gracz, "rpPriv", playerid);
  11643. }
  11644.  
  11645. CMD:re(playerid, params[])
  11646. {
  11647.     new text[200];
  11648.     if(sscanf(params, "s[200]", text))
  11649.         return Tip(playerid, "/re [wiadomość]");
  11650.     if(IsPlayerLogged(GetPVarInt(playerid, "ReplayPriv") == 0 || GetPVarInt(playerid, "ReplayPriv") == playerid)) return NoLogin(playerid);
  11651.     if(GetPVarInt(GetPVarInt(playerid, "ReplayPriv"), "AFK") > 3)
  11652.     {
  11653.         InfoBoxShow(2, playerid, "~y~Gracz~w~, do ktorego wyslales wiadomosc znajduje sie aktualnie zdala od komputera.", 3);
  11654.     }
  11655.     SetPVarInt(GetPVarInt(playerid, "ReplayPriv"), "ReplayPriv", playerid);
  11656.     if(strlen(text) > 75)
  11657.     {
  11658.         new linia[76];
  11659.         format(linia, sizeof(linia), text);
  11660.         strdel(linia, 76, strlen(linia));
  11661.         format(String, sizeof(String), "(( » [%d] %s: %s ... ))", GetPVarInt(playerid, "ReplayPriv"), CharName(GetPVarInt(playerid, "ReplayPriv")), linia);
  11662.         SendClientMessage(playerid, 0xFFC973FF, String);
  11663.         format(String, sizeof(String),"(( « [%d] %s: %s ... ))", playerid, CharName(playerid), linia);
  11664.         SendClientMessage(GetPVarInt(playerid, "ReplayPriv"), 0xFDAE33FF, String);
  11665.         strdel(text, 0, 75);
  11666.         format(String, sizeof(String), "(( ... %s ))", text);
  11667.         SendClientMessage(playerid, 0xFFC973FF, String);
  11668.         format(String, sizeof(String), "(( ... %s ))", text);
  11669.         SendClientMessage(GetPVarInt(playerid, "ReplayPriv"), 0xFDAE33FF, String);
  11670.         return 1;
  11671.     }
  11672.     else
  11673.     {
  11674.         format(String, sizeof(String),"(( » [%d] %s: %s ))", GetPVarInt(playerid, "ReplayPriv"), CharName(GetPVarInt(playerid, "ReplayPriv")), text);
  11675.         SendClientMessage(playerid,0xFFC973FF,String);
  11676.         format(String, sizeof(String),"(( « [%d] %s: %s ))", playerid, CharName(playerid), text);
  11677.         SendClientMessage(GetPVarInt(playerid, "ReplayPriv"), 0xFDAE33FF, String);
  11678.     }
  11679.     return 1;
  11680. }
  11681.  
  11682. CMD:login(playerid, params[])
  11683. {
  11684.     if(GetPVarInt(playerid, "LoginTime") > gettime())
  11685.         return Info(playerid, "Musisz odczekać minutę od ostatniego zalogowania.");
  11686.     SetPVarInt(playerid, "LoginTime", gettime()+60);
  11687.     SetPVarInt(playerid, "Teleport", 1);
  11688.     Player[playerid][pQuit] = 1;
  11689.     Player[playerid][pQuitTime] = gettime();
  11690.     Global_Data_Save(playerid);
  11691.     SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
  11692.     SavePlayerStats(playerid, SAVE_PLAYER_POS);
  11693.     SavePlayerStats(playerid, SAVE_PLAYER_GROUP);
  11694.     OnPlayerDisconnect(playerid, 5);
  11695.     return OnPlayerConnect(playerid);
  11696. }
  11697.  
  11698. CMD:qs(playerid, params[])
  11699. {
  11700.     GetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
  11701.     Player[playerid][pQuit] = 1;
  11702.     Player[playerid][pQuitTime] = gettime();
  11703.     SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
  11704.     SavePlayerStats(playerid, SAVE_PLAYER_POS);
  11705.     SavePlayerStats(playerid, SAVE_PLAYER_GROUP);
  11706.     return Kick(playerid);
  11707. }
  11708.  
  11709. CMD:rx(playerid, params[])
  11710. {
  11711.     new Float:Rot, Float:Pos[6];
  11712.     if(sscanf(params, "f", Rot))
  11713.         return Tip(playerid, "/rx [rotacja]");
  11714.     if(Obiekt(playerid) == 0)
  11715.         return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  11716.     GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
  11717.     GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
  11718.     return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2], Pos[3]+Rot, Pos[4], Pos[5]);
  11719. }
  11720.  
  11721. CMD:ry(playerid, params[])
  11722. {
  11723.     new Float:Rot, Float:Pos[6];
  11724.     if(sscanf(params, "f", Rot))
  11725.         return Tip(playerid, "/ry [rotacja]");
  11726.     if(Obiekt(playerid) == 0)
  11727.         return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  11728.     GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
  11729.     GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
  11730.     return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2], Pos[3], Pos[4]+Rot, Pos[5]);
  11731. }
  11732.  
  11733. CMD:rz(playerid, params[])
  11734. {
  11735.     new Float:Rot, Float:Pos[6];
  11736.     if(sscanf(params, "f", Rot))
  11737.         return Tip(playerid, "/rz [rotacja]");
  11738.     if(Obiekt(playerid) == 0)
  11739.         return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  11740.     GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
  11741.     GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
  11742.     return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2], Pos[3], Pos[4], Pos[5]+Rot);
  11743. }
  11744.  
  11745. CMD:ox(playerid, params[])
  11746. {
  11747.     new Float:Rot, Float:Pos[6];
  11748.     if(sscanf(params, "f", Rot))
  11749.         return Tip(playerid, "/ox [rotacja]");
  11750.     if(Obiekt(playerid) == 0)
  11751.         return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  11752.     GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
  11753.     GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
  11754.     return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0]+Rot, Pos[1], Pos[2], Pos[3], Pos[4], Pos[5]);
  11755. }
  11756.  
  11757. CMD:oy(playerid, params[])
  11758. {
  11759.     new Float:Rot, Float:Pos[6];
  11760.     if(sscanf(params, "f", Rot))
  11761.         return Tip(playerid, "/oy [rotacja]");
  11762.     if(Obiekt(playerid) == 0)
  11763.         return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  11764.     GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
  11765.     GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
  11766.     return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1]+Rot, Pos[2], Pos[3], Pos[4], Pos[5]);
  11767. }
  11768.  
  11769. CMD:oz(playerid, params[])
  11770. {
  11771.     new Float:Rot, Float:Pos[6];
  11772.     if(sscanf(params, "f", Rot))
  11773.         return Tip(playerid, "/oz [rotacja]");
  11774.     if(Obiekt(playerid) == 0)
  11775.         return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
  11776.     GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
  11777.     GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
  11778.     return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2]+Rot, Pos[3], Pos[4], Pos[5]);
  11779. }
  11780.  
  11781. CMD:pasy(playerid, params[])
  11782. {
  11783.     if(IsPlayerInAnyVehicle(playerid))
  11784.     {
  11785.         if(GetPVarInt(playerid, "rpPasy") == 0)
  11786.         {
  11787.             SetPVarInt(playerid, "rpPasy", 1);
  11788.             GameTextForPlayer(playerid, "~w~pasy ~r~zapiete", 3000, 6);
  11789.             PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  11790.         }
  11791.         else
  11792.         {
  11793.             SetPVarInt(playerid, "rpPasy", 0);
  11794.             GameTextForPlayer(playerid, "~w~pasy ~g~odpiete", 3000, 6);
  11795.             PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  11796.         }
  11797.     }
  11798.     else
  11799.     {
  11800.         Tip(playerid, "Musisz znajdować się w pojeździe.");
  11801.     }
  11802.     return 1;
  11803. }
  11804.  
  11805. //komendy organizacji
  11806.  
  11807. ///live Siemanko, tutaj Wasz Admin co tam ciekawego slychac w jakze slonecznym Los Santos? Wszystko w porzadku ABC?
  11808.  
  11809. CMD:live(playerid, params[])
  11810. {
  11811.     if(Sluzba(playerid) == 0 || Grupa[Sluzba(playerid)][gTyp] != 16)
  11812.         return Info(playerid, "Musisz być na służbie grupy, aby móc nadawać audycje w Radio.");
  11813.     foreach(Player, p)
  11814.     {
  11815.         if(Player[p][pRadio] == Sluzba(playerid) || Player[p][pRadio] == 0)
  11816.         {
  11817.             format(String, sizeof(String), " ~y~~h~%s (LIVE):~w~ %s~n~", CharName(playerid), params);
  11818.             TextDrawSetString(PasekSanNews[p], String);
  11819.         }
  11820.     }
  11821.     return 1;
  11822. }
  11823.  
  11824. CMD:reklama(playerid, params[])
  11825. {
  11826.     if(Sluzba(playerid) == 0 || Grupa[Sluzba(playerid)][gTyp] != 16)
  11827.         return Info(playerid, "Musisz być na służbie grupy, aby móc nadawać audycje w Radio.");
  11828.     foreach(Player, p)
  11829.     {
  11830.         if(Player[p][pRadio] == Sluzba(playerid) || Player[p][pRadio] == 0)
  11831.         {
  11832.             format(String, sizeof(String), " ~p~~h~%s (Reklama):~w~ %s~n~", CharName(playerid), params);
  11833.             TextDrawSetString(PasekSanNews[p], String);
  11834.         }
  11835.     }
  11836.     return 1;
  11837. }
Add Comment
Please, Sign In to add comment