Advertisement
Grzegorz00

Untitled

Jan 17th, 2016
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 108.02 KB | None | 0 0
  1. /* TODO:
  2. - login.pwn -> Ustawienia
  3. - main -> premium (0 - none, 1 - premium, 2 - gold); premiumtime
  4. - main -> trusted (0 - false, 1 - true)
  5. - veh.pwn -> GPS (ikony ważnych miejsc)
  6. - door.pwn -> grunt = wielkość * cena strefy
  7. - door.pwn -> wycena domu = interior + gruntu
  8. */
  9.  
  10. #define Debug 1
  11. #define Forum 2
  12. #define Locked 0
  13. #define mapandreas 0
  14. #define OFFICIAL 1
  15. #define STREAMER 1
  16. #define IN_VERSION "1.0.3"
  17. #define today "08062014"
  18.  
  19. //forward OnClientCheckResponse(playerid, actionid, memaddr, retndata);
  20. //native SendClientCheck(playerid, actionid, memaddr, memOffset, bytesCount);
  21.  
  22. #include "SURV_h.pwn"
  23. /*
  24. enum(<<= 1)
  25. {
  26. NULL = 0,
  27. SOBEIT = 0x5E8606,
  28. };
  29.  
  30.  
  31. public OnClientCheckResponse(playerid, actionid, memaddr, retndata)
  32. {
  33. switch(retndata)
  34. {
  35. case 0xA0: printf("*** GTA Gracza %s jest czyste! ***", NickName(playerid));
  36. default:
  37. {
  38. SendClientMessage(playerid, -1, "{FF0000}Serwer wykrył u Ciebie niedozwolone pliki..");
  39. SendClientMessage(playerid, -1, "{FF0000}Aby rozpocząć grę na serwerze usuń je z folderu GTA.");
  40. printf("*** SOBEIT - %s ***", NickName(playerid));
  41. Kick(playerid);
  42. }
  43. }
  44. } */
  45.  
  46. main()
  47. {
  48. print(" ");
  49. print("#############################");
  50. print(" ");
  51. print(" "IN_NAME" ");
  52. print(" Grzegorz Sawicki ");
  53. print(" 2015 ");
  54. print(" © All right reserved ");
  55. print(" ");
  56. print("#############################");
  57. print(" ");
  58. }
  59.  
  60. public OnGameModeInit()
  61. {
  62. new count = GetTickCount();
  63. MySQL_Connect();
  64. #if OFFICIAL
  65. SetGameModeText("v"IN_VERSION", build: "today);
  66. #else
  67. SetGameModeText("DBG: v"IN_VERSION", build: "today);
  68. #endif
  69. AllowInteriorWeapons(true); // Bronie w interiorach
  70. EnableStuntBonusForAll(false); // Kasa za stunty
  71. ShowNameTags(false); // Nametagi
  72. DisableInteriorEnterExits(); // Strzałki do domyślnych interiorów GTA
  73. ManualVehicleEngineAndLights(); // Światła i silnik wyłączony domyślnie
  74. //UsePlayerPedAnims(); // Bieganie jak Carl Johnson!
  75. FadeInit(); // Ładowanie zaciemnienia ekranu
  76. #if mapandreas
  77. MapAndreas_Init(MAP_ANDREAS_MODE_FULL);// Ładowanie pluginu MapAndreas
  78. #endif
  79.  
  80. print("## Rozpoczynam wczytywanie danych!");
  81. if(mysql_ping() == -1)
  82. {
  83. SendRconCommand("mapname ~MySQL Error~");
  84. print("[MySQL Error]: Brak połączenia z bazą danych!");
  85. return 1;
  86. }
  87. else print("# Połączono z bazą danych!");
  88. LoadSetting();
  89. Setting(setting_globtimer) = SetTimer("GlobalTimer", 1000, 1);
  90. Setting(setting_opttimer) = SetTimer("OptTimer", 100, 1);
  91. //LoadNPC();
  92. LoadVehicles();
  93. LoadTextDraws();
  94. LoadPickups();
  95. LoadDoors();
  96. LoadBus();
  97. LoadStation();
  98. LoadAnims();
  99. LoadStreets();
  100. LoadRadar();
  101. LoadGangZone();
  102. LoadGrunt();
  103. LoadSocket();
  104. LoadSkins();
  105. #if STREAMER
  106. LoadObjects();
  107. #endif
  108. new Float:czas = floatdiv(GetTickCount() - count, 1000);
  109. printf("## Dane wczytane pomyślnie! | Czas wykonywania: %.2f %s",
  110. czas,
  111. dli(floatval(czas), "sekunde", "sekundy", "sekund")
  112. );
  113. mysql_debug(1);
  114.  
  115. //ACset_MoneyCheck(false);
  116. return 1;
  117. }
  118. /*
  119. public AC_OnCheatDetected(playerid, cheat_type, ac_extra)
  120. {
  121. printf("[AC] Coś wykryłem %d!", cheat_type);
  122. return 1;
  123. }*/
  124.  
  125. public OnGameModeExit()
  126. {
  127. #if Debug
  128. print("OnGameModeExit()");
  129. #endif
  130. Audio_DestroyTCPServer();
  131. DOF2_Exit();
  132. FadeExit();
  133. #if mapandreas
  134. MapAndreas_Unload();
  135. #endif
  136. KillTimer(Setting(setting_globtimer));
  137. KillTimer(Setting(setting_opttimer));
  138. #if OFFICIAL
  139. for(new carid; carid != MAX_VEHICLES; carid++)
  140. {
  141. if(!Vehicle(carid, vehicle_uid)) continue;
  142. if(Vehicle(carid, vehicle_vehID) == INVALID_VEHICLE_ID) continue;
  143. UnSpawnVeh(carid);
  144. }
  145. foreach(Server_Doors, doorid)
  146. {
  147. SaveDoor(doorid);
  148. }
  149. #endif
  150. foreach(Player, playerid)
  151. {
  152. Player(playerid, player_spawned) = false;
  153. OnPlayerLoginOut(playerid);
  154. }
  155. return 1;
  156. }
  157.  
  158. public OnPlayerConnect(playerid)
  159. {
  160. if(playerid > MAX_PLAYERS) return Kick(playerid);
  161.  
  162. /* new actionid = 0x5, memaddr = SOBEIT, retndata = 0x4;
  163. SendClientCheck(playerid, actionid, memaddr, NULL, retndata);
  164. switch(retndata)
  165. {
  166. case 10:
  167. {
  168. printf("Użytkownik %s prawdopodobnie posiada s0beita, bądź plik d3d9.dll w katalogu z GTA San Andreas", NickName(playerid));
  169. }
  170. }*/
  171. for(new ePlayers:i; i < ePlayers; i++)
  172. Player(playerid, i) = 0;
  173.  
  174. ClearData(playerid);
  175.  
  176. SetPlayerColor(playerid, 0x00000000);
  177. SetPlayerScore(playerid, 0);
  178.  
  179. if(IsPlayerNPC(playerid)) return NPC_OnPlayerConnect(playerid);
  180.  
  181. #if Debug
  182. printf("OnPlayerConnect(%d)", playerid);
  183. #endif
  184.  
  185. SetTimerEx("Clear", 125, false, "d", playerid);
  186. if(!Player(playerid, player_cam_timer))
  187. Player(playerid, player_cam_timer) = SetTimerEx("TimerCameraChange", 10000, 1, "d", playerid);
  188. GetPlayerIp(playerid, Player(playerid, player_ip), 18);
  189.  
  190. FadePlayerConnect(playerid);
  191. TextDrawShowForPlayer(playerid, Setting(setting_td_box)[ 0 ]);
  192. TextDrawShowForPlayer(playerid, Setting(setting_td_box)[ 1 ]);
  193.  
  194. Dialog::Output(playerid, 10, DIALOG_STYLE_PASSWORD, IN_HEAD" "white"» "grey"Zaloguj się", TEXT_LOGIN, "Zaloguj", "Wyjdź");
  195. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 255, 15, 0); // Rozjaśnienie
  196. Player(playerid, player_dark) = dark_login;
  197. return 1;
  198. }
  199.  
  200. FuncPub::Clear(playerid)
  201. {
  202. SetPlayerColor(playerid, 0x00000000);
  203. for(new i; i <= 100; i++)
  204. Chat::Output(playerid, 1, " ");
  205. return 1;
  206. }
  207.  
  208. FuncPub::loginTimer(playerid)
  209. {
  210. if(Player(playerid, player_login_timer))
  211. {
  212. KillTimer(Player(playerid, player_login_timer));
  213. Player(playerid, player_login_timer) = 0;
  214. if(Player(playerid, player_cam_timer))
  215. {
  216. KillTimer(Player(playerid, player_cam_timer));
  217. Player(playerid, player_cam_timer) = 0;
  218. }
  219. Chat::Output(playerid, CLR_RED, "Czas na zalogowanie minął!");
  220. SetTimerEx("kickEx", 500, false, "d", playerid);
  221. }
  222. return 1;
  223. }
  224.  
  225. FuncPub::ClearData(playerid)
  226. {
  227. Player(playerid, player_skuty) = INVALID_PLAYER_ID;
  228. Player(playerid, player_re) = INVALID_PLAYER_ID;
  229. Player(playerid, player_spec) = INVALID_PLAYER_ID;
  230. Player(playerid, player_npc) = INVALID_PLAYER_ID;
  231. Player(playerid, player_color) = player_nick_def;
  232. Player(playerid, player_opis_id) = Text3D:INVALID_3DTEXT_ID;
  233. Player(playerid, player_tag) = Text3D:INVALID_3DTEXT_ID;
  234. Player(playerid, player_veh) = INVALID_VEHICLE_ID;
  235. Player(playerid, player_spray) = Text3D:INVALID_3DTEXT_ID;
  236. Player(playerid, player_selected_object) = INVALID_OBJECT_ID;
  237.  
  238. Taxi(playerid, taxi_player) = INVALID_PLAYER_ID;
  239.  
  240. Phone(playerid, phone_to) = INVALID_PLAYER_ID;
  241. Phone(playerid, phone_incoming) = INVALID_PLAYER_ID;
  242.  
  243. Tren(playerid, train_obj) = INVALID_OBJECT_ID;
  244. return 1;
  245. }
  246.  
  247. public OnPlayerDisconnect(playerid, reason)
  248. {
  249. #if Debug
  250. printf("OnPlayerDisconnect(%d, %d)", playerid, reason);
  251. #endif
  252. if(Player(playerid, player_tag) != Text3D:INVALID_3DTEXT_ID)
  253. Delete3DTextLabel(Player(playerid, player_tag));
  254.  
  255. if(Player(playerid, player_opis_id) != Text3D:INVALID_3DTEXT_ID)
  256. Delete3DTextLabel(Player(playerid, player_opis_id));
  257.  
  258. if(Player(playerid, player_cam_timer)) KillTimer(Player(playerid, player_cam_timer));
  259. if(Player(playerid, player_fuel_timer)) KillTimer(Player(playerid, player_fuel_timer));
  260. if(Player(playerid, player_jail_timer)) KillTimer(Player(playerid, player_jail_timer));
  261. if(Player(playerid, player_drug_timer)) KillTimer(Player(playerid, player_drug_timer));
  262. if(Player(playerid, player_login_timer)) KillTimer(Player(playerid, player_login_timer));
  263. if(Player(playerid, player_fish_timer)) KillTimer(Player(playerid, player_fish_timer));
  264. if(Player(playerid, player_achiv_timer)) KillTimer(Player(playerid, player_achiv_timer));
  265. if(Player(playerid, player_bus_timer)) KillTimer(Player(playerid, player_bus_timer));
  266. if(Player(playerid, player_veh_timer)) KillTimer(Player(playerid, player_veh_timer));
  267. if(Player(playerid, player_door_timer)) KillTimer(Player(playerid, player_door_timer));
  268. if(Player(playerid, player_mobile_timer)) KillTimer(Player(playerid, player_mobile_timer));
  269. if(Player(playerid, player_kara_timer)) KillTimer(Player(playerid, player_kara_timer));
  270. if(Player(playerid, player_cmd_timer)) KillTimer(Player(playerid, player_cmd_timer));
  271. if(Player(playerid, player_text_timer)) KillTimer(Player(playerid, player_text_timer));
  272. if(Player(playerid, player_aduty)) EnterAdminDuty(playerid);
  273.  
  274. UpdateInfos();
  275.  
  276. new string[ 200 ];
  277. if(!IsPlayerNPC(playerid))
  278. {
  279. format(string, sizeof string,
  280. "INSERT INTO `surv_connect` VALUES (NULL, '%d', UNIX_TIMESTAMP(), '%d', '%s', '%d', '%d')",
  281. Player(playerid, player_uid),
  282. _:Player(playerid, player_logged),
  283. Player(playerid, player_ip),
  284. Player(playerid, player_timehere)[ 1 ],
  285. Player(playerid, player_afktime)[ 2 ]
  286. );
  287. mysql_query(string);
  288.  
  289. if(!Player(playerid, player_logged)) return 1;
  290.  
  291. format(string, sizeof string,
  292. "DELETE FROM `all_online` WHERE `player` = '%d' AND `ID` = '%d' AND `type` = '"#type_rp"'",
  293. Player(playerid, player_uid),
  294. playerid
  295. );
  296. mysql_query(string);
  297.  
  298. OnPlayerLoginOut(playerid);
  299. }
  300.  
  301. new Text3D:End,
  302. TimePlay[ 45 ];
  303. ReturnTime(Player(playerid, player_timehere)[ 1 ], TimePlay);
  304. format(string, sizeof string, "%s\n(( %s ))\nGrał: %s", NickName(playerid), DiscReason[ reason ], TimePlay);
  305. End = Create3DTextLabel(string, SZARY, Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ] + 0.5, 50, Player(playerid, player_vw), 1);
  306. SetTimerEx("End_TD", 10000, false, "i", _:End);
  307.  
  308. for(new i; i < MAX_GROUPS; i++)
  309. for(new eGroups:d; d < eGroups; d++)
  310. Group(playerid, i, d) = 0;
  311.  
  312. for(new ePlayers:i; i < ePlayers; i++)
  313. Player(playerid, i) = 0;
  314. ClearData(playerid);
  315. return 1;
  316. }
  317.  
  318. FuncPub::End_TD(textid)
  319. {
  320. Delete3DTextLabel(Text3D:textid);
  321. return 1;
  322. }
  323.  
  324. public OnPlayerText(playerid, text[])
  325. {
  326. if(!text[ 0 ]) return false;
  327. #if Debug
  328. if(!IsPlayerNPC(playerid)) printf("OnPlayerText(%d, %s)", playerid, text);
  329. #endif
  330.  
  331. if(!Player(playerid, player_logged))
  332. {
  333. Dialog::Output(playerid, 10, DIALOG_STYLE_PASSWORD, IN_HEAD" "white"» "grey"Zaloguj się", TEXT_LOGIN, "Zaloguj", "Wyjdź");
  334. return false;
  335. }
  336. if(!Player(playerid, player_spawned))
  337. return false;
  338. if(Player(playerid, player_aj))
  339. {
  340. ShowInfo(playerid, TEXT_AJ);
  341. return false;
  342. }
  343. if(Player(playerid, player_bw))
  344. {
  345. ShowInfo(playerid, red"Nie możesz rozmawiać podczas BW!");
  346. return false;
  347. }
  348. if(text[ 0 ] == '-' || text[ 0 ] == '.')
  349. {
  350. SetAnimationByName(playerid, text[ 1 ]);
  351. return false;
  352. }
  353. if(Player(playerid, player_knebel))
  354. {
  355. ShowInfo(playerid, red"Jesteś zakneblowany!");
  356. return false;
  357. }
  358.  
  359. Player(playerid, player_texts)++;
  360. if(!Player(playerid, player_text_timer))
  361. Player(playerid, player_text_timer) = SetTimerEx("CheckSpamChat", 5000, false, "d", playerid);
  362.  
  363. if(IsPlayerVisibleItems(playerid) && Player(playerid, player_option) & option_textdraw)
  364. {
  365. Items_OnPlayerText(playerid, text);
  366. return false;
  367. }
  368. if(Phone(playerid, phone_to) != INVALID_PLAYER_ID && Phone(Phone(playerid, phone_to), phone_to) == playerid)
  369. {
  370. Tel_OnPlayerText(playerid, text);
  371. return false;
  372. }
  373. if(!strcmp(text, ":D", true))
  374. {
  375. cmd_me(playerid, "śmieje się.");
  376. ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.1, 0, 0, 0, 0, 0);
  377. }
  378. else if(!strcmp(":P", text, true))
  379. {
  380. cmd_me(playerid, "wystawia język.");
  381. }
  382. else if(!strcmp(":/", text, true))
  383. {
  384. cmd_me(playerid, "krzywi się.");
  385. }
  386. else if(!strcmp(":(", text, true) || !strcmp(";(", text, true))
  387. {
  388. cmd_me(playerid, "robi smutną minę.");
  389. }
  390. else if(!strcmp(":)", text, true))
  391. {
  392. cmd_me(playerid, "uśmiecha się.");
  393. }
  394. else if(!strcmp(";)", text, true))
  395. {
  396. cmd_me(playerid, "mruga jednym okiem.");
  397. }
  398. else if(!strcmp(":o", text, true) || !strcmp(";o", text, true))
  399. {
  400. cmd_me(playerid, "dziwi się.");
  401. }
  402. else if(!strcmp("XD", text, true))
  403. {
  404. cmd_me(playerid, "wybucha śmiechem.");
  405. ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.1, 0, 0, 0, 0, 0);
  406. }
  407. else if(!strcmp(":*", text, true))
  408. {
  409. cmd_me(playerid, "robi dzióbek.");
  410. }
  411. else if(text[ 0 ] == '!' || text[ 0 ] == '@')
  412. {
  413. Group_OnPlayerText(playerid, text);
  414. return false;
  415. }
  416. else
  417. {
  418. if(strfind(text, "Witam", false) != -1 && !IsPlayerNPC(playerid))
  419. {
  420. for(new n; n != sizeof NpcData; n++)
  421. {
  422. if(NPC(n, npc_door) != Player(playerid, player_door)) continue;
  423. if(NPC(n, npc_pos)[ 0 ] == 0.0 && NPC(n, npc_pos)[ 1 ] == 0.0 && NPC(n, npc_pos)[ 2 ] == 0.0) continue;
  424. if(!IsPlayerInRangeOfPoint(playerid, 3.0, NPC(n, npc_pos)[ 0 ], NPC(n, npc_pos)[ 1 ], NPC(n, npc_pos)[ 2 ])) continue;
  425. if(NPC(n, npc_function) == npc_func_gov)
  426. {
  427. new buffer[ 350 ];
  428. for(new d; d != sizeof LicName; d++)
  429. {
  430. if(LicName[ d ][ lic_group ] != group_type_gov) continue;
  431. if(d != 6) continue;
  432. format(buffer, sizeof buffer, "%s%d\t"green2"$"white"%.2f\t\t%s\n", buffer, d, LicName[ d ][ lic_price ] + LicName[ d ][ lic_price_before ], LicName[ d ][ lic_name ]);
  433. }
  434. Dialog::Output(playerid, 157, DIALOG_STYLE_LIST, IN_HEAD" "white"» "grey"Wyrób dokument", buffer, "Wybierz", "Zamknij");
  435.  
  436. OnPlayerText(NPC(n, npc_playerid), "Witam, w czym mogę pomóc?");
  437.  
  438. Player(playerid, player_npc) = n;
  439. break;
  440. }
  441. }
  442. }
  443. if(strfind(text, "Znalazłem Cię!", true) != -1 && !IsPlayerNPC(playerid))
  444. {
  445. for(new n; n != sizeof NpcData; n++)
  446. {
  447. if(NPC(n, npc_pos)[ 0 ] == 0.0 && NPC(n, npc_pos)[ 1 ] == 0.0 && NPC(n, npc_pos)[ 2 ] == 0.0) continue;
  448. if(!IsPlayerInRangeOfPoint(playerid, 3.0, NPC(n, npc_pos)[ 0 ], NPC(n, npc_pos)[ 1 ], NPC(n, npc_pos)[ 2 ])) continue;
  449. if(NPC(n, npc_function) == npc_func_achiv)
  450. {
  451. //OnPlayerText(NPC(n, npc_playerid), "Kurwa, złapałeś mnie. Masz mój hajs..");
  452. NPC_SetRandomPos(n, NPC(n, npc_playerid));
  453. GivePlayerMoneyEx(playerid, randomEx(1, 10), true);
  454. }
  455. }
  456. }
  457. new len = strlen(text),
  458. back,
  459. string[ 128 ];
  460.  
  461. text[ 0 ] = toupper(text[ 0 ]);
  462. if(text[ len-1 ] != '.' && text[ len-1 ] != '?' && text[ len-1 ] != '!' && text[ len-1 ] != '*')
  463. back = '.';
  464.  
  465. /*
  466. if(len >= 5 && Player(playerid, player_drunklvl) > 5000)
  467. {
  468. for(new g = 3; g <= len; g += random(5)+2)
  469. {
  470. if(g >= len) break;
  471. if(text[ g ] != '.' && text[ g ] != '?' && text[ g ] != '!') continue;
  472. if(text[ g ] == ' ') continue;
  473. if(isupper(text[g])) text[g] = znaki[randomEx(24, sizeof znaki - 10)];
  474. else if(islower(text[g])) text[g] = znaki[random(24)];
  475. else continue;
  476. }
  477. }*/
  478.  
  479. format(string, sizeof string, "%s mówi: %s%c", NickName(playerid), text, back);
  480. if(Player(playerid, player_veh) != INVALID_VEHICLE_ID && Vehicle(Player(playerid, player_veh), vehicle_option) & option_window)
  481. SendWrappedMessageToPlayerRange(playerid, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5, string, 2, MAX_LINE);
  482. else
  483. SendWrappedMessageToPlayerRange(playerid, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5, string, 14, MAX_LINE);
  484.  
  485. if(!Player(playerid, player_anim) && !IsPlayerInAnyVehicle(playerid) && Player(playerid, player_option) & option_anim_m)
  486. {
  487. SetAnimationByGame(playerid, Player(playerid, player_anim_chat), len);
  488. }
  489.  
  490. }
  491. return 0;
  492. }
  493.  
  494. public OnPlayerRequestClass(playerid, classid)
  495. {
  496. if(IsPlayerNPC(playerid)) return NPC_OnPlayerRequestClass(playerid, classid);
  497. #if Debug
  498. printf("OnPlayerRequestClass(%d)", playerid);
  499. #endif
  500. if(!Player(playerid, player_logged)) return 1;
  501. return 1;
  502. }
  503.  
  504. public OnPlayerRequestSpawn(playerid)
  505. {
  506. if(IsPlayerNPC(playerid)) return 1;
  507. #if Debug
  508. printf("OnPlayerRequestSpawn(%d)", playerid);
  509. #endif
  510.  
  511. if(!Player(playerid, player_logged)) return 0;
  512. return 1;
  513. }
  514.  
  515. public OnPlayerSpawn(playerid)
  516. {
  517. if(IsPlayerNPC(playerid)) return NPC_OnPlayerSpawn(playerid);
  518. #if Debug
  519. printf("OnPlayerSpawn(%d)", playerid);
  520. #endif
  521. if(!Player(playerid, player_logged)) return 1;
  522.  
  523. if(isnull(Player(playerid, player_ip)))
  524. GetPlayerIp(playerid, Player(playerid, player_ip), 18);
  525. if(Itter_Count(Player) > DOF2_GetInt(IN_BAZA, "players"))
  526. DOF2_SetInt(IN_BAZA, "players", Itter_Count(Player));
  527.  
  528. KillTimer(Player(playerid, player_cam_timer));
  529. Player(playerid, player_cam_timer) = 0;
  530. Audio_Stop(playerid, Player(playerid, player_connect_sound));
  531.  
  532. Player(playerid, player_spawned) = true;
  533.  
  534. SetPlayerHealth(playerid, Player(playerid, player_hp));
  535.  
  536. SetPlayerPosEx(playerid, Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ]);
  537. SetPlayerInterior(playerid, Player(playerid, player_int));
  538. SetPlayerVirtualWorld(playerid, Player(playerid, player_vw));
  539. SetPlayerDrunkLevel(playerid, Player(playerid, player_drunklvl));
  540.  
  541. SetPlayerSkin(playerid, Player(playerid, player_skin));
  542.  
  543. if(Player(playerid, player_option) & option_fight)
  544. SetPlayerFightingStyle(playerid, FightData[ Player(playerid, player_fight) ][ fight_id ]);
  545. else
  546. SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
  547.  
  548. SetPlayerMoney(playerid, Player(playerid, player_cash));
  549.  
  550. PlayerTextDrawShow(playerid, Player(playerid, player_cash_td));
  551. // PlayerTextDrawShow(playerid, Player(playerid, player_infos));
  552.  
  553. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
  554. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
  555. SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
  556. SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
  557. SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
  558. SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1);
  559. SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
  560. SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
  561. SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
  562. SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
  563. SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
  564.  
  565. if(!Player(playerid, player_reload_anims))
  566. {
  567. PreloadAnimLibraries(playerid);
  568. Player(playerid, player_reload_anims) = true;
  569. }
  570.  
  571. if(Player(playerid, player_bw))
  572. {
  573. FreezePlayerEx(playerid);
  574. SetPlayerHealth(playerid, Player(playerid, player_hp) = 999999.0);
  575. SetTimerEx("AntyCheat_Enable", 3000, false, "d", playerid);
  576. }
  577. else UnFreezePlayer(playerid);
  578.  
  579. #if !STREAMER
  580. LoadPlayerObjects(playerid, Player(playerid, player_vw));
  581. #endif
  582. LoadPlayerText(playerid, Player(playerid, player_vw));
  583. LoadSounds(playerid);
  584. CancelSelectTextDraw(playerid);
  585. SetPlayerAttachedObjects(playerid, Player(playerid, player_uid));
  586.  
  587. if(!(Player(playerid, player_option) & option_panor))
  588. {
  589. TextDrawHideForPlayer(playerid, Setting(setting_td_box)[ 0 ]);
  590. TextDrawHideForPlayer(playerid, Setting(setting_td_box)[ 1 ]);
  591. }
  592.  
  593. if(Player(playerid, player_option) & option_news)
  594. {
  595. TextDrawShowForPlayer(playerid, Setting(setting_sn)[ 0 ]);
  596. TextDrawShowForPlayer(playerid, Setting(setting_sn)[ 1 ]);
  597. }
  598. else
  599. {
  600. TextDrawHideForPlayer(playerid, Setting(setting_sn)[ 0 ]);
  601. TextDrawHideForPlayer(playerid, Setting(setting_sn)[ 1 ]);
  602. }
  603. if(!Player(playerid, player_height))
  604. {
  605. new buffer[ 512 ];
  606. for(new x = 160; x != 210; x++)
  607. format(buffer, sizeof buffer, "%s%dcm\n", buffer, x);
  608.  
  609. Dialog::Output(playerid, 170, DIALOG_STYLE_LIST, "Wybierz wzrost postaci", buffer, "Wybierz", "Później");
  610. }
  611. else if(!(Player(playerid, player_option) & option_vehicle) && Player(playerid, player_timehere)[ 0 ] > 7200)
  612. {
  613. new buffer[ 512 ];
  614. for(new x; x != sizeof StartingVehicle; x++)
  615. format(buffer, sizeof buffer, "%s%d\t%s\n", buffer, x, NazwyPojazdow[StartingVehicle[ x ] - 400]);
  616. Dialog::Output(playerid, 11, DIALOG_STYLE_LIST, "Wybierz pojazd startowy", buffer, "Wybierz", "Później");
  617. }
  618.  
  619. SetCameraBehindPlayer(playerid);
  620. return 1;
  621. }
  622.  
  623. public OnPlayerDeath(playerid, killerid, reason)
  624. {
  625. #if Debug
  626. printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
  627. #endif
  628. Player(playerid, player_spawned) = false;
  629. if(killerid != INVALID_PLAYER_ID)
  630. {
  631. // Fake Kill
  632. if(!OdlegloscMiedzyGraczami(25.0, playerid, killerid) || Player(killerid, player_timehere)[ 0 ] < 7200)
  633. {
  634. //BW(playerid, 1);
  635. }
  636. if((gettime() - Player(playerid, player_killed_time)) < 1)
  637. {
  638. Player(playerid, player_killed)++;
  639. if(Player(playerid, player_killed) == 3)
  640. {
  641. //new msg[126];
  642. //format(msg,sizeof(msg),"Gracz o ID: %d wykonuje FakeKille!",playerid);
  643. //SendClientMessageToAll(-1,msg);
  644. //SendClientMessage(playerid,-1,"Zostałeś Zbanowany! Powód: FakeKilling");
  645. //BanEx(playerid,"FakeKill");
  646. printf("Gracz o ID: %d wykonuje FakeKille!", playerid);
  647. Kick(playerid);
  648. }
  649. }
  650. else Player(playerid, player_killed) = 0;
  651. Player(playerid, player_killed_time) = gettime();
  652. }
  653. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  654. //printf("State: %f %f %f %d %d", Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_vw), Player(playerid, player_int));
  655. BW(playerid, (!reason) ? 5 : 10);
  656. return 1;
  657. }
  658.  
  659. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  660. {
  661. if(!Player(playerid, player_uid) && Player(playerid, player_cam_timer))
  662. SelectTextDraw(playerid, GREEN); // TODO
  663. if(!Player(playerid, player_spawned) || !Player(playerid, player_logged) || IsPlayerNPC(playerid))
  664. return 1;
  665.  
  666. if(Player(playerid, player_afktime)[ 0 ] > 4)
  667. {
  668. Player(playerid, player_afktime)[ 0 ] = 0;
  669. UpdatePlayerNick(playerid);
  670. }
  671. if(!GetPlayerVehicleID(playerid))
  672. {
  673. if(Player(playerid, player_fish))
  674. if(PRESSED(KEY_SPRINT))
  675. Player(playerid, player_fish)--;
  676.  
  677. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
  678. if(PRESSED(KEY_JUMP) || PRESSED(KEY_SPRINT))
  679. ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
  680.  
  681. if(PRESSED(KEY_HANDBRAKE) && GetPlayerWeapon(playerid) >= 22)
  682. {
  683. Player(playerid, player_aim) = true;
  684.  
  685. if(Player(playerid, player_option) & option_shooting)
  686. {
  687. Player(playerid, player_aim_object) = CreateObject(playerid, 19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  688. AttachObjectToPlayer(Player(playerid, player_aim_object), playerid, (Player(playerid, player_option) & option_hand) ? (-0.5) : (0.5), -0.92, Player(playerid, player_crouch) ? (0.3) : (0.6), 0.0, 0.0, 0.0);
  689. AttachCameraToObject(playerid, Player(playerid, player_aim_object));
  690. }
  691. //if(Player(playerid, player_stamina) <= 3050 && Repair(playerid, repair_type) != repair_spray && !Player(playerid, player_anim) && !IsPlayerInTypeGroup(playerid, group_type_pd))
  692. //SetPlayerDrunkLevel(playerid, 4990);
  693. }
  694. else if(RELEASED(KEY_HANDBRAKE) && Player(playerid, player_aim))
  695. {
  696. Player(playerid, player_aim) = false;
  697. DestroyObject(Player(playerid, player_aim_object));
  698. SetCameraBehindPlayer(playerid);
  699. //if(Player(playerid, player_stamina) <= 3050)
  700. //SetPlayerDrunkLevel(playerid, Player(playerid, player_drunklvl));
  701. }
  702. if(newkeys == (KEY_HANDBRAKE + KEY_YES) && Player(playerid, player_aim))
  703. {
  704. if(Player(playerid, player_option) & option_hand)
  705. Player(playerid, player_option) -= option_hand;
  706. else
  707. Player(playerid, player_option) += option_hand;
  708.  
  709. AttachObjectToPlayer(Player(playerid, player_aim_object), playerid, (Player(playerid, player_option) & option_hand) ? (-0.5) : (0.5), -0.92, Player(playerid, player_crouch) ? (0.3) : (0.6), 0.0, 0.0, 0.0);
  710. AttachCameraToObject(playerid, Player(playerid, player_aim_object));
  711. }
  712. if(Repair(playerid, repair_type) == repair_spray)
  713. {
  714. if(PRESSED(KEY_FIRE))
  715. {
  716. KillTimer(GetPVarInt(playerid, "Paint"));
  717. DeletePVar(playerid, "Paint");
  718. SetPVarInt(playerid, "Paint", SetTimerEx("Paint_Timer", 750, 1, "d", playerid));
  719. }
  720. else if(RELEASED(KEY_FIRE))
  721. {
  722. KillTimer(GetPVarInt(playerid, "Paint"));
  723. DeletePVar(playerid, "Paint");
  724. }
  725. }
  726.  
  727. Doors_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  728. Anims_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  729. Train_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  730. }
  731. else Vehicle_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  732.  
  733. Admin_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  734. Items_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  735. return 1;
  736. }
  737.  
  738. FuncPub::Paint_Timer(playerid)
  739. {
  740. if(GetPlayerWeapon(playerid) != 41)
  741. return GameTextForPlayer(playerid,"~r~Wyciagnij spray can!", 3000, 3);
  742. if(GetPlayerWeaponState(playerid) == WEAPONSTATE_RELOADING)
  743. return 1;
  744.  
  745. new vehicleid = Repair(playerid, repair_value)[ 2 ];
  746. if(!IsPlayerFacingVehicle(playerid, vehicleid))
  747. return GameTextForPlayer(playerid,"~w~odwroc sie w strone ~n~auta, inaczej malowanie zostanie ~r~przerwane~w~!", 3000, 3);
  748.  
  749. new victimid = Repair(playerid, repair_player);
  750. if(GetDistanceToCar(playerid, vehicleid) > 15.0 && !Vehicle(vehicleid, vehicle_uid))
  751. {
  752. GameTextForPlayer(playerid, "~n~~r~Malowanie przerwane!", 3000, 4);
  753. GameTextForPlayer(victimid, "~n~~r~Malowanie przerwane!", 3000, 4);
  754. GivePlayerMoneyEx(victimid, Repair(playerid, repair_cash), true);
  755.  
  756. KillTimer(GetPVarInt(playerid, "Paint"));
  757. DeletePVar(playerid, "Paint");
  758. End_Repair(playerid);
  759. return 1;
  760. }
  761. new string[ 126 ],
  762. Float:procent,
  763. bar[ 32 ],
  764. end;
  765. Repair(playerid, repair_time)++;
  766.  
  767. if(Repair(playerid, repair_value)[ 1 ] == -1)
  768. {
  769. end = 300;
  770. procent = floatmul(floatdiv(Repair(playerid, repair_time), end), 100);
  771. }
  772. else
  773. {
  774. end = 50;
  775. procent = floatmul(floatdiv(Repair(playerid, repair_time), end), 100);
  776. }
  777. if(procent >= 100) bar = green"----------";
  778. else if(procent >= 90) bar = green"---------"white"-";
  779. else if(procent >= 80) bar = green"--------"white"--";
  780. else if(procent >= 70) bar = green"-------"white"---";
  781. else if(procent >= 60) bar = green"------"white"----";
  782. else if(procent >= 50) bar = green"-----"white"-----";
  783. else if(procent >= 40) bar = green"----"white"------";
  784. else if(procent >= 30) bar = green"---"white"-------";
  785. else if(procent >= 20) bar = green"--"white"--------";
  786. else if(procent >= 10) bar = green"-"white"---------";
  787. else bar = white"----------";
  788.  
  789. format(string, sizeof string,
  790. "Lakierowanie pojazdu %s\nUkończono w %.1f%%\n%s\n%d/%d",
  791. NazwyPojazdow[ Vehicle(vehicleid, vehicle_model) - 400 ],
  792. procent,
  793. bar
  794. );
  795. if(Player(playerid, player_spray) != Text3D:INVALID_3DTEXT_ID)
  796. Update3DTextLabelText(Player(playerid, player_spray), COLOR_PURPLE, string);
  797.  
  798. if(Repair(playerid, repair_time) == end)
  799. {
  800. new color[ 2 ];
  801. color[ 0 ] = Repair(playerid, repair_value)[ 0 ];
  802. color[ 1 ] = Repair(playerid, repair_value)[ 1 ];
  803.  
  804. SetPlayerMoney(playerid, Player(playerid, player_cash) += Repair(playerid, repair_cash));
  805.  
  806. if(color[ 1 ] != -1)
  807. {
  808. Vehicle(vehicleid, vehicle_color)[ 0 ] = color[ 0 ];
  809. Vehicle(vehicleid, vehicle_color)[ 1 ] = color[ 1 ];
  810. ChangeVehicleColor(vehicleid, Vehicle(vehicleid, vehicle_color)[ 0 ], Vehicle(vehicleid, vehicle_color)[ 1 ]);
  811. format(string, sizeof string,
  812. "UPDATE `surv_vehicles` SET `c1` = '%d', `c2` = '%d' WHERE `uid` = '%d'",
  813. Vehicle(vehicleid, vehicle_color)[ 0 ],
  814. Vehicle(vehicleid, vehicle_color)[ 1 ],
  815. Vehicle(vehicleid, vehicle_uid)
  816. );
  817. mysql_query(string);
  818. }
  819. else
  820. {
  821. Vehicle(vehicleid, vehicle_pj) = color[ 0 ];
  822. ChangeVehiclePaintjob(vehicleid, Vehicle(vehicleid, vehicle_pj));
  823. format(string, sizeof string,
  824. "UPDATE `surv_vehicles` SET `pj` = '%d' WHERE `uid` = '%d'",
  825. Vehicle(vehicleid, vehicle_color)[ 0 ],
  826. Vehicle(vehicleid, vehicle_uid)
  827. );
  828. mysql_query(string);
  829. }
  830.  
  831. GameTextForPlayer(playerid,"~n~~g~Przemalowano", 3000,4);
  832. PlayerPlaySound(playerid, 1134, 0.0, 0.0, 10.0);
  833.  
  834. KillTimer(GetPVarInt(playerid, "Paint"));
  835. DeletePVar(playerid, "Paint");
  836.  
  837. End_Repair(playerid);
  838. }
  839. return 1;
  840. }
  841.  
  842. public OnPlayerUpdate(playerid)
  843. {
  844. if(IsPlayerNPC(playerid)) return 1;
  845. /*
  846. if(!Player(playerid, player_spawned) || !Player(playerid, player_logged) || IsPlayerNPC(playerid))
  847. return 0;*/
  848.  
  849. if(GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36)
  850. return Kick(playerid);
  851.  
  852. if(Player(playerid, player_afktime)[ 0 ] > 4)
  853. {
  854. Player(playerid, player_afktime)[ 0 ] = 0;
  855. UpdatePlayerNick(playerid);
  856. }
  857.  
  858. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK && !Player(playerid, player_crouch))
  859. {
  860. Player(playerid, player_crouch) = true;
  861.  
  862. if(Player(playerid, player_aim))
  863. {
  864. AttachObjectToPlayer(Player(playerid, player_aim_object), playerid, (Player(playerid, player_option) & option_hand) ? (-0.5) : (0.5), -0.92, 0.3, 0.0, 0.0, 0.0);
  865. AttachCameraToObject(playerid, Player(playerid, player_aim_object));
  866. }
  867. }
  868. else if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK && Player(playerid, player_crouch))
  869. {
  870. Player(playerid, player_crouch) = false;
  871.  
  872. if(Player(playerid, player_aim))
  873. {
  874. AttachObjectToPlayer(Player(playerid, player_aim_object), playerid, (Player(playerid, player_option) & option_hand) ? (-0.5) : (0.5), -0.92, 0.6, 0.0, 0.0, 0.0);
  875. AttachCameraToObject(playerid, Player(playerid, player_aim_object));
  876. }
  877. }
  878. Items_OnPlayerUpdate(playerid);
  879. Skin_OnPlayerUpdate(playerid);
  880. return 1;
  881. }
  882.  
  883. /*
  884. * OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  885. * playerid = strzelający
  886. * damagedid = postrzelony
  887. * amount = ilość HP
  888. * weaponid = ID użytej broni
  889. */
  890. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  891. {
  892. #if Debug
  893. printf("OnPlayerGiveDamage(%d, %d, %f, %d, %d)", playerid, damagedid, amount, weaponid, bodypart);
  894. #endif
  895.  
  896. return 1;
  897. }
  898.  
  899. /*
  900. * OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  901. * playerid = postrzelony
  902. * issuerid = strzelający
  903. * amount = ilość HP
  904. * weaponid = ID użytej broni
  905. */
  906. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  907. {
  908. #if Debug
  909. printf("OnPlayerTakeDamage(%d, %d, %f, %d, %d)", playerid, issuerid, amount, weaponid, bodypart);
  910. #endif
  911. if(issuerid != INVALID_PLAYER_ID)
  912. {
  913. if(IsPlayerNPC(issuerid)) return 1;
  914. if(!IsPlayerInAnyVehicle(issuerid) && Weapon(issuerid, Player(issuerid, player_used_weapon), weapon_model) != weaponid && !Weapon(issuerid, Player(issuerid, player_used_weapon), weapon_uid) && weaponid)
  915. {
  916. print("[AC]Damage bez broni");
  917. Kick(issuerid);
  918. return 1;
  919. }
  920. if(Weapon(issuerid, Player(issuerid, player_used_weapon), weapon_uid) && Weapon(issuerid, Player(issuerid, player_used_weapon), weapon_model))
  921. {
  922. if(Weapon(issuerid, Player(issuerid, player_used_weapon), weapon_flag) & weapon_flag_paral)
  923. {
  924. FreezePlayer(playerid);
  925. SetTimerEx("UnFreezePlayer", 5000, false, "d", playerid);
  926. SetPlayerHealth(playerid, Player(playerid, player_hp));
  927. ApplyAnimation(playerid, "CRACK", "crckidle1", 4.1, 1, 0, 0, 0, 0);
  928. Player(playerid, player_anim) = true;
  929. return 1;
  930. }
  931. if(Player(playerid, player_hp) < 20.0 && GetPlayerWeapon(issuerid) >= 22)
  932. {
  933. FreezePlayer(playerid);
  934. SetTimerEx("UnFreezePlayer", 5000, false, "d", playerid);
  935. ApplyAnimation(playerid, "CRACK", "crckidle1", 4.1, 1, 0, 0, 0, 0);
  936. Player(playerid, player_anim) = true;
  937. }
  938. }
  939. if(Player(issuerid, player_timehere)[ 0 ] < 7200 || Player(issuerid, player_block) & block_norun)
  940. {
  941. SetPlayerHealth(playerid, Player(playerid, player_hp));
  942. return 1;
  943. }
  944. }
  945. new amo = floatval(amount);
  946.  
  947. Player(playerid, player_hp) -= amount;
  948.  
  949. if(HavePlayerWeapon(issuerid))
  950. {
  951. if(!(bodypart == 0 || bodypart == 1 || bodypart == 2))
  952. {
  953. new string[ 64 ];
  954. Player(playerid, player_shot_body)[ bodypart ]++;
  955.  
  956. format(string, sizeof string, "Trafiłeś w %s.", BodyParts[ bodypart ]);
  957. Chat::Output(issuerid, CLR_RED, string);
  958.  
  959. format(string, sizeof string, "Dostałeś w %s.", BodyParts[ bodypart ]);
  960. Chat::Output(playerid, CLR_RED, string);
  961. }
  962. }
  963.  
  964. if((Player(playerid, player_screen) + (amo/10)+1) < 15)
  965. Player(playerid, player_screen) += (amo/10)+1;
  966. else
  967. Player(playerid, player_screen) = 15;
  968.  
  969. if(Player(playerid, player_screen))
  970. Player(playerid, player_color) = player_nick_red;
  971.  
  972. if(amo) TextDrawShowForPlayer(playerid, Setting(setting_red));
  973.  
  974. /* if((Player(playerid, player_pulse) + (amo*2)+1) < 200)
  975. Player(playerid, player_pulse) += (amo*2)+1;
  976. else
  977. Player(playerid, player_pulse) = 200;*/
  978.  
  979. Energy(playerid);
  980. UpdatePlayerNick(playerid);
  981. return 1;
  982. }
  983.  
  984. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  985. {
  986. if(IsPlayerNPC(playerid)) return 1;
  987.  
  988. if(HavePlayerWeapon(playerid) && Weapon(playerid, Player(playerid, player_used_weapon), weapon_ammo) && Weapon(playerid, Player(playerid, player_used_weapon), weapon_uid))
  989. Weapon(playerid, Player(playerid, player_used_weapon), weapon_ammo)--;
  990.  
  991. if(Weapon(playerid, Player(playerid, player_used_weapon), weapon_flag) & weapon_flag_nodmg)
  992. return 0;
  993.  
  994. if(Repair(playerid, repair_type) == repair_spray && weaponid == 41)
  995. return 0;
  996.  
  997. if(Player(playerid, player_timehere)[ 0 ] < 7200)
  998. return 0;
  999.  
  1000. if(!IsPlayerInAnyVehicle(playerid) && weaponid && weaponid != Weapon(playerid, Player(playerid, player_used_weapon), weapon_model) && !Weapon(playerid, Player(playerid, player_used_weapon), weapon_uid))
  1001. {
  1002. Kick(playerid);
  1003. return 0;
  1004. }
  1005. if(!(IsPlayerInTypeGroup(playerid, group_type_gang) || IsPlayerInTypeGroup(playerid, group_type_mafia) || IsPlayerInTypeGroup(playerid, group_type_pd) || IsPlayerInTypeGroup(playerid, group_type_mafia)))
  1006. {
  1007. if(hittype == BULLET_HIT_TYPE_VEHICLE && HavePlayerWeapon(playerid))
  1008. return 0;
  1009. if(hittype == BULLET_HIT_TYPE_PLAYER && IsPlayerInAnyVehicle(playerid))
  1010. return 0;
  1011. }
  1012. return 1;
  1013. }
  1014.  
  1015. public OnPlayerPickUpPickup(playerid, pickupid)
  1016. {
  1017. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1018. Pickup_OnPlayerPickUpPickup(playerid, pickupid);
  1019. Door_OnPlayerPickUpPickup(playerid, pickupid);
  1020. return 1;
  1021. }
  1022.  
  1023. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1024. {
  1025. #define dialogid Player(playerid, player_dialog)
  1026.  
  1027. if(Audio_IsClientConnected(playerid))
  1028. {
  1029. if(response) Audio_Play(playerid, gui_button1_sound);
  1030. else Audio_Play(playerid, gui_button2_sound);
  1031. }
  1032. else
  1033. {
  1034. if(response) PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1035. else PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
  1036. }
  1037.  
  1038. #if Debug
  1039. if(dialogid != 999 && dialogid != cellmin && dialogid != 10)
  1040. printf("OnDialogResponse(%d, %d, %d, %d, %s)", playerid, dialogid, response, listitem, inputtext);
  1041. #endif
  1042. if(dialogid != cellmin && dialogid != dialogid)
  1043. response = false;
  1044.  
  1045. A_CHAR(inputtext);
  1046.  
  1047. Pc_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1048. Bus_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1049. Tel_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1050. //NPC_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1051. Door_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1052. Bank_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1053. Sejf_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1054. Opis_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1055. Anims_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1056. Items_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1057. Offer_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1058. Admin_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1059. Order_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1060. Pickup_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1061. Friends_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1062. Vehicle_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1063.  
  1064. switch(dialogid)
  1065. {
  1066. case 1: // SelectSpawn(playerid)
  1067. {
  1068. new uid = strval(inputtext),
  1069. query[ 100 ];
  1070.  
  1071. format(query, sizeof query, "SELECT * FROM `surv_spawns` WHERE `uid` = '%d'", uid);
  1072. mysql_query(query);
  1073. mysql_store_result();
  1074. mysql_fetch_row_format(query);
  1075. sscanf(query, "p<|>{d}a<f>[4]dd",
  1076. Player(playerid, player_position),
  1077. Player(playerid, player_vw),
  1078. Player(playerid, player_int)
  1079. );
  1080. mysql_free_result();
  1081.  
  1082. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  1083.  
  1084. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  1085. Player(playerid, player_dark) = dark_spawn;
  1086. }
  1087. case 10:
  1088. {
  1089. if(!response) return SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  1090. if(isnull(inputtext) || strlen(inputtext) > 21)
  1091. return Dialog::Output(playerid, 10, DIALOG_STYLE_PASSWORD, IN_HEAD" "white"» "grey"Zaloguj się", TEXT_LOGIN"\n\nNie podałeś hasła!", "Zaloguj", "Wyjdź");
  1092.  
  1093. new salt[ 10 ],
  1094. bool:log,
  1095. buffer[ 256 ],
  1096. score;
  1097.  
  1098. //mysql_real_escape_string(inputtext, inputtext);
  1099. #if Forum == 1 // MyBB
  1100. format(buffer, sizeof buffer, "SELECT mybb_users.uid, mybb_users.username FROM `surv_players` JOIN mybb_users ON mybb_users.uid = surv_players.guid WHERE surv_players.name = '%s'", NickSamp(playerid));
  1101. #elseif Forum == 2 // IPB
  1102. format(buffer, sizeof buffer, "SELECT f.member_id, f.score, f.RP, f.RP_perm, f.members_display_name FROM `surv_players` JOIN "IN_PREF"members f ON f.member_id = surv_players.guid WHERE surv_players.name = '%s'", NickSamp(playerid));
  1103. #endif
  1104. mysql_query(buffer);
  1105. mysql_store_result();
  1106. if(mysql_num_rows())
  1107. {
  1108. mysql_fetch_row_format(buffer);
  1109. sscanf(buffer, "p<|>dddds[120]",
  1110. Player(playerid, player_guid),
  1111. score,
  1112. Player(playerid, player_adminlvl),
  1113. Player(playerid, player_adminperm),
  1114. Player(playerid, player_gname)
  1115. );
  1116. mysql_free_result();
  1117. log = true;
  1118. }
  1119. else
  1120. {
  1121. mysql_free_result();
  1122. #if Forum == 1 // MyBB
  1123. format(buffer, sizeof buffer, "SELECT mybb_users.uid, mybb_users.username FROM `surv_players` JOIN mybb_users ON mybb_users.uid = surv_players.guid WHERE mybb_users.username = '%s'", NickSamp(playerid));
  1124. #elseif Forum == 2 // IPB
  1125. format(buffer, sizeof buffer, "SELECT f.member_id, f.score, f.RP, f.RP_perm, f.members_display_name FROM `surv_players` JOIN "IN_PREF"members f ON f.member_id = surv_players.guid WHERE f.name = '%s'", NickSamp(playerid));
  1126. #endif
  1127. mysql_query(buffer);
  1128. mysql_store_result();
  1129. if(mysql_num_rows())
  1130. {
  1131. mysql_fetch_row_format(buffer);
  1132. sscanf(buffer, "p<|>dddds[120]",
  1133. Player(playerid, player_guid),
  1134. score,
  1135. Player(playerid, player_adminlvl),
  1136. Player(playerid, player_adminperm),
  1137. Player(playerid, player_gname)
  1138. );
  1139. mysql_free_result();
  1140. log = false;
  1141. }
  1142. else
  1143. {
  1144. mysql_free_result();
  1145. ShowInfo(playerid, red"Nie znaleziono konta globalnego o takiej nazwie.\n\nJeżeli podajesz dane prawidłowo, spróbuj zresetować hasło poprzez forum.");
  1146. SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  1147. return 1;
  1148. }
  1149. }
  1150.  
  1151. format(buffer, sizeof buffer,
  1152. "SELECT `members_pass_salt` FROM `"IN_PREF"members` WHERE `member_id` = '%d'",
  1153. Player(playerid, player_guid)
  1154. );
  1155. mysql_query(buffer);
  1156. mysql_store_result();
  1157. mysql_fetch_row(salt);
  1158. mysql_free_result();
  1159.  
  1160. new password[ 120 ];
  1161. format(password, sizeof password, "%s%s", MD5_Hash(salt), MD5_Hash(inputtext));
  1162. mysql_real_escape_string(password, password);
  1163. if(log == false) // Nazwa OOC
  1164. {
  1165. new query[ 256 ];
  1166. #if Forum == 1 // MyBB
  1167. format(query, sizeof query, "SELECT `uid` FROM `surv_players` JOIN mybb_users ON mybb_users.password = md5('%s') WHERE surv_players.guid = '%d' AND mybb_users.uid = '%d'", password, Player(playerid, player_guid), Player(playerid, player_guid));
  1168. #elseif Forum == 2 // IPB
  1169. format(query, sizeof query, "SELECT `uid` FROM `surv_players` JOIN "IN_PREF"members f ON f.members_pass_hash = md5('%s') WHERE surv_players.guid = '%d' AND f.member_id = '%d'", password, Player(playerid, player_guid), Player(playerid, player_guid));
  1170. #endif
  1171. mysql_query(query);
  1172. mysql_store_result();
  1173. new num = mysql_num_rows(),
  1174. uid = mysql_fetch_int();
  1175.  
  1176. mysql_free_result();
  1177. if(num)
  1178. {
  1179. SetPlayerScore(playerid, score);
  1180. if(Player(playerid, player_cam_timer))
  1181. {
  1182. KillTimer(Player(playerid, player_cam_timer));
  1183. Player(playerid, player_cam_timer) = 0;
  1184. }
  1185. if(Player(playerid, player_login_timer))
  1186. {
  1187. KillTimer(Player(playerid, player_login_timer));
  1188. Player(playerid, player_login_timer) = 0;
  1189. }
  1190. }
  1191. if(num == 1)
  1192. {
  1193. Player(playerid, player_uid) = uid;
  1194. OnPlayerLoginIn(playerid);
  1195. }
  1196. else if(num > 1)
  1197. {
  1198. PreloadAnimLibraries(playerid);
  1199. SelectPlayer(playerid);
  1200. SetPlayerDrunkLevel(playerid, 0);
  1201. }
  1202. else Dialog::Output(playerid, 10, DIALOG_STYLE_PASSWORD, IN_HEAD" "white"» "grey"Zaloguj się", TEXT_LOGIN"\n\nPodałeś nieprawidłowe hasło do konta lub nie masz postaci, spróbuj ponownie.", "Zaloguj", "Wyjdź");
  1203. }
  1204. else
  1205. {
  1206. new query[ 256 ];
  1207. #if Forum == 1 // MyBB
  1208. format(query, sizeof query, "SELECT p.uid, p.block FROM `surv_players` p JOIN mybb_users f ON f.password = md5('%s') WHERE p.guid = '%d' AND p.name = '%s'", password, Player(playerid, player_guid), NickSamp(playerid));
  1209. #elseif Forum == 2 // IPB
  1210. format(query, sizeof query, "SELECT p.uid, p.block FROM `surv_players` p JOIN "IN_PREF"members f ON f.members_pass_hash = md5('%s') WHERE p.guid = '%d' AND p.name = '%s'", password, Player(playerid, player_guid), NickSamp(playerid));
  1211. #endif
  1212. mysql_query(query);
  1213. mysql_store_result();
  1214. if(mysql_num_rows())
  1215. {
  1216. mysql_fetch_row_format(query);
  1217. sscanf(query, "p<|>dd",
  1218. Player(playerid, player_uid),
  1219. Player(playerid, player_block)
  1220. );
  1221. SetPlayerScore(playerid, score);
  1222. if(Player(playerid, player_block) & block_ban)
  1223. {
  1224. Chat::Output(playerid, RED, "Ta postać jest zbanowana!");
  1225. SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  1226. }
  1227. else if(Player(playerid, player_block) & block_ck)
  1228. {
  1229. Chat::Output(playerid, RED, "Ta postać nie żyje!");
  1230. SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  1231. }
  1232. else if(Player(playerid, player_block) & block_block)
  1233. {
  1234. Chat::Output(playerid, RED, "Ta postać została zablokowana!");
  1235. SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  1236. }
  1237. else OnPlayerLoginIn(playerid);
  1238. }
  1239. else Dialog::Output(playerid, 10, DIALOG_STYLE_PASSWORD, IN_HEAD" "white"» "grey"Zaloguj się", TEXT_LOGIN"\n\nPodałeś nieprawidłowe hasło do konta, spróbuj ponownie.", "Zaloguj", "Wyjdź");
  1240. mysql_free_result();
  1241. }
  1242. }
  1243. case 11:
  1244. {
  1245. if(!response) return 1;
  1246. if(Player(playerid, player_option) & option_vehicle) return 1;
  1247. new id = strval(inputtext),
  1248. string[ 256 ],
  1249. vehid = CreateVeh(playerid, StartingVehicle[ id ], vehicle_owner_player, Player(playerid, player_uid), random(120), random(120));
  1250. format(string, sizeof string,
  1251. "UPDATE `surv_vehicles` SET `x` = '%f', `y` = '%f', `z` = '%f', `a` = '%f', `int` = '0', `vw` = '0' WHERE `uid` = '%d'",
  1252. Setting(setting_veh_pos)[ 0 ],
  1253. Setting(setting_veh_pos)[ 1 ],
  1254. Setting(setting_veh_pos)[ 2 ],
  1255. Setting(setting_veh_pos)[ 3 ],
  1256. Vehicle(vehid, vehicle_uid)
  1257. );
  1258. mysql_query(string);
  1259. Vehicle(vehid, vehicle_option) = option_nosell;
  1260. Vehicle(vehid, vehicle_distance) = randomEx(0, 15000);
  1261. UnSpawnVeh(vehid);
  1262.  
  1263. Player(playerid, player_option) += option_vehicle;
  1264.  
  1265. format(string, sizeof string,
  1266. "UPDATE `surv_players` SET `option` = `option` + '"#option_vehicle"' WHERE `uid` = '%d' AND !(`option` & '"#option_vehicle"')",
  1267. Player(playerid, player_uid)
  1268. );
  1269. mysql_query(string);
  1270.  
  1271. ShowInfo(playerid, white"W garażu znalazłeś stary pojazd, który nadaje się jedynie na złomowisko.\nPo kilku godzinach spędzonych przy naprawie pojazdu, wymianie niektórych części udało Ci się odpalić silnik w pojeździe.\n\nZobaczymy.. jak długo pojazd będzie sprawny.");
  1272. }
  1273. case 170:
  1274. {
  1275. if(!response) return 1;
  1276. if(Player(playerid, player_height)) return 1;
  1277.  
  1278. new h = strval(inputtext), string[ 80 ];
  1279. format(string, sizeof string,
  1280. "UPDATE `surv_players` SET `height` = '%d' WHERE `uid` = '%d'",
  1281. h,
  1282. Player(playerid, player_uid)
  1283. );
  1284. mysql_query(string);
  1285.  
  1286. Player(playerid, player_height) = h;
  1287.  
  1288. if(!(Player(playerid, player_option) & option_vehicle) && Player(playerid, player_timehere)[ 0 ] > 7200)
  1289. {
  1290. new buffer[ 512 ];
  1291. for(new x; x != sizeof StartingVehicle; x++)
  1292. format(buffer, sizeof buffer, "%s%d\t%s\n", buffer, x, NazwyPojazdow[StartingVehicle[ x ] - 400]);
  1293. Dialog::Output(playerid, 11, DIALOG_STYLE_LIST, "Wybierz pojazd startowy", buffer, "Wybierz", "Później");
  1294. }
  1295. else ShowInfo(playerid, green"Dane postaci zaaktualizowane.");
  1296. }
  1297. case 39:
  1298. {
  1299. if(DIN(inputtext, "Pozycje początkowe"))
  1300. return SelectSpawn(playerid);
  1301. else if(DIN(inputtext, "Ostatnia pozycja"))
  1302. {
  1303. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  1304. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  1305. Player(playerid, player_dark) = dark_spawn;
  1306. }
  1307. else
  1308. {
  1309. new dooruid = strval(inputtext),
  1310. string[ 128 ];
  1311. if(strfind(inputtext, "[HOTEL]", true) != -1)
  1312. {
  1313. format(string, sizeof string,
  1314. "SELECT `uid`, `in_x`, `in_y`, `in_z`, `in_int` FROM `surv_hotels` WHERE `door_uid` = '%d'",
  1315. dooruid
  1316. );
  1317. mysql_query(string);
  1318. mysql_store_result();
  1319. mysql_fetch_row_format(string);
  1320. mysql_free_result();
  1321. sscanf(string, "p<|>da<f>[3]d",
  1322. Player(playerid, player_hotel),
  1323. Player(playerid, player_position),
  1324. Player(playerid, player_int)
  1325. );
  1326. Player(playerid, player_vw) = Player(playerid, player_uid);
  1327. }
  1328. else if(strfind(inputtext, "[DOM]", true) != -1)
  1329. {
  1330. format(string, sizeof string,
  1331. "SELECT `in_pos_x`, `in_pos_y`, `in_pos_z`, `in_pos_a`, `in_pos_vw`, `in_pos_int` FROM `surv_doors` WHERE `uid` = '%d'",
  1332. dooruid
  1333. );
  1334. mysql_query(string);
  1335. mysql_store_result();
  1336. mysql_fetch_row_format(string);
  1337. mysql_free_result();
  1338. sscanf(string, "p<|>a<f>[4]dd",
  1339. Player(playerid, player_position),
  1340. Player(playerid, player_vw),
  1341. Player(playerid, player_int)
  1342. );
  1343. }
  1344. foreach(Server_Doors, door)
  1345. {
  1346. if(dooruid == Door(door, door_uid))
  1347. {
  1348. Player(playerid, player_door) = door;
  1349. break;
  1350. }
  1351. }
  1352. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  1353. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  1354. Player(playerid, player_dark) = dark_spawn;
  1355. }
  1356. }
  1357. case 60:
  1358. {
  1359. if(!response) return 1;
  1360. if(DIN(inputtext, "Ustawienia konta"))
  1361. {
  1362. new buffer[ 360 ];
  1363. format(buffer, sizeof buffer, "Automatyczne /me:\t\t%s\n", YesOrNo(bool:(Player(playerid, player_option) & option_me)));
  1364. format(buffer, sizeof buffer, "%sZamrożenie przy drzwiach:\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_freeze)));
  1365. format(buffer, sizeof buffer, "%sPanoramika:\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_panor)));
  1366. format(buffer, sizeof buffer, "%sBlokada wiadomości:\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_pm)));
  1367. format(buffer, sizeof buffer, "%sPasek SanNews:\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_news)));
  1368. format(buffer, sizeof buffer, "%sWygląd przedmiotów:\t\t%s\n", buffer, (Player(playerid, player_option) & option_textdraw) ? ("TextDraw") : ("GUI"));
  1369. format(buffer, sizeof buffer, "%sNowe strzelanie:\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_shooting)));
  1370. if(Player(playerid, player_option) & option_shooting)
  1371. format(buffer, sizeof buffer, "%s\t- Strona:\t\t%s\n", buffer, (Player(playerid, player_option) & option_hand) ? ("Lewa") : ("Prawa"));
  1372. format(buffer, sizeof buffer, "%sAnimacja mowy:\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_anim_m)));
  1373. format(buffer, sizeof buffer, "%sAnimacja krzyku:\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_anim_k)));
  1374. if(Player(playerid, player_fight))
  1375. format(buffer, sizeof buffer, "%sSztuka walki:\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_option) & option_fight)));
  1376. Dialog::Output(playerid, 75, DIALOG_STYLE_LIST, IN_HEAD" "white"» "grey"Ustawienia", buffer, "Wybierz", "Wróć");
  1377. }
  1378. else if(DIN(inputtext, "Uprawnienia administratora"))
  1379. {
  1380. new buffer[ 1024 ];
  1381. format(buffer, sizeof buffer, "/kick\t\t\t\t%s\n", YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_kick)));
  1382. format(buffer, sizeof buffer, "%s/ban\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_ban)));
  1383. format(buffer, sizeof buffer, "%s/block\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_block)));
  1384. format(buffer, sizeof buffer, "%s/set /player\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_set)));
  1385. format(buffer, sizeof buffer, "%s/stworz\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_create)));
  1386. format(buffer, sizeof buffer, "%s/edytuj\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_edit)));
  1387. format(buffer, sizeof buffer, "%s/slap\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_slap)));
  1388. format(buffer, sizeof buffer, "%s/bw /freeze\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_bw)));
  1389. format(buffer, sizeof buffer, "%s/tp /to /tm\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_tp)));
  1390. format(buffer, sizeof buffer, "%s/nogun /noveh /noooc\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_blockad)));
  1391. format(buffer, sizeof buffer, "%s/glob\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_glob)));
  1392. format(buffer, sizeof buffer, "%s/globdo\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_globdo)));
  1393. format(buffer, sizeof buffer, "%s/aj\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_aj)));
  1394. format(buffer, sizeof buffer, "%s/spec\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_spec)));
  1395. format(buffer, sizeof buffer, "%s/serwer\t\t\t\t%s\n", buffer, YesOrNo(bool:(Player(playerid, player_adminperm) & admin_perm_server)));
  1396. ShowList(playerid, buffer);
  1397. }
  1398. }
  1399. case 75:
  1400. {
  1401. if(!response) return cmd_stats(playerid, "");
  1402. if(strfind(inputtext, "Automatyczne /me", true) != -1)
  1403. {
  1404. if(Player(playerid, player_option) & option_me)
  1405. Player(playerid, player_option) -= option_me;
  1406. else
  1407. Player(playerid, player_option) += option_me;
  1408. }
  1409. else if(strfind(inputtext, "Zamrożenie przy drzwiach", true) != -1)
  1410. {
  1411. if(Player(playerid, player_option) & option_freeze)
  1412. Player(playerid, player_option) -= option_freeze;
  1413. else
  1414. Player(playerid, player_option) += option_freeze;
  1415. }
  1416. else if(strfind(inputtext, "Panoramika", true) != -1)
  1417. {
  1418. if(Player(playerid, player_option) & option_panor)
  1419. {
  1420. Player(playerid, player_option) -= option_panor;
  1421.  
  1422. TextDrawHideForPlayer(playerid, Setting(setting_td_box)[ 0 ]);
  1423. TextDrawHideForPlayer(playerid, Setting(setting_td_box)[ 1 ]);
  1424. }
  1425. else
  1426. {
  1427. Player(playerid, player_option) += option_panor;
  1428.  
  1429. TextDrawShowForPlayer(playerid, Setting(setting_td_box)[ 0 ]);
  1430. TextDrawShowForPlayer(playerid, Setting(setting_td_box)[ 1 ]);
  1431. }
  1432. }
  1433. else if(strfind(inputtext, "Blokada wiadomości", true) != -1)
  1434. {
  1435. if(Player(playerid, player_option) & option_pm)
  1436. Player(playerid, player_option) -= option_pm;
  1437. else
  1438. Player(playerid, player_option) += option_pm;
  1439. }
  1440. else if(strfind(inputtext, "Pasek SanNews", true) != -1)
  1441. {
  1442. if(Player(playerid, player_option) & option_news)
  1443. {
  1444. Player(playerid, player_option) -= option_news;
  1445.  
  1446. TextDrawHideForPlayer(playerid, Setting(setting_sn)[ 0 ]);
  1447. TextDrawHideForPlayer(playerid, Setting(setting_sn)[ 1 ]);
  1448. }
  1449. else
  1450. {
  1451. Player(playerid, player_option) += option_news;
  1452.  
  1453. TextDrawShowForPlayer(playerid, Setting(setting_sn)[ 0 ]);
  1454. TextDrawShowForPlayer(playerid, Setting(setting_sn)[ 1 ]);
  1455. }
  1456. }
  1457. else if(strfind(inputtext, "Nowe strzelanie", true) != -1)
  1458. {
  1459. if(Player(playerid, player_option) & option_shooting)
  1460. Player(playerid, player_option) -= option_shooting;
  1461. else
  1462. Player(playerid, player_option) += option_shooting;
  1463. }
  1464. else if(strfind(inputtext, "Strona", true) != -1)
  1465. {
  1466. if(Player(playerid, player_option) & option_hand)
  1467. Player(playerid, player_option) -= option_hand;
  1468. else
  1469. Player(playerid, player_option) += option_hand;
  1470. }
  1471. else if(strfind(inputtext, "Wygląd przedmiotów", true) != -1)
  1472. {
  1473. if(Player(playerid, player_option) & option_textdraw)
  1474. {
  1475. if(IsPlayerVisibleItems(playerid)) HideItemsTextDraw(playerid);
  1476. Player(playerid, player_option) -= option_textdraw;
  1477. }
  1478. else
  1479. Player(playerid, player_option) += option_textdraw;
  1480. }
  1481. else if(strfind(inputtext, "Animacja mowy", true) != -1)
  1482. {
  1483. if(Player(playerid, player_option) & option_anim_m)
  1484. Player(playerid, player_option) -= option_anim_m;
  1485. else
  1486. Player(playerid, player_option) += option_anim_m;
  1487. }
  1488. else if(strfind(inputtext, "Animacja krzyku", true) != -1)
  1489. {
  1490. if(Player(playerid, player_option) & option_anim_k)
  1491. Player(playerid, player_option) -= option_anim_k;
  1492. else
  1493. Player(playerid, player_option) += option_anim_k;
  1494. }
  1495. else if(strfind(inputtext, "Sztuka walki", true) != -1)
  1496. {
  1497. if(Player(playerid, player_option) & option_fight)
  1498. {
  1499. Player(playerid, player_option) -= option_fight;
  1500. SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
  1501. }
  1502. else
  1503. {
  1504. Player(playerid, player_option) += option_fight;
  1505. SetPlayerFightingStyle(playerid, FightData[ Player(playerid, player_fight) ][ fight_id ]);
  1506. }
  1507. }
  1508. OnDialogResponseEx(playerid, 60, 1, 0, "Ustawienia konta");
  1509. }
  1510. case 135:
  1511. {
  1512. if(!response) return 1;
  1513. new buffer[ 1024 ];
  1514. switch(listitem)
  1515. {
  1516. case 0:
  1517. {
  1518. strcat(buffer, "Jak zacząć?\n\n");
  1519. strcat(buffer, "Wygląda na to, że potrzebujesz informacji odnośnie rozgrywki.\n\n");
  1520. strcat(buffer, "Niedaleko znajduje się przystanek. Możesz go użyć, by dojechać np. do centrum lub urzędu.\n");
  1521. strcat(buffer, "Długość podróży zależna jest od długości do pokonania. Jeżeli wolisz używać taksówek, kup telefon w sklepie 24/7.");
  1522. }
  1523. case 1:
  1524. {
  1525. strcat(buffer, "OOC i IC\n\n");
  1526. strcat(buffer, "Pamiętaj, że RolePlay polega na odgrywaniu realnego życia postaci, którą stworzyłeś(aś).\n");
  1527. strcat(buffer, "1. Wyobraź sobie, że jesteś aktorem, który gra tę postać w serialu. Na tym polega RolePlay.\n");
  1528. strcat(buffer, "2. Aktor nie wie wszystkiego o postaci i jej wirtualnym świecie. Zna też innych aktorów (graczy), którzy grają inne postacie.\n");
  1529. strcat(buffer, "3. Postać NIE wie wszystkiego tego, co aktor, i nie zna wszystkich pozostałych postaci. Ona poprostu żyje w mieście.\n");
  1530. strcat(buffer, "4. Wy - gracze/aktorzy - i wszystko, co wiecie lub piszecie między sobą, to informacje OOC. Realny świat to jest OOC.\n");
  1531. strcat(buffer, "5. Gdy wypowiadasz się jako postać (do innej wirtualnej postaci), bądź wykonujesz nią jakąś czynność, robisz to IC.\n");
  1532. strcat(buffer, "6. Jeżeli chcesz krzyknąć, musisz użyc podwójnego \"!!\"");
  1533. }
  1534. case 2:
  1535. {
  1536. strcat(buffer, "Podstawowe komendy\n\n");
  1537. strcat(buffer, "/me (opis czynności), /do (opis otoczenia), /c (cicho), /w (wiadomość), /re (odpowiedź)\n");
  1538. strcat(buffer, "/stats, /p(przedmioty), /g (grupy), /v (pojazdy), /o (oferty), /drzwi\n");
  1539. strcat(buffer, "/anim (lista animacji), /pay, /bank\n");
  1540. strcat(buffer, "/raport, /a, /login\n");
  1541. }
  1542. case 3:
  1543. {
  1544. cmd_anims(playerid, "");
  1545. }
  1546. case 4:
  1547. {
  1548. strcat(buffer, "Pojazdy\n\n");
  1549. strcat(buffer, "Na naszym serwerze możesz posiadać dowolną ilość pojazdów. Wpisz /v, aby zespawnować lub odspawnować dowolny z pojazdów.\n");
  1550. strcat(buffer, "Użyj /v namierz, gdy nie widzisz swojego pojazdu. Pozwoli Ci to zlokalizować go, ustawiając\n");
  1551. strcat(buffer, "czerwony marker na mapie.");
  1552. }
  1553. case 5:
  1554. {
  1555. strcat(buffer, "Przedmioty\n\n");
  1556. strcat(buffer, "Przedmioty można zakupić od innych graczy, w ich firmach lub sklepach 24/7.\n");
  1557. strcat(buffer, "Aby wylistować posiadane przedmioty użyj komendy /p.\n");
  1558. strcat(buffer, "Z jej pomocą możesz podnosić przedmioty znajdujące się na ziemi.");
  1559. }
  1560. case 6:
  1561. {
  1562. strcat(buffer, "Oferty\n\n");
  1563. strcat(buffer, "Oferty umożliwiają składanie graczom ofert usług.\n");
  1564. strcat(buffer, "Dzięki nim masz pewność, że gracz zapłaci za daną usługę.\n");
  1565. strcat(buffer, "Wpisz /o, aby sprawdzić jakie możesz składać oferty lub /o [usługa] [gracz] [dodatkowe parametry], by złożyć ofertę.");
  1566. }
  1567. case 7:
  1568. {
  1569. strcat(buffer, "Praca dorywcza\n\n");
  1570. strcat(buffer, "/o naprawa [Gracz] /o tankowanie [Gracz] /o lakierowanie [Gracz] /o paintjob [Gracz] /paczka.\n");
  1571. strcat(buffer, "Możesz także używać przedmiotów mechaników.");
  1572. }
  1573. case 8:
  1574. {
  1575. strcat(buffer, "Listy Twoich grup (i sloty): /g\n\n");
  1576. strcat(buffer, "Wypowiedzi poprzedza się jednym znakiem (a nie komendą).\n");
  1577. strcat(buffer, "Znak @ odpowiada za czat OOC, a znak ! - za czat IC. (@Witam, !Witam).\n");
  1578. strcat(buffer, "@1 Cześć! - Napisze wiadomość OOC do całej grupy w slocie 1.\n");
  1579. strcat(buffer, "!2 Cześć! - Napisze wiadomość IC do całej grupy w slocie 2.\n");
  1580. }
  1581. }
  1582. if(listitem != 3) ShowInfo(playerid, buffer);
  1583. }
  1584. }
  1585. return 0;
  1586. }
  1587.  
  1588. FuncPub::GlobalTimer()
  1589. {
  1590. Setting(setting_uptime)++;
  1591.  
  1592. static godzina,
  1593. minuta,
  1594. second;
  1595.  
  1596. gettime(godzina, minuta, second);
  1597. if(!(minuta % 10) && !second) // Co 10min. :)
  1598. {
  1599. mysql_query("UPDATE `surv_plants` SET `progress` = `progress` + 0.1 WHERE `progress` < 100");
  1600. mysql_reload();
  1601. }
  1602. if(!(second % 3))
  1603. {
  1604. foreach(Server_Vehicles, carid)
  1605. {
  1606. if(!Vehicle(carid, vehicle_engine)) continue;
  1607. if(GetVehicleMaxFuel(Vehicle(carid, vehicle_model)) == 0) continue;
  1608. if(Vehicle(carid, vehicle_fuel) < 0.1)
  1609. {
  1610. Vehicle(carid, vehicle_fuel) = 0;
  1611. GetVehiclePos(Vehicle(carid, vehicle_vehID), Vehicle(carid, vehicle_position)[ 0 ], Vehicle(carid, vehicle_position)[ 1 ], Vehicle(carid, vehicle_position)[ 2 ]);
  1612. GetVehicleZAngle(Vehicle(carid, vehicle_vehID), Vehicle(carid, vehicle_position)[ 3 ]);
  1613. GetVehicleHealth(Vehicle(carid, vehicle_vehID), Vehicle(carid, vehicle_hp));
  1614. GetVehicleDamageStatus(Vehicle(carid, vehicle_vehID), Vehicle(carid, vehicle_damage)[ 0 ], Vehicle(carid, vehicle_damage)[ 1 ], Vehicle(carid, vehicle_damage)[ 2 ], Vehicle(carid, vehicle_damage)[ 3 ]);
  1615.  
  1616. new s[ 7 ];
  1617. GetVehicleParamsEx(Vehicle(carid, vehicle_vehID), s[ 0 ], s[ 1 ], s[ 2 ], s[ 3 ], s[ 4 ], s[ 5 ], s[ 6 ]);
  1618. SetVehicleParamsEx(Vehicle(carid, vehicle_vehID), _:Vehicle(carid, vehicle_engine) = 0, s[ 1 ], s[ 2 ], _:Vehicle(carid, vehicle_lock), s[ 4 ], s[ 5 ], s[ 6 ]);
  1619. }
  1620. else Vehicle(carid, vehicle_fuel) -= 0.01;
  1621. }
  1622. }
  1623. if(!(godzina % 4) && !minuta && !second)
  1624. {
  1625. LoadWeather();
  1626. }
  1627. if(!minuta && !second)
  1628. {
  1629. SetWorldTime(godzina);
  1630.  
  1631. /* static string[ 64 ];
  1632. format(string, sizeof string, "** Dzwony w ratuszu biją %d %s. **",
  1633. godzina,
  1634. dli(godzina, "raz", "razy", "razy")
  1635. );
  1636. SendClientMessageToAll(COLOR_PURPLE, string);*/
  1637. }
  1638. if(godzina == 4 && !minuta && !second)
  1639. {
  1640. SendClientMessageToAll(SZARY, "Nocny restart skryptu!");
  1641. foreach(Player, i) SetTimerEx (!#kickPlayer, 249, false, !"i", i);
  1642.  
  1643. SetTimer("PayDay", 2000, false);
  1644. }
  1645. foreach(Player, i)
  1646. {
  1647. if(IsPlayerNPC(i))
  1648. continue;
  1649. if(!Player(i, player_spawned) || !Player(i, player_logged))
  1650. continue;
  1651.  
  1652. if(Player(i, player_aj) > 1) Player(i, player_aj)--;
  1653. if(Player(i, player_bw)) Player(i, player_bw)--;
  1654. if(Player(i, player_fish)) Player(i, player_fish)--;
  1655. if(Tren(i, train_time)) Tren(i, train_time)--;
  1656.  
  1657. if(Player(i, player_screen))
  1658. {
  1659. Player(i, player_screen)--;
  1660. if(!Player(i, player_screen))
  1661. {
  1662. if(Player(i, player_duty) && Group(i, Player(i, player_duty), group_option) & group_option_color && Group(i, Player(i, player_duty), group_can) & member_can_duty)
  1663. Player(i, player_color) = Group(i, Player(i, player_duty), group_color);
  1664. else if(Player(i, player_premium))
  1665. Player(i, player_color) = player_nick_prem;
  1666. else
  1667. Player(i, player_color) = player_nick_def;
  1668. UpdatePlayerNick(i);
  1669. TextDrawHideForPlayer(i, Setting(setting_red));
  1670. }
  1671. }
  1672.  
  1673. Player(i, player_afktime)[ 0 ]++;
  1674. if(Player(i, player_afktime)[ 0 ] > 5)
  1675. {
  1676. Player(i, player_afktime)[ 1 ]++;
  1677. Player(i, player_afktime)[ 2 ]++;
  1678. UpdatePlayerNick(i);
  1679. }
  1680. if(Player(i, player_afktime)[ 0 ] <= 10)
  1681. {
  1682. /*if(!(second % 3))
  1683. {
  1684. if(GetPlayerVehicleID(i) > 0) Player(i, player_veh) = GetPlayerVehicleID(i);
  1685. else Player(i, player_veh) = INVALID_VEHICLE_ID;
  1686. }*/
  1687. Player(i, player_timehere)[ 0 ]++;
  1688. if(!(Player(i, player_timehere)[ 0 ] % 3600))
  1689. {
  1690. new string[ 126 ];
  1691. new d = Player(i, player_premium) ? (15) : (10);
  1692. format(string, sizeof string, "UPDATE `"IN_PREF"members` SET `score` = `score` + '%d' WHERE `member_id` = '%d'", d, Player(i, player_guid));
  1693. SetPlayerScore(i, GetPlayerScore(i) + d);
  1694. mysql_query(string);
  1695. }
  1696. Player(i, player_timehere)[ 1 ]++;
  1697. static duty;
  1698. duty = Player(i, player_duty);
  1699. if(duty)
  1700. Group(i, duty, group_duty)++;
  1701. }
  1702. if(Player(i, player_timehere)[ 0 ] >= 36000)
  1703. GivePlayerAchiv(i, achiv_time);
  1704.  
  1705. //if(Phone(i, phone_to) != INVALID_PLAYER_ID && Phone(Phone(i, phone_to), phone_to) == i)
  1706. //Phone(i, phone_time)++;
  1707.  
  1708. #if !STREAMER
  1709. if(!Player(i, player_bw) && !Player(i, player_aj) && Player(i, player_selected_object) == INVALID_OBJECT_ID && !Player(i, player_vw) && Player(i, player_obj_dist))
  1710. {
  1711. GetPlayerPos(i, Player(i, player_position)[ 0 ], Player(i, player_position)[ 1 ], Player(i, player_position)[ 2 ]);
  1712. if(Player(i, player_obj_dist) < Distance3D(Player(i, player_obj_pos)[ 0 ], Player(i, player_obj_pos)[ 1 ], Player(i, player_obj_pos)[ 2 ], Player(i, player_position)[ 0 ], Player(i, player_position)[ 1 ], Player(i, player_position)[ 2 ]))
  1713. {
  1714. #if Debug
  1715. new count = GetTickCount();
  1716. #endif
  1717. LoadPlayerObjects(i, Player(i, player_vw));
  1718. #if Debug
  1719. new Float:timedd = floatdiv(GetTickCount() - count, 1000), str[ 32 ];
  1720. format(str, sizeof str, "Odświeżenie obiektów! %.2f s", timedd);
  1721. Chat::Output(i, CLR_GREEN, str);
  1722. #endif
  1723. }
  1724. }
  1725. #endif
  1726.  
  1727. BW_Timer(i);
  1728. AJ_Timer(i);
  1729. Blood_Timer(i);
  1730. Fish_Timer(i);
  1731. Train_Timer(i);
  1732. CuffedTimer(i);
  1733. Energy(i);
  1734. Vehicle_Repair(i);
  1735. AntyDos(i);
  1736. AntyCheat(i);
  1737. }
  1738. return 1;
  1739. }
  1740.  
  1741. FuncPub::PayDay()
  1742. {
  1743. #if OFFICIAL
  1744. mysql_query("UPDATE surv_players p SET p.cash = p.cash + IFNULL((SELECT SUM(r.pay) FROM surv_members m, surv_ranks r WHERE m.player = p.uid AND r.uid = m.rankid AND m.duty > 600), 0.0)");
  1745. mysql_query("UPDATE surv_members SET `duty` = '0' WHERE duty > 600");
  1746. #endif// WHERE p.lastlogged >= UNIX_TIMESTAMP()-86400
  1747. SetTimer("RestartMode", 30000, false);
  1748. return 1;
  1749. }
  1750.  
  1751. FuncPub::RestartMode()
  1752. {
  1753. SendRconCommand("gmx");
  1754. return 1;
  1755. }
  1756.  
  1757. FuncPub::AntyDos(playerid)
  1758. {
  1759. new stats[ 400 ],
  1760. KBits[ 5 ];
  1761. GetPlayerNetworkStats(playerid, stats, sizeof stats);
  1762. new temp = strfind(stats, "Inst. KBits per second:");
  1763. strmid(KBits, stats, temp+23, sizeof stats);
  1764. new k = strval(KBits);
  1765. if(k > Setting(setting_packet))
  1766. {
  1767. print("Dos Attack");
  1768. Kick(playerid);
  1769. }
  1770. return 1;
  1771. }
  1772.  
  1773. FuncPub::OptTimer()
  1774. {
  1775. foreach(Player, i)
  1776. {
  1777. if(IsPlayerNPC(i))
  1778. continue;
  1779. if(!Player(i, player_spawned) || !Player(i, player_logged))
  1780. continue;
  1781. if(GetPlayerVehicleID(i) > 0)
  1782. {
  1783. Vehicle_Timer(i);
  1784. CheckRadar(i);
  1785. }
  1786. CheckStreet(i);
  1787. }
  1788. AntyCheatVehicle();
  1789. return 1;
  1790. }
  1791.  
  1792. FuncPub::Blood_Timer(playerid)
  1793. {
  1794. /* if(!Player(playerid, player_blood))
  1795. {
  1796. // Śmierć
  1797. //BW(playerid, 30);
  1798. //Player(playerid, player_blooding) = 0;
  1799. //Player(playerid, player_blood) = 0;
  1800. }
  1801. else if(Player(playerid, player_blood) < 2000)
  1802. {
  1803. ///SetPlayerWeather(playerid, -68);
  1804. //SetPlayerDrunkLevel(playerid, 15000);
  1805. // Kolory przed oczyma
  1806. }
  1807. else if(Player(playerid, player_blood) < 3000)
  1808. {
  1809. // 1% szansy na BW
  1810. new rand = random(100)+1;
  1811. if(rand == 6)
  1812. {
  1813. //BW(playerid, 30);
  1814. //Player(playerid, player_blooding) = 0;
  1815. //Player(playerid, player_blood) = 0;
  1816. // BW
  1817. }
  1818. }*/
  1819. return 1;
  1820. }
  1821.  
  1822. FuncPub::Train_Timer(playerid)
  1823. {
  1824. if(!Tren(playerid, train_time) && Tren(playerid, train_item))
  1825. {
  1826. new buffer[ 126 ];
  1827. ShowInfo(playerid, white"Trening zakończony!");
  1828.  
  1829. Player(playerid, player_stamina) += 5;
  1830.  
  1831. format(buffer, sizeof buffer,
  1832. "UPDATE `surv_players` SET `stamina` = '%d' WHERE `uid` = '%d'",
  1833. Player(playerid, player_stamina),
  1834. Player(playerid, player_uid)
  1835. );
  1836. mysql_query(buffer);
  1837.  
  1838. format(buffer, sizeof buffer,
  1839. "DELETE FROM `surv_items` WHERE `uid` = '%d'",
  1840. Tren(playerid, train_item)
  1841. );
  1842. mysql_query(buffer);
  1843.  
  1844. ClearTrening(playerid);
  1845. }
  1846. else if(Tren(playerid, train_time))
  1847. {
  1848. new str[ 10 ];
  1849. format(str, sizeof str, "~w~%d:%d", Tren(playerid, train_time), Tren(playerid, train_count));
  1850. GameTextForPlayer(playerid, str, 500, 1);
  1851. }
  1852. return 1;
  1853. }
  1854.  
  1855. FuncPub::Fish_Timer(playerid)
  1856. {
  1857. if(!Player(playerid, player_fish) && Player(playerid, player_fish_timer))
  1858. {
  1859. ShowInfo(playerid, white"Połów zakończony!");
  1860. KillTimer(Player(playerid, player_fish_timer));
  1861. Player(playerid, player_fish_timer) = 0;
  1862. UnFreezePlayer(playerid);
  1863. RemovePlayerAttachedObject(playerid, 3);
  1864. }
  1865. else if(Player(playerid, player_fish))
  1866. {
  1867. new str[ 10 ];
  1868. format(str, sizeof str, "~w~%d", Player(playerid, player_fish));
  1869. GameTextForPlayer(playerid, str, 500, 1);
  1870. }
  1871. return 1;
  1872. }
  1873.  
  1874. FuncPub::Fish_Anim(playerid)
  1875. {
  1876. ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
  1877. return 1;
  1878. }
  1879.  
  1880. FuncPub::BW_Timer(playerid)
  1881. {
  1882. if(Player(playerid, player_bw) == 1)
  1883. {
  1884. ShowInfo(playerid, white"Ocknąłeś się po utracie przytomności i nic nie pamiętasz.\nNiezwłocznie udaj się do szpitala "white"aby obejrzał Cię lekarz.");
  1885. UnBW(playerid); // TODO
  1886. return 1;
  1887. }
  1888. else if(Player(playerid, player_bw))
  1889. {
  1890. new string[ 45 ];
  1891. ReturnTime(Player(playerid, player_bw), string);
  1892. format(string, sizeof string, "~r~BW: ~w~%s", string);
  1893. GameTextForPlayer(playerid, string, 1000, 1);
  1894. SetPlayerHealth(playerid, Player(playerid, player_hp) = 9999.0);
  1895. if(!(Player(playerid, player_bw) % 5))
  1896. ApplyAnimation(playerid, "PED", "FLOOR_hit", 4.1, 0, 1, 1, 1, 1);
  1897. // FreezePlayer(playerid);
  1898. }
  1899. return 1;
  1900. }
  1901.  
  1902. FuncPub::UnBW(playerid)
  1903. {
  1904. UnFreezePlayer(playerid);
  1905. ClearAnimations(playerid);
  1906. ClearAnimations(playerid);
  1907.  
  1908. SetPlayerHealth(playerid, Player(playerid, player_hp) = 20.0);
  1909. SetPlayerDrunkLevel(playerid, Player(playerid, player_drunklvl) = 4999);
  1910.  
  1911. Player(playerid, player_bw) = 0;
  1912. return 1;
  1913. }
  1914.  
  1915. FuncPub::BW(playerid, time)
  1916. {
  1917. new string[ 126 ],
  1918. timeStr[ 45 ];
  1919. Player(playerid, player_bw) = time * 60;
  1920.  
  1921. ReturnTime(Player(playerid, player_bw), timeStr);
  1922.  
  1923. format(string, sizeof string,
  1924. "Twoja postać straciła przytomność. Odczekaj %s, aby wznowić swoją grę albo czekaj na nadejście pomocy.",
  1925. timeStr
  1926. );
  1927. ShowInfo(playerid, string);
  1928. GivePlayerAchiv(playerid, achiv_bw);
  1929. // OnPlayerLoginOut(playerid);
  1930. return 1;
  1931. }
  1932.  
  1933. FuncPub::AJ_Timer(playerid)
  1934. {
  1935. if(Player(playerid, player_aj) == 2)
  1936. {
  1937. SetPlayerHealth(playerid, Player(playerid, player_hp) = 100.0);
  1938. Player(playerid, player_aj) = 1;
  1939. PlayerSpawn(playerid);
  1940.  
  1941. Chat::Output(playerid, 0, white"Czas Twojej kary dobiegł końca, "red"oby czegoś Cię to nauczyło.");
  1942. return 1;
  1943. }
  1944. else if(Player(playerid, player_aj))
  1945. {
  1946. new string[ 45 ];
  1947.  
  1948. ReturnTime(Player(playerid, player_aj), string);
  1949. format(string, sizeof string, "~r~AJ: ~w~%s", string);
  1950. GameTextForPlayer(playerid, string, 1000, 1);
  1951. SetPlayerHealth(playerid, Player(playerid, player_hp) = 100.0);
  1952. }
  1953. return 1;
  1954. }
  1955.  
  1956. FuncPub::LoadSounds(playerid)
  1957. {
  1958. if(!Audio_IsClientConnected(playerid) || IsPlayerNPC(playerid))
  1959. return 1;
  1960. if(!Player(playerid, player_spawned) || !Player(playerid, player_logged))
  1961. return 1;
  1962.  
  1963. #if Debug
  1964. printf("LoadSounds(%d)", playerid);
  1965. #endif
  1966.  
  1967. Audio_Stop(playerid, Player(playerid, player_heart_sound));
  1968. Player(playerid, player_heart_sound) = 0;
  1969.  
  1970. Audio_Stop(playerid, Player(playerid, player_heart_sound_fast));
  1971. Player(playerid, player_heart_sound_fast) = 0;
  1972.  
  1973. foreach(Server_Doors, doorid)
  1974. {
  1975. if(Door(doorid, door_option) & door_option_audio_out && Door(doorid, door_sound_out))
  1976. {
  1977. Audio_Stop(playerid, Player(playerid, player_door_out_sound)[ doorid ]);
  1978. Player(playerid, player_door_out_sound)[ doorid ] = Audio_PlayStreamed(playerid, Door(doorid, door_sound_url));
  1979. Audio_Set3DPosition(playerid, Player(playerid, player_door_out_sound)[ doorid ], Door(doorid, door_out_pos)[ 0 ], Door(doorid, door_out_pos)[ 1 ], Door(doorid, door_out_pos)[ 2 ], 30.0);
  1980. }
  1981. }
  1982. Energy(playerid);
  1983.  
  1984. new string[ 220 ],
  1985. url[ 64 ],
  1986. itemuid;
  1987.  
  1988. format(string, sizeof string,
  1989. "SELECT surv_items.uid, surv_cd.url FROM `surv_cd` JOIN `surv_items` ON surv_items.v1 = surv_cd.uid WHERE surv_items.ownerType="#item_place_player" AND surv_items.type = "#item_cdplayer" AND surv_items.owner='%d' AND surv_items.used = '1'",
  1990. Player(playerid, player_uid)
  1991. );
  1992. mysql_query(string);
  1993. mysql_store_result();
  1994. mysql_fetch_row(string);
  1995. mysql_free_result();
  1996.  
  1997. sscanf(string, "p<|>ds[64]",
  1998. itemuid,
  1999. url
  2000. );
  2001.  
  2002. if(isnull(url) || !itemuid)
  2003. return 1;
  2004.  
  2005. Audio_Stop(playerid, Player(playerid, player_cdplayer_sound));
  2006. Player(playerid, player_cdplayer_sound) = Audio_PlayStreamed(playerid, url);
  2007. Player(playerid, player_cdplayer) = itemuid;
  2008.  
  2009. new doorid = Player(playerid, player_door);
  2010. if(doorid && Door(doorid, door_option) & door_option_sound && !Player(playerid, player_door_sound))
  2011. {
  2012. if(Audio_IsClientConnected(playerid))
  2013. Player(playerid, player_door_sound) = Audio_PlayStreamed(playerid, Door(doorid, door_sound_url));
  2014. else
  2015. PlayAudioStreamForPlayer(playerid, Door(doorid, door_sound_url));
  2016. }
  2017. return 1;
  2018. }
  2019.  
  2020. FuncPub::Energy(playerid)
  2021. {
  2022. new victimid = GetPlayerTargetPlayer(playerid);
  2023. if(victimid != INVALID_PLAYER_ID && GetPlayerWeapon(playerid) >= 22)
  2024. Player(victimid, player_pulse) += 3;
  2025.  
  2026. new minus = -2;
  2027. if(!IsPlayerInAnyVehicle(playerid) && GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID)
  2028. {
  2029. new Float:speed = GetPlayerSpeed(playerid);
  2030. if(speed >= 17) minus = 3;
  2031. else if(speed >= 13) minus = 2;
  2032. else if(speed >= 8) minus = 1;
  2033. else if(speed >= 1) minus = -1; // TODO
  2034.  
  2035. if(Player(playerid, player_pulse) >= 200)
  2036. {
  2037. //ShowInfo(playerid, red"Nie masz już siły by biec dalej.\n"white"Odczekaj chwilę.");
  2038. Player(playerid, player_pulse) = 200;
  2039. }
  2040. }
  2041. if((80 <= Player(playerid, player_pulse)))
  2042. Player(playerid, player_pulse) += minus;
  2043. else if(Player(playerid, player_pulse) > 200)
  2044. Player(playerid, player_pulse) = 200;
  2045. else if(Player(playerid, player_pulse) < 80)
  2046. Player(playerid, player_pulse) = 80;
  2047.  
  2048. /* if((75 <= Player(playerid, player_hungry) <= 100)) hungry = "~g~Najedzony";
  2049. else if((50 <= Player(playerid, player_hungry) <= 75)) hungry = "~y~Nasycony";
  2050. else if((25 <= Player(playerid, player_hungry) <= 50)) hungry = "~r~~h~Glodny";
  2051. else hungry = "~r~Bardzo glodny";
  2052.  
  2053. if(Player(playerid, player_pulse) >= 140) pulscolor = "~r~";
  2054. else if((100 <= Player(playerid, player_pulse) < 140)) pulscolor = "~y~";
  2055. else pulscolor = "~w~";
  2056.  
  2057. if(Player(playerid, player_blood) < 12000)
  2058. Player(playerid, player_blood) += 1;
  2059. else if(Player(playerid, player_blood) > 12000)
  2060. Player(playerid, player_blood) = 12000;
  2061.  
  2062. if(Player(playerid, player_blooding))
  2063. format(string, sizeof string, "~r~(-%d/s)", Player(playerid, player_blooding));
  2064.  
  2065. format(string, sizeof string,
  2066. "Puls: %s%d/min~n~~w~Glod: %d %s~w~~n~Krew: %d%s",
  2067. pulscolor,
  2068. Player(playerid, player_pulse),
  2069. Player(playerid, player_hungry),
  2070. hungry,
  2071. Player(playerid, player_blood),
  2072. string
  2073. );
  2074. PlayerTextDrawSetString(playerid, Player(playerid, player_infos), string);
  2075. */
  2076. if(!Audio_IsClientConnected(playerid)) return 1;
  2077.  
  2078. if(Player(playerid, player_pulse) >= 140 && !Player(playerid, player_heart_sound_fast))
  2079. {
  2080. if(Player(playerid, player_heart_sound))
  2081. {
  2082. Audio_Stop(playerid, Player(playerid, player_heart_sound));
  2083. Player(playerid, player_heart_sound) = 0;
  2084. }
  2085. Player(playerid, player_heart_sound_fast) = Audio_Play(playerid, heart_sound_fast, .loop = true);
  2086. Audio_SetVolume(playerid, Player(playerid, player_heart_sound_fast), 80);
  2087. }
  2088. else if((100 <= Player(playerid, player_pulse) < 140) && !Player(playerid, player_heart_sound))
  2089. {
  2090. if(Player(playerid, player_heart_sound_fast))
  2091. {
  2092. Audio_Stop(playerid, Player(playerid, player_heart_sound_fast));
  2093. Player(playerid, player_heart_sound_fast) = 0;
  2094. }
  2095. Player(playerid, player_heart_sound) = Audio_Play(playerid, heart_sound, .loop = true);
  2096. Audio_SetVolume(playerid, Player(playerid, player_heart_sound), 40);
  2097. }
  2098. else if(Player(playerid, player_pulse) < 100 && Player(playerid, player_heart_sound))
  2099. {
  2100. Audio_Stop(playerid, Player(playerid, player_heart_sound));
  2101. Player(playerid, player_heart_sound) = 0;
  2102.  
  2103. Audio_Stop(playerid, Player(playerid, player_heart_sound_fast));
  2104. Player(playerid, player_heart_sound_fast) = 0;
  2105. }
  2106. return 1;
  2107. }
  2108.  
  2109. FuncPub::UpdatePlayerNick(playerid)
  2110. {
  2111. new opis[ 2 ][ 126 ],
  2112. playernick[ 126 + MAX_PLAYER_NAME ],
  2113. opis_name[ 13 ][ 16 ],
  2114. under_name[ 4 ][ 16 ];
  2115.  
  2116. if(Player(playerid, player_bw))
  2117. opis_name[ 0 ] = (Player(playerid, player_sex) == sex_woman) ? ("nieprzytomna") : ("nieprzytomny");
  2118. if(Player(playerid, player_pasy))
  2119. opis_name[ 1 ] = "zapięte pasy";
  2120. if(Player(playerid, player_premium))
  2121. opis_name[ 2 ] = "konto premium";
  2122. //if(3000 < Player(playerid, player_stamina) < 3025)
  2123. //format(opis_name[ 3 ], sizeof opis_name[ ], "%dj siły", Player(playerid, player_stamina));
  2124. //else if(3025 <= Player(playerid, player_stamina))
  2125. //opis_name[ 3 ] = (Player(playerid, player_sex) == sex_woman) ? ("wysportowana") : ("muskularny");
  2126. if(Player(playerid, player_mask))
  2127. opis_name[ 4 ] = "ukryta twarz";
  2128. if(Player(playerid, player_timehere)[ 0 ] < 7200)
  2129. opis_name[ 5 ] = "nowy gracz";
  2130. if(Player(playerid, player_skuty) != INVALID_PLAYER_ID)
  2131. opis_name[ 6 ] = (Player(playerid, player_sex) == sex_woman) ? ("skuta") : ("skuty");
  2132. if(Player(playerid, player_hp) < 20.0)
  2133. opis_name[ 7 ] = (Player(playerid, player_sex) == sex_woman) ? ("ranna") : ("ranny");
  2134. if(Group(playerid, Player(playerid, player_duty), group_option) & group_option_color && Player(playerid, player_duty) && Group(playerid, Player(playerid, player_duty), group_can) & member_can_duty)
  2135. format(opis_name[ 8 ], sizeof opis_name[ ], Group(playerid, Player(playerid, player_duty), group_tag));
  2136. if(Player(playerid, player_veh) != INVALID_VEHICLE_ID && Vehicle(Player(playerid, player_veh), vehicle_option) & option_window)
  2137. opis_name[ 9 ] = "szyba zamknięta";
  2138. if(Player(playerid, player_drunklvl) > 5000)
  2139. opis_name[ 10 ] = (Player(playerid, player_sex) == sex_woman) ? ("upita") : ("upity");
  2140. /* if(Player(playerid, player_blooding))
  2141. opis_name[ 9 ] = "krwawi";
  2142. if(Player(playerid, player_hungry) < 25)
  2143. opis_name[ 10 ] = (Player(playerid, player_sex) == sex_woman) ? ("głodna") : ("głodny");*/
  2144. if(Player(playerid, player_knebel))
  2145. opis_name[ 11 ] = (Player(playerid, player_sex) == sex_woman) ? ("zakneblowana") : ("zakneblowany");
  2146. if(Player(playerid, player_worek))
  2147. opis_name[ 12 ] = "worek na głowie";
  2148.  
  2149. if(3000 < Player(playerid, player_stamina))
  2150. format(under_name[ 0 ], sizeof under_name[ ], "%dj", Player(playerid, player_stamina));
  2151. if(Player(playerid, player_height))
  2152. format(under_name[ 1 ], sizeof under_name[ ], "%dcm", Player(playerid, player_height));
  2153. if(Player(playerid, player_drunklvl) > 5000)
  2154. under_name[ 2 ] = "%";
  2155. if(IsPlayerNPC(playerid))
  2156. under_name[ 3 ] = "BOT";
  2157.  
  2158. for(new i; i < sizeof under_name; i++)
  2159. {
  2160. if(isnull(under_name[ i ])) continue;
  2161. format(opis[ 1 ], sizeof opis[ ], "%s%s, ", opis[ 1 ], under_name[ i ]);
  2162. }
  2163. if(!isnull(opis[ 1 ]))
  2164. {
  2165. opis[ 1 ][ strlen(opis[ 1 ]) - 2 ] = ')';
  2166. format(opis[ 1 ], sizeof opis[ ], "\n(%s", opis[ 1 ]);
  2167. }
  2168.  
  2169. // -----
  2170. if(Player(playerid, player_afktime)[ 0 ] > 5)
  2171. {
  2172. ReturnTimeMega(Player(playerid, player_afktime)[ 0 ], opis[ 0 ], sizeof opis[ ]);
  2173. format(opis[ 0 ], sizeof opis[ ], "AFK: %s, ", opis[ 0 ]);
  2174. }
  2175. else
  2176. {
  2177. for(new i; i < sizeof opis_name; i++)
  2178. {
  2179. if(isnull(opis_name[ i ])) continue;
  2180. format(opis[ 0 ], sizeof opis[ ], "%s%s, ", opis[ 0 ], opis_name[ i ]);
  2181. //if(!(i % 4) && i != sizeof opis_name-1) strcat(opis[ 0 ], "\n");
  2182. }
  2183. }
  2184. if(!isnull(opis[ 0 ]))
  2185. {
  2186. opis[ 0 ][ strlen(opis[ 0 ]) - 2 ] = ')';
  2187. format(opis[ 0 ], sizeof opis[ ], "\n(%s", opis[ 0 ]);
  2188. }
  2189. if(GetPlayerVehicleID(playerid) > 0 && Player(playerid, player_veh) != INVALID_VEHICLE_ID && Vehicle(Player(playerid, player_veh), vehicle_option) & option_dark)
  2190. {
  2191. if(isnull(AdminLvl[ Player(playerid, player_adminlvl) ][ admin_tag ]) && Player(playerid, player_aduty))
  2192. format(playernick, sizeof playernick, "{%06x}%s\n{%06x}%s (%d)%s%s", Player(playerid, player_screen) ? Player(playerid, player_color) >>> 8 : AdminLvl[ Player(playerid, player_adminlvl) ][ admin_color ] >>> 8, AdminLvl[ Player(playerid, player_adminlvl) ][ admin_name ], Player(playerid, player_color) >>> 8, NickName(playerid), playerid, opis[ 1 ], opis[ 0 ]);
  2193. else if(Player(playerid, player_adminlvl) && Player(playerid, player_aduty))
  2194. format(playernick, sizeof playernick, "{%06x}%s (%s)\n{%06x}%s (%d)%s%s", Player(playerid, player_screen) ? Player(playerid, player_color) >>> 8 : AdminLvl[ Player(playerid, player_adminlvl) ][ admin_color ] >>> 8, AdminLvl[ Player(playerid, player_adminlvl) ][ admin_name ], AdminLvl[ Player(playerid, player_adminlvl) ][ admin_tag ], Player(playerid, player_color) >>> 8, NickName(playerid), playerid, opis[ 1 ], opis[ 0 ]);
  2195. else
  2196. format(playernick, sizeof playernick, "%s%s", opis[ 1 ], opis[ 0 ]);
  2197. }
  2198. else
  2199. {
  2200. if(isnull(AdminLvl[ Player(playerid, player_adminlvl) ][ admin_tag ]) && Player(playerid, player_aduty))
  2201. format(playernick, sizeof playernick, "{%06x}%s\n{%06x}%s (%d)%s%s", Player(playerid, player_screen) ? Player(playerid, player_color) >>> 8 : AdminLvl[ Player(playerid, player_adminlvl) ][ admin_color ] >>> 8, AdminLvl[ Player(playerid, player_adminlvl) ][ admin_name ], Player(playerid, player_color) >>> 8, NickName(playerid), playerid, opis[ 1 ], opis[ 0 ]);
  2202. else if(Player(playerid, player_adminlvl) && Player(playerid, player_aduty))
  2203. format(playernick, sizeof playernick, "{%06x}%s (%s)\n{%06x}%s (%d)%s%s", Player(playerid, player_screen) ? Player(playerid, player_color) >>> 8 : AdminLvl[ Player(playerid, player_adminlvl) ][ admin_color ] >>> 8, AdminLvl[ Player(playerid, player_adminlvl) ][ admin_name ], AdminLvl[ Player(playerid, player_adminlvl) ][ admin_tag ], Player(playerid, player_color) >>> 8, NickName(playerid), playerid, opis[ 1 ], opis[ 0 ]);
  2204. else if(Player(playerid, player_duty) && Player(playerid, player_mask) && Group(playerid, Player(playerid, player_duty), group_option) & group_option_color && Group(playerid, Player(playerid, player_duty), group_can) & member_can_duty)
  2205. format(playernick, sizeof playernick, "{%06x}%s (%dh)%s%s", Player(playerid, player_screen) ? Player(playerid, player_color) >>> 8 : Group(playerid, Player(playerid, player_duty), group_color) >>> 8, NickName(playerid), floatval(Player(playerid, player_timehere)[ 0 ]/3600), opis[ 1 ], opis[ 0 ]);
  2206. else if(Player(playerid, player_mask))
  2207. format(playernick, sizeof playernick, "%s (%dh)%s%s", NickName(playerid), floatval(Player(playerid, player_timehere)[ 0 ]/3600), opis[ 1 ], opis[ 0 ]);
  2208. else if(Player(playerid, player_duty) && Group(playerid, Player(playerid, player_duty), group_option) & group_option_color && Group(playerid, Player(playerid, player_duty), group_can) & member_can_duty)
  2209. format(playernick, sizeof playernick, "{%06x}%s (%d, %dh)%s%s", Player(playerid, player_screen) ? Player(playerid, player_color) >>> 8 : Group(playerid, Player(playerid, player_duty), group_color) >>> 8, NickName(playerid), playerid, floatval(Player(playerid, player_timehere)[ 0 ]/3600), opis[ 1 ], opis[ 0 ]);
  2210. else
  2211. format(playernick, sizeof playernick, "%s (%d, %dh)%s%s", NickName(playerid), playerid, floatval(Player(playerid, player_timehere)[ 0 ]/3600), opis[ 1 ], opis[ 0 ]);
  2212. }
  2213. if(Player(playerid, player_tag) != Text3D:INVALID_3DTEXT_ID)
  2214. Update3DTextLabelText(Player(playerid, player_tag), Player(playerid, player_color), playernick);
  2215. // print(playernick);
  2216. return 1;
  2217. }
  2218.  
  2219. FuncPub::PlayerSpawn(playerid)
  2220. {
  2221. new buffer[ 512 ],
  2222. string[ 200 ],
  2223. count = 1;
  2224.  
  2225. if(!Player(playerid, player_aj) && !Player(playerid, player_jail))
  2226. strcat(buffer, "Ostatnia pozycja\n");
  2227. strcat(buffer, "Pozycje początkowe\n");
  2228.  
  2229. format(string, sizeof string,
  2230. "SELECT d.uid, d.name, m.type FROM `surv_doors` d JOIN `surv_members` m ON m.id = d.uid WHERE m.player = '%d' AND m.type != "#member_type_group"",
  2231. Player(playerid, player_uid)
  2232. );
  2233. mysql_query(string);
  2234. mysql_store_result();
  2235. while(mysql_fetch_row(string))
  2236. {
  2237. static uid,
  2238. name[ MAX_ITEM_NAME ],
  2239. type;
  2240.  
  2241. sscanf(string, "p<|>ds["#MAX_ITEM_NAME"]d",
  2242. uid,
  2243. name,
  2244. type
  2245. );
  2246. if(type == member_type_doors)
  2247. format(buffer, sizeof buffer, "%s%d\t[DOM]\t\t%s\n", buffer, uid, name);
  2248. else if(type == member_type_hotel)
  2249. format(buffer, sizeof buffer, "%s%d\t[HOTEL]\t%s\n", buffer, uid, name);
  2250. else continue;
  2251. count++;
  2252. }
  2253. mysql_free_result();
  2254. if(count)
  2255. {
  2256. if(Player(playerid, player_aj))
  2257. Player(playerid, player_aj) = 0;
  2258. if(Player(playerid, player_jail))
  2259. Player(playerid, player_jail) = 0;
  2260.  
  2261. Dialog::Output(playerid, 39, DIALOG_STYLE_LIST, IN_HEAD" "white"» "grey"Miejsce spawnu", buffer, "Wybierz", "");
  2262. }
  2263. else
  2264. {
  2265. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  2266.  
  2267. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  2268. Player(playerid, player_dark) = dark_spawn;
  2269. }
  2270. return 1;
  2271. }
  2272.  
  2273. FuncPub::SelectSpawn(playerid)
  2274. {
  2275. #if Debug
  2276. printf("SelectSpawn(%d)", playerid);
  2277. #endif
  2278. new buffer[ 256 ],
  2279. str[ 64 ];
  2280.  
  2281. mysql_query("SELECT `uid`, `name` FROM `surv_spawns`");
  2282. mysql_store_result();
  2283. while(mysql_fetch_row_format(str))
  2284. {
  2285. static uid,
  2286. name[ 40 ];
  2287.  
  2288. sscanf(str, "p<|>ds[32]",
  2289. uid,
  2290. name
  2291. );
  2292. format(buffer, sizeof buffer, "%s%d\t%s\n", buffer, uid, name);
  2293. }
  2294. mysql_free_result();
  2295. Dialog::Output(playerid, 1, DIALOG_STYLE_LIST, IN_HEAD" "white"» "grey"Miejsce spawnu", buffer, "Wybierz", "");
  2296. return 1;
  2297. }
  2298.  
  2299. FuncPub::LoadPlayerJailPos(playerid)
  2300. {
  2301. new string[ 64 ],
  2302. jailuid;
  2303.  
  2304. mysql_query("SELECT j.uid, j.in_x, j.in_y, j.in_z, d.in_pos_vw, d.in_pos_int FROM `surv_jail` j JOIN `surv_doors` d ON d.uid = j.door_uid ORDER BY RAND()");
  2305. mysql_store_result();
  2306. mysql_fetch_row(string);
  2307. mysql_free_result();
  2308.  
  2309. sscanf(string, "p<|>da<f>[3]dd",
  2310. jailuid,
  2311. Player(playerid, player_position),
  2312. Player(playerid, player_vw),
  2313. Player(playerid, player_int)
  2314. );
  2315.  
  2316. if((Player(playerid, player_jail) - gettime()) < (24 * 60 * 60))
  2317. Player(playerid, player_jail_timer) = SetTimerEx("Un_Jail", (Player(playerid, player_jail) - gettime()) * 1000, false, "dd", playerid, jailuid);
  2318.  
  2319. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  2320.  
  2321. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  2322. Player(playerid, player_dark) = dark_spawn;
  2323. return 1;
  2324. }
  2325.  
  2326. FuncPub::Un_Jail(playerid, jailuid)
  2327. {
  2328. new string[ 126 ];
  2329.  
  2330. format(string, sizeof string,
  2331. "SELECT `out_x`, `out_y`, `out_z` FROM `surv_jail` WHERE `uid` = '%d'",
  2332. jailuid
  2333. );
  2334. mysql_query(string);
  2335. mysql_store_result();
  2336. mysql_fetch_row(string);
  2337. mysql_free_result();
  2338.  
  2339. sscanf(string, "p<|>a<f>[3]",
  2340. Player(playerid, player_position)
  2341. );
  2342.  
  2343. ShowInfo(playerid, white"Wyszedłeś z więzienia.");// TODO
  2344.  
  2345. SetPlayerPosEx(playerid, Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ]);
  2346.  
  2347. KillTimer(Player(playerid, player_jail_timer));
  2348. Player(playerid, player_jail_timer) = 0;
  2349. Player(playerid, player_jail) = 0;
  2350. format(string, sizeof string,
  2351. "UPDATE `surv_players` SET `jail` = '%d' WHERE `uid` = '%d'",
  2352. Player(playerid, player_uid)
  2353. );
  2354. mysql_query(string);
  2355. return 1;
  2356. }
  2357.  
  2358. public OnFadeComplete(playerid, beforehold)
  2359. {
  2360. switch(Player(playerid, player_dark))
  2361. {
  2362. case dark_camera:
  2363. {
  2364. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2365. Player(playerid, player_dark) = dark_none;
  2366. OnPlayerCameraChange(playerid);
  2367. }
  2368. case dark_spawn:
  2369. {
  2370. TogglePlayerSpectating(playerid, 0);
  2371. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2372. Player(playerid, player_dark) = dark_none;
  2373. KillTimer(Player(playerid, player_cam_timer));
  2374. Player(playerid, player_cam_timer) = 0;
  2375. SpawnPlayer(playerid);
  2376. }
  2377. case dark_login:
  2378. {
  2379. if(!Player(playerid, player_login_timer))
  2380. Player(playerid, player_login_timer) = SetTimerEx("loginTimer", 30000, false, "d", playerid);
  2381. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2382. Player(playerid, player_dark) = dark_none;
  2383. OnPlayerCameraChange(playerid);
  2384. }
  2385. case dark_door_in:
  2386. {
  2387. new i = Player(playerid, player_door);
  2388.  
  2389. SetPlayerPosEx(playerid, Door(i, door_in_pos)[ 0 ], Door(i, door_in_pos)[ 1 ], Door(i, door_in_pos)[ 2 ], Door(i, door_in_pos)[ 3 ]);
  2390. SetPlayerVirtualWorld(playerid, Player(playerid, player_vw) = Door(i, door_in_vw));
  2391. SetPlayerInterior(playerid, Player(playerid, player_int) = Door(i, door_in_int));
  2392. OnPlayerEnterInterior(playerid, i);
  2393. TogglePlayerControllable(playerid, false);
  2394.  
  2395. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2396. Player(playerid, player_dark) = dark_door_in2;
  2397. }
  2398. case dark_door_in2:
  2399. {
  2400. TogglePlayerControllable(playerid, true);
  2401. if(Player(playerid, player_option) & option_freeze)
  2402. {
  2403. TogglePlayerControllable(playerid, false);
  2404. SetTimerEx("UnFreezePlayer", 3000, 0, "d", playerid);
  2405. }
  2406. }
  2407. case dark_door_out:
  2408. {
  2409. new i = Player(playerid, player_door);
  2410.  
  2411. SetPlayerPosEx(playerid, Door(i, door_out_pos)[ 0 ], Door(i, door_out_pos)[ 1 ], Door(i, door_out_pos)[ 2 ], Door(i, door_out_pos)[ 3 ]);
  2412. SetPlayerVirtualWorld(playerid, Player(playerid, player_vw) = Door(i, door_out_vw));
  2413. SetPlayerInterior(playerid, Player(playerid, player_int) = Door(i, door_out_int));
  2414. OnPlayerExitInterior(playerid, i);
  2415. TogglePlayerControllable(playerid, false);
  2416.  
  2417. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2418. Player(playerid, player_dark) = dark_door_out2;
  2419. }
  2420. case dark_door_out2:
  2421. {
  2422. TogglePlayerControllable(playerid, true);
  2423. if(Player(playerid, player_option) & option_freeze)
  2424. {
  2425. TogglePlayerControllable(playerid, false);
  2426. SetTimerEx("UnFreezePlayer", 3000, 0, "d", playerid);
  2427. }
  2428. }
  2429. case dark_hotel:
  2430. {
  2431. new string[ 200 ],
  2432. dooruid;
  2433.  
  2434. format(string, sizeof string,
  2435. "SELECT surv_hotels.*, surv_doors.in_pos_vw, surv_doors.in_pos_int FROM `surv_hotels` JOIN `surv_doors` ON surv_doors.uid = surv_hotels.door_uid WHERE surv_hotels.uid = '%d'",
  2436. Player(playerid, player_hotel)
  2437. );
  2438. mysql_query(string);
  2439. mysql_store_result();
  2440. mysql_fetch_row(string);
  2441. mysql_free_result();
  2442.  
  2443. sscanf(string, "p<|>{da<f>[3]d}a<f>[3]ddd",
  2444. Player(playerid, player_position),
  2445. dooruid,
  2446. Player(playerid, player_vw),
  2447. Player(playerid, player_int)
  2448. );
  2449.  
  2450. SetPlayerPosEx(playerid, Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ]);
  2451. SetPlayerVirtualWorld(playerid, Player(playerid, player_vw));
  2452. SetPlayerInterior(playerid, Player(playerid, player_int));
  2453. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2454. Player(playerid, player_dark) = dark_none;
  2455.  
  2456. foreach(Server_Doors, doorid)
  2457. {
  2458. if(Door(doorid, door_uid) == dooruid)
  2459. {
  2460. Player(playerid, player_door) = doorid;
  2461. break;
  2462. }
  2463. }
  2464.  
  2465. Player(playerid, player_hotel) = 0;
  2466. }
  2467. case dark_character:
  2468. {
  2469. PreloadAnimLibraries(playerid);
  2470. SelectPlayer(playerid);
  2471. SetPlayerDrunkLevel(playerid, 0);
  2472. FadeColorForPlayer(playerid, 0, 0, 0, 255, 0, 0, 0, 0, 15, 0); // Rozjaśnienie
  2473. Player(playerid, player_dark) = dark_none;
  2474. }
  2475. case dark_kick:
  2476. {
  2477. Kick(playerid);
  2478. }
  2479. }
  2480. return 1;
  2481. }
  2482.  
  2483. FuncPub::TimerCameraChange(playerid)
  2484. {
  2485. #if Debug
  2486. printf("TimerCameraChange(%d)", playerid);
  2487. #endif
  2488. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  2489. Player(playerid, player_dark) = dark_camera;
  2490. return 1;
  2491. }
  2492.  
  2493. FuncPub::OnPlayerCameraChange(playerid)
  2494. {
  2495. #if Debug
  2496. printf("OnPlayerCameraChange(%d)", playerid);
  2497. #endif
  2498. new string[ 100 ],
  2499. Float:pos[ 3 ],
  2500. Float:rpos[ 3 ];
  2501.  
  2502. format(string, sizeof string,
  2503. "SELECT * FROM `surv_cams` WHERE `uid` != '%d' ORDER BY RAND() LIMIT 1",
  2504. Player(playerid, player_cam)
  2505. );
  2506. mysql_query(string);
  2507. mysql_store_result();
  2508. mysql_fetch_row_format(string);
  2509. sscanf(string, "p<|>da<f>[3]a<f>[3]",
  2510. Player(playerid, player_cam),
  2511. pos,
  2512. rpos
  2513. );
  2514. mysql_free_result();
  2515.  
  2516. SetPlayerCameraPos(playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ]);
  2517. SetPlayerCameraLookAt(playerid, rpos[ 0 ], rpos[ 1 ], rpos[ 2 ]);
  2518. SetPlayerPos(playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] + 20.0);
  2519. return 1;
  2520. }
  2521.  
  2522. FuncPub::OnPlayerLoginOut(playerid)
  2523. {
  2524. #if Debug
  2525. printf("OnPlayerLoginOut(%d)", playerid);
  2526. #endif
  2527. if(Player(playerid, player_spawned))
  2528. {
  2529. GetPlayerPos(playerid, Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ]);
  2530. GetPlayerFacingAngle(playerid, Player(playerid, player_position)[ 3 ]);
  2531. Player(playerid, player_vw) = GetPlayerVirtualWorld(playerid);
  2532. Player(playerid, player_int) = GetPlayerInterior(playerid);
  2533. Player(playerid, player_drunklvl) = GetPlayerDrunkLevel(playerid);
  2534. }
  2535. if(Player(playerid, player_hp) > 100.0) Player(playerid, player_hp) = 100.0;
  2536. if(Player(playerid, player_hp) < 0.0) Player(playerid, player_hp) = 0.0;
  2537. new string[ 512 ];
  2538. format(string, sizeof string,
  2539. "UPDATE `surv_players` SET `timehere` = '%d', `visits` = '%d', `cash` = '%.2f', `block` = '%d', `x` = '%f', `y` = '%f', `z` = '%f', `a` = '%f', `int` = '%d', `vw` = '%d', `door` = '%d', `hp` = '%f', `aj` = '%d', `bw` = '%d', `jail` = '%d', `job` = '%d', `drunklvl` = '%d', `option` = '%d', `achiv` = '%d', `afktime` = '%d', `dist` = '%f', `veh_dist` = '%f', `lastlogged` = UNIX_TIMESTAMP() WHERE `uid` = '%d'",
  2540. Player(playerid, player_timehere)[ 0 ],
  2541. Player(playerid, player_visits),
  2542. Player(playerid, player_cash),
  2543. Player(playerid, player_block),
  2544. Player(playerid, player_position)[ 0 ],
  2545. Player(playerid, player_position)[ 1 ],
  2546. Player(playerid, player_position)[ 2 ],
  2547. Player(playerid, player_position)[ 3 ],
  2548. Player(playerid, player_int),
  2549. Player(playerid, player_vw),
  2550. Door(Player(playerid, player_door), door_uid),
  2551. Player(playerid, player_hp),
  2552. Player(playerid, player_aj),
  2553. Player(playerid, player_bw),
  2554. Player(playerid, player_jail),
  2555. Player(playerid, player_job),
  2556. Player(playerid, player_drunklvl),
  2557. Player(playerid, player_option),
  2558. Player(playerid, player_achiv),
  2559. Player(playerid, player_afktime)[ 1 ],
  2560. Player(playerid, player_dist),
  2561. Player(playerid, player_veh_dist),
  2562. Player(playerid, player_uid)
  2563. );
  2564. mysql_query(string);
  2565.  
  2566. if(Player(playerid, player_duty))
  2567. {
  2568. format(string, sizeof string,
  2569. "UPDATE `surv_members` SET `duty` = `duty` + '%d' WHERE `player` = '%d' AND (type = "#member_type_group" AND id = '%d')",
  2570. Group(playerid, Player(playerid, player_duty), group_duty),
  2571. Player(playerid, player_uid),
  2572. Group(playerid, Player(playerid, player_duty), group_uid)
  2573. );
  2574. mysql_query(string);
  2575. Player(playerid, player_duty) = 0;
  2576. Group(playerid, Player(playerid, player_duty), group_duty) = 0;
  2577. }
  2578. if(Weapon(playerid, 1, weapon_uid) || Weapon(playerid, 0, weapon_uid))
  2579. {
  2580. if(Weapon(playerid, 0, weapon_model) == Weapon(playerid, 1, weapon_model) && Weapon(playerid, 0, weapon_model))
  2581. {
  2582. new ammo = GetWeaponAmmo(playerid, Weapon(playerid, 0, weapon_model));
  2583.  
  2584. new tammo = ammo;
  2585. ammo = ammo/2 + ammo % 2;
  2586.  
  2587. format(string, sizeof string,
  2588. "UPDATE `surv_items` SET `used` = 0, `v2` = '%d' WHERE `uid` = '%d'",
  2589. tammo-ammo,
  2590. Weapon(playerid, 1, weapon_uid)
  2591. );
  2592. mysql_query(string);
  2593. ClearWeapon(playerid, 1);
  2594.  
  2595. format(string, sizeof string,
  2596. "UPDATE `surv_items` SET `used` = 0, `v2` = '%d' WHERE `uid` = '%d'",
  2597. tammo-ammo,
  2598. Weapon(playerid, 0, weapon_uid)
  2599. );
  2600. mysql_query(string);
  2601. ClearWeapon(playerid, 0);
  2602. }
  2603. else
  2604. {
  2605. for(new x; x != MAX_WEAPON; x++)
  2606. {
  2607. if(!Weapon(playerid, x, weapon_uid)) continue;
  2608. if(!Weapon(playerid, x, weapon_model)) continue;
  2609. new ammo = GetWeaponAmmo(playerid, Weapon(playerid, x, weapon_model));
  2610.  
  2611. format(string, sizeof string,
  2612. "UPDATE `surv_items` SET `used` = 0, `v2` = '%d' WHERE `uid` = '%d'",
  2613. ammo,
  2614. Weapon(playerid, x, weapon_uid)
  2615. );
  2616. mysql_query(string);
  2617. ClearWeapon(playerid, x);
  2618. }
  2619. }
  2620. }
  2621. ResetPlayerWeapons(playerid);
  2622.  
  2623. if(Player(playerid, player_rolki))
  2624. {
  2625. format(string, sizeof string,
  2626. "UPDATE `surv_items` SET `used` = 0 WHERE `ownerType`="#item_place_player" AND `owner`='%d' AND `type` ="#item_rolki"",
  2627. Player(playerid, player_uid)
  2628. );
  2629. mysql_query(string);
  2630. Player(playerid, player_rolki) = false;
  2631. }
  2632. if(Player(playerid, player_veh) != INVALID_VEHICLE_ID)
  2633. {
  2634. SaveVeh(Player(playerid, player_veh));
  2635. Player(playerid, player_veh) = INVALID_VEHICLE_ID;
  2636. }
  2637. format(string, sizeof string,
  2638. "UPDATE `surv_orders` SET `status` = '"#pack_status_none"' WHERE `drive` = '%d' AND `status` = "#pack_status_road"",
  2639. Player(playerid, player_uid)
  2640. );
  2641. mysql_query(string);
  2642.  
  2643. format(string, sizeof string,
  2644. "UPDATE `surv_items` SET `v2` = '%d' WHERE `uid` = '%d'",
  2645. Tren(playerid, train_time),
  2646. Tren(playerid, train_item)
  2647. );
  2648. mysql_query(string);
  2649.  
  2650. for(new kurid; kurid != MAX_KURIER; kurid++)
  2651. for(new eKurier:d; d < eKurier; d++)
  2652. Kurier(playerid, kurid, d) = 0;
  2653.  
  2654. for(new b; b != MAX_BLOKADA; b++)
  2655. {
  2656. if(!IsValidDynamicObject(Player(playerid, player_blockade)[ b ])) continue;
  2657. DestroyDynamicObject(Player(playerid, player_blockade)[ b ]);
  2658. }
  2659. if(Repair(playerid, repair_type) && Repair(playerid, repair_time))
  2660. {
  2661. if(Repair(playerid, repair_type) == repair_comp || Repair(playerid, repair_type) == repair_inveh || Repair(playerid, repair_type) == repair_repair || Repair(playerid, repair_type) == repair_spray)
  2662. {
  2663. new victimid = Repair(playerid, repair_player);
  2664.  
  2665. if(Repair(playerid, repair_type) == repair_repair)
  2666. GivePlayerMoneyEx(victimid, Repair(victimid, repair_value2) + Repair(playerid, repair_cash), true);
  2667. else
  2668. GivePlayerMoneyEx(victimid, Repair(playerid, repair_cash), true);
  2669.  
  2670. if(Repair(playerid, repair_type) == repair_comp || Repair(playerid, repair_type) == repair_inveh)
  2671. GameTextForPlayer(victimid, Repair(playerid, repair_type) == repair_comp ? ("~w~Tuning ~r~anulowany") : ("~w~Naprawa ~r~anulowana"), 1000, 3);
  2672. else if(Repair(playerid, repair_type) == repair_spray)
  2673. GameTextForPlayer(victimid, "~n~~r~Malowanie przerwane!", 3000, 4);
  2674. }
  2675. }
  2676. End_Repair(playerid);
  2677. End_Create(playerid);
  2678. Bank_Clear(playerid);
  2679. ClearNark(playerid);
  2680. ClearOffer(playerid);
  2681. ClearRace(playerid);
  2682. EndCall(playerid);
  2683. ClearTrening(playerid);
  2684. // ClearPhone(playerid);
  2685.  
  2686. if(Player(playerid, player_spectated))
  2687. {
  2688. foreach(Player, i)
  2689. {
  2690. if(Player(i, player_spec) != playerid) continue;
  2691.  
  2692. TogglePlayerSpectating(i, 0);
  2693. SetCameraBehindPlayer(i);
  2694. Player(i, player_spec) = INVALID_PLAYER_ID;
  2695. }
  2696. }
  2697. return 1;
  2698. }
  2699.  
  2700. FuncPub::OnPlayerLoginIn(playerid)
  2701. {
  2702. if(!Player(playerid, player_uid)) return SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  2703. #if Debug
  2704. printf("OnPlayerLoginIn(%d)", playerid);
  2705. #endif
  2706. new string[ 256 ],
  2707. pl_lastlogged;
  2708. format(string, sizeof string,
  2709. "SELECT * FROM `surv_players` WHERE `uid` = '%d' AND `guid` = '%d' LIMIT 1",
  2710. Player(playerid, player_uid),
  2711. Player(playerid, player_guid)
  2712. );
  2713. mysql_query(string);
  2714. mysql_store_result();
  2715. if(!mysql_num_rows())
  2716. {
  2717. SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  2718. mysql_free_result();
  2719. return 1;
  2720. }
  2721. mysql_fetch_row_format(string);
  2722. sscanf(string, "p<|>dds["#MAX_PLAYER_NAME"]da<f>[4]dddddddddfdddfdddddddddddddddddffd",
  2723. Player(playerid, player_guid),
  2724. Player(playerid, player_uid),
  2725. Player(playerid, player_name),
  2726. Player(playerid, player_height),
  2727. Player(playerid, player_position),
  2728. Player(playerid, player_int),
  2729. Player(playerid, player_vw),
  2730. Player(playerid, player_door),
  2731. Player(playerid, player_visits),
  2732. Player(playerid, player_timehere)[ 0 ],
  2733. Player(playerid, player_block),
  2734. Player(playerid, player_bw),
  2735. Player(playerid, player_aj),
  2736. Player(playerid, player_jail),
  2737. Player(playerid, player_cash),
  2738. Player(playerid, player_skin),
  2739. Player(playerid, player_sex),
  2740. Player(playerid, player_age),
  2741. Player(playerid, player_hp),
  2742. Player(playerid, player_achiv),
  2743. Player(playerid, player_lang),
  2744. Player(playerid, player_option),
  2745. Player(playerid, player_pulse),
  2746. Player(playerid, player_blood),
  2747. Player(playerid, player_blooding),
  2748. Player(playerid, player_hungry),
  2749. Player(playerid, player_fight),
  2750. Player(playerid, player_stamina),
  2751. Player(playerid, player_druglvl),
  2752. Player(playerid, player_drunklvl),
  2753. Player(playerid, player_anim_chat),
  2754. Player(playerid, player_mask),
  2755. Player(playerid, player_job),
  2756. Player(playerid, player_opis),
  2757. Player(playerid, player_pkt),
  2758. Player(playerid, player_afktime)[ 1 ],
  2759. Player(playerid, player_dist),
  2760. Player(playerid, player_veh_dist),
  2761. pl_lastlogged
  2762. );
  2763. mysql_free_result();
  2764.  
  2765. if(Player(playerid, player_block) & block_ban)
  2766. {
  2767. Chat::Output(playerid, RED, "Ta postać jest zbanowana!");
  2768. cmd_login(playerid, "");
  2769. return 1;
  2770. }
  2771. else if(Player(playerid, player_block) & block_ck)
  2772. {
  2773. Chat::Output(playerid, RED, "Ta postać nie żyje!");
  2774. cmd_login(playerid, "");
  2775. return 1;
  2776. }
  2777. else if(Player(playerid, player_block) & block_block)
  2778. {
  2779. Chat::Output(playerid, RED, "Ta postać jest zablokowana!");
  2780. cmd_login(playerid, "");
  2781. return 1;
  2782. }
  2783. #if Locked
  2784. else if(!(Player(playerid, player_option) & option_connect))
  2785. return SetTimerEx (!#kickPlayer, 249, false, !"i", playerid);
  2786. #endif
  2787.  
  2788. if(Player(playerid, player_door))
  2789. {
  2790. foreach(Server_Doors, door)
  2791. {
  2792. if(Player(playerid, player_door) == Door(door, door_uid))
  2793. {
  2794. Player(playerid, player_door) = door;
  2795. SetPlayerWeather(playerid, 2);
  2796. break;
  2797. }
  2798. }
  2799. }
  2800. SetPlayerName(playerid, Player(playerid, player_name));
  2801. SetPlayerMoney(playerid, Player(playerid, player_cash));
  2802. SetPlayerColor(playerid, 0xFFFFFF00);
  2803. if(Player(playerid, player_cam_timer))
  2804. {
  2805. KillTimer(Player(playerid, player_cam_timer));
  2806. Player(playerid, player_cam_timer) = 0;
  2807. }
  2808. if(Player(playerid, player_login_timer))
  2809. {
  2810. KillTimer(Player(playerid, player_login_timer));
  2811. Player(playerid, player_login_timer) = 0;
  2812. }
  2813.  
  2814. Player(playerid, player_logged) = true;
  2815. Player(playerid, player_visits)++;
  2816. UpdateInfos();
  2817.  
  2818. if(Player(playerid, player_premium))
  2819. Player(playerid, player_color) = player_nick_prem;
  2820. else
  2821. Player(playerid, player_color) = player_nick_def;
  2822.  
  2823.  
  2824. if(Player(playerid, player_tag) == Text3D:INVALID_3DTEXT_ID)
  2825. {
  2826. new nametag[ MAX_PLAYER_NAME + 7 ];
  2827. format(nametag, sizeof nametag, "%s (%d)", NickName(playerid), playerid);
  2828. Player(playerid, player_tag) = Create3DTextLabel(nametag, Player(playerid, player_color), 0.0, 0.0, 0.0, 14.0, 1, true);
  2829. Attach3DTextLabelToPlayer(Player(playerid, player_tag), playerid, 0.0, 0.0, 0.17);
  2830. }
  2831.  
  2832. format(string, sizeof string,
  2833. "INSERT INTO `all_online` VALUES ('"#type_rp"', '%d', '%d', UNIX_TIMESTAMP())",
  2834. Player(playerid, player_uid),
  2835. playerid
  2836. );
  2837. mysql_query(string);
  2838.  
  2839. format(string, sizeof string,
  2840. "Witaj, "C_BLUE2"%s "white"na postaci: "C_BLUE2"%s "grey"(UID: %d, GUID: %d, ID: %d)"white". Miłej gry!",
  2841. Player(playerid, player_gname),
  2842. NickSamp(playerid, true),
  2843. Player(playerid, player_uid),
  2844. Player(playerid, player_guid),
  2845. playerid
  2846. );
  2847. Chat::Output(playerid, CLR_WHITE, string);
  2848.  
  2849. #if !STREAMER
  2850. for(new t = 1; t != MAX_OBJECTS; t++) Object(playerid, t, obj_objID) = INVALID_OBJECT_ID;
  2851. #endif
  2852. for(new t = 1; t != MAX_3DTEXT_PLAYER; t++) Text(playerid, t, text_textID) = PlayerText3D:INVALID_3DTEXT_ID;
  2853.  
  2854. LoadPlayerTextDraws(playerid);
  2855. LoadPlayerGroups(playerid);
  2856. LoadPlayerOpis(playerid);
  2857. LoadIcons(playerid);
  2858. ShowPlayerZone(playerid);
  2859. ShowCountOfMessages(playerid);
  2860. UpdatePlayerNick(playerid);
  2861. LoadPlayerFriends(playerid);
  2862. RemovePlayerBuilds(playerid);
  2863.  
  2864. GameTextForPlayer(playerid, "~w~Zostales ~y~Zalogowany!", 3000, 1);
  2865. GivePlayerAchiv(playerid, achiv_login);
  2866.  
  2867. if(!Player(playerid, player_timehere)[ 0 ])
  2868. {
  2869. format(string, sizeof string, "Ubranie(%d)", Player(playerid, player_skin));
  2870. Createitem(playerid, item_cloth, Player(playerid, player_skin), 0, 0.0, string, 200);
  2871.  
  2872. SelectSpawn(playerid);
  2873. }
  2874. else if(Player(playerid, player_aj))
  2875. {
  2876. Player(playerid, player_position)[ 0 ] = Setting(setting_aj)[ 0 ];
  2877. Player(playerid, player_position)[ 1 ] = Setting(setting_aj)[ 1 ];
  2878. Player(playerid, player_position)[ 2 ] = Setting(setting_aj)[ 2 ];
  2879. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  2880.  
  2881. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  2882. Player(playerid, player_dark) = dark_spawn;
  2883. }
  2884. else if(gettime() < Player(playerid, player_jail))
  2885. {
  2886. LoadPlayerJailPos(playerid);
  2887. }
  2888. else if(Player(playerid, player_bw) || (gettime() - pl_lastlogged) < 15*60)
  2889. {
  2890. SetSpawnInfo(playerid, NO_TEAM, Player(playerid, player_skin), Player(playerid, player_position)[ 0 ], Player(playerid, player_position)[ 1 ], Player(playerid, player_position)[ 2 ], Player(playerid, player_position)[ 3 ], 0, 0, 0, 0, 0, 0);
  2891.  
  2892. FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 255, 15, 0); // Ściemnienie
  2893. Player(playerid, player_dark) = dark_spawn;
  2894. }
  2895. else PlayerSpawn(playerid);
  2896. return 1;
  2897. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement