Advertisement
Guest User

Untitled

a guest
Dec 17th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.90 KB | None | 0 0
  1. //----------------------------------------------------------
  2. //
  3. // Play Brasil v2.0
  4. // Divirta-s no nosso servidor
  5. //
  6. //----------------------------------------------------------
  7. #include a_samp
  8. #include dini
  9. #include DOF2
  10. #include <YSI\y_commands>
  11. #include <YSI\y_va>
  12. #include <core>
  13. #include <float>
  14. #include "../include/gl_common.inc"
  15. #include "../include/gl_spawns.inc"
  16. #define GREEN 0x21DD00FF
  17. #define RED 0xE60000FF
  18. #define ADMIN_RED 0xFB0000FF
  19. #define YELLOW 0xFFFF00FF
  20. #define ORANGE 0xF97804FF
  21. #define LIGHTRED 0xFF8080FF
  22. #define LIGHTBLUE 0x00C2ECFF
  23. #define PURPLE 0xB360FDFF
  24. #define PLAYER_COLOR 0xFFFFFFFF
  25. #define BLUE 0x1229FAFF
  26. #define LIGHTGREEN 0x38FF06FF
  27. #define DARKPINK 0xE100E1FF
  28. #define DARKGREEN 0x008040FF
  29. #define ANNOUNCEMENT 0x6AF7E1FF
  30. #define COLOR_SYSTEM 0xEFEFF7AA
  31. #define GREY 0xCECECEFF
  32. #define PINK 0xD52DFFFF
  33. #define DARKGREY 0x626262FF
  34. #define AQUAGREEN 0x03D687FF
  35. #define NICESKY 0x99FFFFAA
  36. #define WHITE 0xFFFFFFFF
  37. #define ACCOUNTS_FOLDER "Contas/%s.ini"
  38. #define LOGIN_DELAY 3
  39. #define COLOR_RED 0xAA3333AA
  40. #define COLOR_GREEN 0x33AA33AA
  41. #define PATH "Armas"
  42. #define COLOR_WHITE 0xFFFFFFFF
  43. #define COLOR_NORMAL_PLAYER 0xFFBB7777
  44. #define CITY_LOS_SANTOS 0
  45. #define CITY_SAN_FIERRO 1
  46. #define CITY_LAS_VENTURAS 2
  47. #pragma tabsize 0
  48.  
  49. new bool:AlreadyGiveWeapons[MAX_PLAYERS];
  50.  
  51. SaveWeaponsToFile(playerid)
  52. {
  53. new i, path[50], string[128], weaponid, ammo;
  54. path = GetPlayerFormattedName(playerid);
  55. if (!dini_Exists(path)) dini_Create(path);
  56. for (i=0; i<13; i++)
  57. {
  58. GetPlayerWeaponData(playerid,i,weaponid,ammo);
  59. format(string,sizeof(string),"Arma - %d",i);
  60. dini_IntSet(path,string,weaponid);
  61. format(string,sizeof(string),"Municao - %d",i);
  62. dini_IntSet(path,string,ammo == 65535 ? 0 : ammo);
  63. }
  64. }
  65.  
  66. forward LoadArmasToFile(playerid);
  67. public LoadArmasToFile(playerid)
  68. {
  69. new i, path[50], string[128], weaponid, ammo;
  70. path = GetPlayerFormattedName(playerid);
  71. ResetPlayerWeapons(playerid);
  72. for (i=0; i<13; i++)
  73. {
  74. format(string,sizeof(string),"Arma - %d",i);
  75. weaponid = dini_Int(path,string);
  76. format(string,sizeof(string),"Municao - %d",i);
  77. ammo = dini_Int(path,string);
  78. GivePlayerWeapon(playerid,weaponid,ammo);
  79. }
  80. AlreadyGiveWeapons[playerid] = true;
  81. }
  82.  
  83. GetPlayerFormattedName(playerid)
  84. {
  85. new name[24], full[50];
  86. GetPlayerName(playerid,name,sizeof(name));
  87. format(full,sizeof(full),"%s/%s.txt",PATH,name);
  88. return full;
  89. }
  90.  
  91. //----------------------------------------------------------
  92.  
  93. new total_vehicles_from_files=0;
  94.  
  95. // Class selection globals
  96. new gPlayerCitySelection[MAX_PLAYERS];
  97. new gPlayerHasCitySelected[MAX_PLAYERS];
  98. new gPlayerLastCitySelectionTick[MAX_PLAYERS];
  99.  
  100. new Text:txtClassSelHelper;
  101. new Text:txtLosSantos;
  102. new Text:txtSanFierro;
  103. new Text:txtLasVenturas;
  104.  
  105. new thisanimid=0;
  106. new lastanimid=0;
  107.  
  108. //----------------------------------------------------------
  109.  
  110. main()
  111. {
  112. print("\n---------------------------------------");
  113. print("Iniciando Play Brasil v2.0\n");
  114. print("---------------------------------------\n");
  115. }
  116.  
  117. //----------------------------------------------------------
  118.  
  119. public OnPlayerDeath(playerid, killerid, reason)
  120. {
  121. new playercash;
  122.  
  123. gPlayerHasCitySelected[playerid] = 0;
  124.  
  125. if(killerid == INVALID_PLAYER_ID) {
  126. ResetPlayerMoney(playerid);
  127. } else {
  128. playercash = GetPlayerMoney(playerid);
  129. if(playercash > 0) {
  130. GivePlayerMoney(killerid, playercash);
  131. ResetPlayerMoney(playerid);
  132. }
  133. }
  134. return 1;
  135. }
  136.  
  137. //----------------------------------------------------------
  138.  
  139. ClassSel_InitCityNameText(Text:txtInit)
  140. {
  141. TextDrawUseBox(txtInit, 0);
  142. TextDrawLetterSize(txtInit,1.25,3.0);
  143. TextDrawFont(txtInit, 0);
  144. TextDrawSetShadow(txtInit,0);
  145. TextDrawSetOutline(txtInit,1);
  146. TextDrawColor(txtInit,0xEEEEEEFF);
  147. TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
  148. }
  149.  
  150. //----------------------------------------------------------
  151.  
  152. ClassSel_InitTextDraws()
  153. {
  154. // Init our observer helper text display
  155. txtLosSantos = TextDrawCreate(10.0, 380.0, "Los Santos");
  156. ClassSel_InitCityNameText(txtLosSantos);
  157. txtSanFierro = TextDrawCreate(10.0, 380.0, "San Fierro");
  158. ClassSel_InitCityNameText(txtSanFierro);
  159. txtLasVenturas = TextDrawCreate(10.0, 380.0, "Las Venturas");
  160. ClassSel_InitCityNameText(txtLasVenturas);
  161.  
  162. // Init our observer helper text display
  163. txtClassSelHelper = TextDrawCreate(10.0, 415.0,
  164. " Press ~b~~k~~GO_LEFT~ ~w~or ~b~~k~~GO_RIGHT~ ~w~to switch cities.~n~ Press ~r~~k~~PED_FIREWEAPON~ ~w~to select.");
  165. TextDrawUseBox(txtClassSelHelper, 1);
  166. TextDrawBoxColor(txtClassSelHelper,0x222222BB);
  167. TextDrawLetterSize(txtClassSelHelper,0.3,1.0);
  168. TextDrawTextSize(txtClassSelHelper,400.0,40.0);
  169. TextDrawFont(txtClassSelHelper, 2);
  170. TextDrawSetShadow(txtClassSelHelper,0);
  171. TextDrawSetOutline(txtClassSelHelper,1);
  172. TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
  173. TextDrawColor(txtClassSelHelper,0xFFFFFFFF);
  174. }
  175.  
  176. //----------------------------------------------------------
  177.  
  178. ClassSel_SetupSelectedCity(playerid)
  179. {
  180. if(gPlayerCitySelection[playerid] == -1) {
  181. gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  182. }
  183.  
  184. if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
  185. SetPlayerInterior(playerid,0);
  186. SetPlayerCameraPos(playerid,1630.6136,-2286.0298,110.0);
  187. SetPlayerCameraLookAt(playerid,1887.6034,-1682.1442,47.6167);
  188.  
  189. TextDrawShowForPlayer(playerid,txtLosSantos);
  190. TextDrawHideForPlayer(playerid,txtSanFierro);
  191. TextDrawHideForPlayer(playerid,txtLasVenturas);
  192. }
  193. else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
  194. SetPlayerInterior(playerid,0);
  195. SetPlayerCameraPos(playerid,-1300.8754,68.0546,129.4823);
  196. SetPlayerCameraLookAt(playerid,-1817.9412,769.3878,132.6589);
  197.  
  198. TextDrawHideForPlayer(playerid,txtLosSantos);
  199. TextDrawShowForPlayer(playerid,txtSanFierro);
  200. TextDrawHideForPlayer(playerid,txtLasVenturas);
  201. }
  202. else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
  203. SetPlayerInterior(playerid,0);
  204. SetPlayerCameraPos(playerid,1310.6155,1675.9182,110.7390);
  205. SetPlayerCameraLookAt(playerid,2285.2944,1919.3756,68.2275);
  206.  
  207. TextDrawHideForPlayer(playerid,txtLosSantos);
  208. TextDrawHideForPlayer(playerid,txtSanFierro);
  209. TextDrawShowForPlayer(playerid,txtLasVenturas);
  210. }
  211. }
  212.  
  213. //----------------------------------------------------------
  214.  
  215. ClassSel_SwitchToNextCity(playerid)
  216. {
  217. gPlayerCitySelection[playerid]++;
  218. if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) {
  219. gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  220. }
  221. PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
  222. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  223. ClassSel_SetupSelectedCity(playerid);
  224. }
  225.  
  226. //----------------------------------------------------------
  227.  
  228. ClassSel_SwitchToPreviousCity(playerid)
  229. {
  230. gPlayerCitySelection[playerid]--;
  231. if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) {
  232. gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
  233. }
  234. PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
  235. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  236. ClassSel_SetupSelectedCity(playerid);
  237. }
  238.  
  239. //----------------------------------------------------------
  240.  
  241. ClassSel_HandleCitySelection(playerid)
  242. {
  243. new Keys,ud,lr;
  244. GetPlayerKeys(playerid,Keys,ud,lr);
  245.  
  246. if(gPlayerCitySelection[playerid] == -1) {
  247. ClassSel_SwitchToNextCity(playerid);
  248. return;
  249. }
  250.  
  251. // only allow new selection every ~500 ms
  252. if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return;
  253.  
  254. if(Keys & KEY_FIRE) {
  255. gPlayerHasCitySelected[playerid] = 1;
  256. TextDrawHideForPlayer(playerid,txtClassSelHelper);
  257. TextDrawHideForPlayer(playerid,txtLosSantos);
  258. TextDrawHideForPlayer(playerid,txtSanFierro);
  259. TextDrawHideForPlayer(playerid,txtLasVenturas);
  260. TogglePlayerSpectating(playerid,0);
  261. return;
  262. }
  263.  
  264. if(lr > 0) {
  265. ClassSel_SwitchToNextCity(playerid);
  266. }
  267. else if(lr < 0) {
  268. ClassSel_SwitchToPreviousCity(playerid);
  269. }
  270. }
  271.  
  272.  
  273. //----------------------------------------------------------
  274. public OnGameModeInit()
  275. {
  276. SendRconCommand("reloadfs Seifistration");
  277. SetGameModeText("Play Brasil v2.0");
  278. ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
  279. ShowNameTags(1);
  280. SetNameTagDrawDistance(40.0);
  281. EnableStuntBonusForAll(0);
  282. DisableInteriorEnterExits();
  283. SetWeather(2);
  284. SetWorldTime(11);
  285.  
  286. //UsePlayerPedAnims();
  287. //ManualVehicleEngineAndLights();
  288. //LimitGlobalChatRadius(300.0);
  289.  
  290. ClassSel_InitTextDraws();
  291.  
  292. //Estacionamento Começo
  293. AddStaticVehicleEx(451,1560.6752,-2308.8251,13.3847,89.7603,-1,-1,-1);//Turismo
  294. AddStaticVehicleEx(496,1560.6705,-2312.1889,13.3851,90.0159,-1,-1,-1);//Blista Compact
  295. AddStaticVehicleEx(522,1560.6695,-2315.4543,13.3858,90.3470,-1,-1,-1);//NRG-500
  296. AddStaticVehicleEx(535,1560.5975,-2318.7077,13.3869,90.4286,-1,-1,-1);//Slamvan
  297. AddStaticVehicleEx(536,1560.5722,-2322.0429,13.3872,90.0234,-1,-1,-1);//Blade
  298. AddStaticVehicleEx(571,1560.5582,-2325.2968,13.3868,91.6376,-1,-1,-1);//Kart
  299. AddStaticVehicleEx(602,1560.5460,-2328.5771,13.3868,91.2366,-1,-1,-1);//Alpha
  300. AddStaticVehicleEx(424,1560.5727,-2331.8737,13.3865,91.1397,-1,-1,-1);//BF Injection
  301. AddStaticVehicleEx(426,1560.6219,-2335.1589,13.3850,90.4296,-1,-1,-1);//Premier
  302. AddStaticVehicleEx(463,1560.6428,-2338.4057,13.3850,89.9542,-1,-1,-1);//Freeway
  303. AddStaticVehicleEx(468,1556.1920,-2361.2795,13.3926,358.7655,-1,-1,-1);//Sanchez
  304. AddStaticVehicleEx(494,1552.8095,-2361.3000,13.3926,0.8178,-1,-1,-1);//Hotring Racer
  305. AddStaticVehicleEx(534,1549.4101,-2361.4143,13.3603,359.5743,-1,-1,-1);//Remington
  306. AddStaticVehicleEx(541,1546.2360,-2361.4167,13.3926,359.6683,-1,-1,-1);//Bullet
  307. AddStaticVehicleEx(545,1542.9621,-2361.4099,13.3926,0.1327,-1,-1,-1);//Hustler
  308. AddStaticVehicleEx(560,1539.7258,-2361.3950,13.3926,1.2470,-1,-1,-1);//Sultan
  309. AddStaticVehicleEx(568,1536.3930,-2361.3400,13.3926,0.9429,-1,-1,-1);//Bandito
  310. AddStaticVehicleEx(579,1533.0325,-2361.3640,13.3928,0.8261,-1,-1,-1);//Huntley
  311. AddStaticVehicleEx(477,1529.8009,-2361.3803,13.3927,0.0713,-1,-1,-1);//ZR-350
  312. AddStaticVehicleEx(603,1526.4805,-2361.3305,13.3926,358.9965,-1,-1,-1);//Phoenix
  313. CreateObject(987,1565.90002441,-2308.19995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (2)
  314. CreateObject(987,1565.90002441,-2320.10009766,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (4)
  315. CreateObject(987,1566.00000000,-2331.80004883,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (5)
  316. CreateObject(987,1565.90002441,-2343.69995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (7)
  317. CreateObject(987,1565.90002441,-2355.69995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (8)
  318. CreateObject(987,1566.00000000,-2367.69995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (10)
  319. CreateObject(987,1554.30004883,-2368.00000000,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (11)
  320. CreateObject(987,1542.30004883,-2368.00000000,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (12)
  321. CreateObject(987,1530.30004883,-2368.10009766,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (14)
  322. CreateObject(987,1518.30004883,-2368.10009766,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (15)
  323. CreateObject(987,1506.50000000,-2367.89990234,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (16)
  324. CreateObject(987,1494.50000000,-2367.89990234,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (18)
  325. CreateObject(987,1484.40002441,-2367.89990234,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (19)
  326. CreateObject(987,1484.50000000,-2356.30004883,12.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (20)
  327. CreateObject(987,1484.50000000,-2344.30004883,12.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (21)
  328. CreateObject(987,1484.59997559,-2342.39990234,12.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (22)
  329. CreateObject(987,1496.19995117,-2340.39990234,12.50000000,0.00000000,0.00000000,190.00000000); //object(elecfence_bar) (23)
  330. CreateObject(987,1508.09997559,-2340.30004883,12.50000000,0.00000000,0.00000000,180.00000000); //object(elecfence_bar) (24)
  331. CreateObject(987,1520.09997559,-2340.30004883,12.50000000,0.00000000,0.00000000,179.99450684); //object(elecfence_bar) (25)
  332. CreateObject(987,1532.00000000,-2340.30004883,12.50000000,0.00000000,0.00000000,179.99450684); //object(elecfence_bar) (26)
  333. CreateObject(987,1538.19995117,-2340.50000000,12.50000000,0.00000000,0.00000000,177.99450684); //object(elecfence_bar) (27)
  334. CreateObject(987,1538.50000000,-2328.80004883,12.50000000,0.00000000,0.00000000,269.99450684); //object(elecfence_bar) (28)
  335. CreateObject(987,1538.50000000,-2316.89990234,12.50000000,0.00000000,0.00000000,269.98901367); //object(elecfence_bar) (29)
  336. CreateObject(987,1538.40002441,-2307.80004883,12.50000000,0.00000000,0.00000000,269.98901367); //object(elecfence_bar) (30)
  337. CreateObject(987,1538.30004883,-2296.69995117,12.50000000,0.00000000,0.00000000,269.98901367); //object(elecfence_bar) (31)
  338. CreateObject(987,1565.69995117,-2296.60009766,12.60000038,0.00000000,0.00000000,179.98901367); //object(elecfence_bar) (32)
  339. CreateObject(1324,1542.19995117,-2295.39990234,14.00000000,0.00000000,0.00000000,68.00000000 ); //object(ws_roadwarning_04) (1)
  340. CreateObject(3881,1562.50000000,-2301.69995117,14.39999962,0.00000000,0.00000000,0.00000000 ); //object(airsecbooth_sfse) (1)
  341. CreateObject(3749,1547.890,-2297.051,18.548,0.000,0.000,0.000); //object(clubgate01_lax) (1)
  342. //Estacionamento Fim
  343. //Não tirar Começo
  344. AddPlayerClass(281,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  345. AddPlayerClass(282,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  346. AddPlayerClass(283,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  347. AddPlayerClass(284,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  348. AddPlayerClass(285,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  349. AddPlayerClass(286,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  350. AddPlayerClass(287,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  351. AddPlayerClass(288,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  352. AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  353. AddPlayerClass(265,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  354. AddPlayerClass(266,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  355. AddPlayerClass(267,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  356. AddPlayerClass(268,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  357. AddPlayerClass(269,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  358. AddPlayerClass(270,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  359. AddPlayerClass(1,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  360. AddPlayerClass(2,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  361. AddPlayerClass(3,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  362. AddPlayerClass(4,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  363. AddPlayerClass(5,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  364. AddPlayerClass(6,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  365. AddPlayerClass(8,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  366. AddPlayerClass(42,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  367. AddPlayerClass(65,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  368. //AddPlayerClass(74,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  369. AddPlayerClass(86,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  370. AddPlayerClass(119,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  371. AddPlayerClass(149,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  372. AddPlayerClass(208,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  373. AddPlayerClass(273,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  374. AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  375.  
  376. AddPlayerClass(47,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  377. AddPlayerClass(48,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  378. AddPlayerClass(49,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  379. AddPlayerClass(50,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  380. AddPlayerClass(51,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  381. AddPlayerClass(52,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  382. AddPlayerClass(53,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  383. AddPlayerClass(54,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  384. AddPlayerClass(55,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  385. AddPlayerClass(56,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  386. AddPlayerClass(57,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  387. AddPlayerClass(58,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  388. AddPlayerClass(68,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  389. AddPlayerClass(69,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  390. AddPlayerClass(70,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  391. AddPlayerClass(71,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  392. AddPlayerClass(72,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  393. AddPlayerClass(73,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  394. AddPlayerClass(75,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  395. AddPlayerClass(76,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  396. AddPlayerClass(78,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  397. AddPlayerClass(79,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  398. AddPlayerClass(80,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  399. AddPlayerClass(81,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  400. AddPlayerClass(82,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  401. AddPlayerClass(83,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  402. AddPlayerClass(84,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  403. AddPlayerClass(85,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  404. AddPlayerClass(87,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  405. AddPlayerClass(88,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  406. AddPlayerClass(89,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  407. AddPlayerClass(91,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  408. AddPlayerClass(92,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  409. AddPlayerClass(93,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  410. AddPlayerClass(95,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  411. AddPlayerClass(96,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  412. AddPlayerClass(97,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  413. AddPlayerClass(98,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  414. AddPlayerClass(99,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  415. //Não tirar Fim
  416. // SPECIAL
  417. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
  418. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
  419.  
  420. // LAS VENTURAS
  421. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
  422. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
  423. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
  424.  
  425. // SAN FIERRO
  426. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
  427. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
  428. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
  429.  
  430. // LOS SANTOS
  431. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
  432. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  433. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  434. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  435.  
  436. // OTHER AREAS
  437. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
  438. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
  439. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
  440. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
  441. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
  442.  
  443. printf("Total de veículos carregados: %d",total_vehicles_from_files);
  444.  
  445. return 1;
  446. }
  447.  
  448. enum aInfo
  449. {
  450. aSenha[128],
  451. aLogged,
  452. }
  453. ;
  454. new AccountInfo[MAX_PLAYERS][aInfo];
  455. new registro[MAX_PLAYERS];
  456. new login[MAX_PLAYERS];
  457. forward LogIn(playerid);
  458. forward OnPlayerUpdate(playerid);
  459.  
  460. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  461. {
  462. if (response == 1)
  463. {
  464. if(dialogid == 12345)
  465. {
  466. if(strlen(inputtext))
  467. {
  468. Encrypt(inputtext);
  469. new player[MAX_PLAYER_NAME];
  470. GetPlayerName(playerid, player, 50);
  471. new string3[32];
  472. new playername3[MAX_PLAYER_NAME];
  473. GetPlayerName(playerid, playername3, sizeof(playername3));
  474. format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
  475. new ip[20];
  476. GetPlayerIp(playerid,ip,sizeof(ip));
  477. new File: hFile = fopen(string3, io_write);
  478. if (hFile)
  479. {
  480. strmid(AccountInfo[playerid][aSenha], inputtext, 0, strlen(inputtext), 255);
  481. new var[128];
  482. format(var, 128, "Senha=%s\n", AccountInfo[playerid][aSenha]);fwrite(hFile, var);
  483. format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
  484. fclose(hFile);
  485. printf("%s is signed up.",playername3);
  486. SendClientMessage(playerid, GREEN, "|- Voce já esta registrado, faça login. -|");
  487. new girismsg[256];
  488. format(girismsg,256,"Seja Bem Vindo\n\nNick: %s\n\nSenha:",playername3);
  489. ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
  490. registro[playerid] = 0;
  491. login[playerid] = 1;
  492. }
  493. }
  494. else if(!strlen(inputtext))
  495. {
  496. new name[MAX_PLAYER_NAME];
  497. GetPlayerName(playerid, name, sizeof(name));
  498. new kayitmsg[256];
  499. format(kayitmsg,256,"Seja Bem Vindo\n\n%s Por favor, se registre!\n\nSenha:",name);
  500. ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",kayitmsg,"Registrar","Sair");
  501. registro[playerid] = 1;
  502. login[playerid] = 0;
  503. }
  504. }
  505. if(dialogid == 12346)
  506. {
  507. Encrypt(inputtext);
  508. new string2[128];
  509. new playername2[MAX_PLAYER_NAME];
  510. GetPlayerName(playerid, playername2, sizeof(playername2));
  511. format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
  512. new File: UserFile = fopen(string2, io_read);
  513. if ( UserFile )
  514. {
  515. new PassData[256];
  516. new keytmp[256], valtmp[256];
  517. fread( UserFile , PassData , sizeof( PassData ) );
  518. keytmp = ini_GetKey( PassData );
  519. if( strcmp( keytmp , "Senha" , true ) == 0 )
  520. {
  521. valtmp = ini_GetValue( PassData );
  522. strmid(AccountInfo[playerid][aSenha], valtmp, 0, strlen(valtmp)-1, 255);
  523. }
  524. if(strcmp(AccountInfo[playerid][aSenha],inputtext, true ) == 0)
  525. {
  526. if(strlen(inputtext))
  527. {
  528. for(new p = 0; p < strlen(AccountInfo[playerid][aSenha]); p++)
  529. {
  530. inputtext[p] = '?';
  531. }
  532. SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
  533. printf("%s esta logando.",playername2);
  534. new key[256];
  535. new Data[256];
  536. while ( fread( UserFile , Data , sizeof( Data ) ) )
  537.  
  538. {
  539. key = ini_GetKey( Data );
  540. /*if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file.
  541.  
  542. {
  543. val = ini_GetValue( Data );
  544. AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined.
  545.  
  546. }
  547. */
  548.  
  549. }
  550. fclose(UserFile);
  551. }
  552. }
  553. else
  554. {
  555. if(strlen(inputtext))
  556. {
  557. new girismsg[256];
  558. printf("%s esta usando senha errada.",playername2);
  559. format(girismsg,256,"SENHA ERRADA\n\nSenha:");
  560. ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
  561. login[playerid] = 1;
  562. registro[playerid] = 0;
  563. fclose(UserFile);
  564. return 1;
  565. }
  566. }
  567. if(!strlen(inputtext))
  568. {
  569. new girismsg[256];
  570. printf("%s nao esta entrando com senha.",playername2);
  571. format(girismsg,256,"SENHA ERRADA\n\nSenha:");
  572. ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
  573. login[playerid] = 1;
  574. registro[playerid] = 0;
  575. fclose(UserFile);
  576. return 1;
  577. }
  578. }
  579. }
  580. if(dialogid == 12347)
  581. {
  582. Encrypt(inputtext);
  583. new string2[128];
  584. new playername2[MAX_PLAYER_NAME];
  585. GetPlayerName(playerid, playername2, sizeof(playername2));
  586. format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
  587. new File: UserFile = fopen(string2, io_read);
  588. if ( UserFile )
  589. {
  590. new PassData[256];
  591. new keytmp[256], valtmp[256];
  592. fread( UserFile , PassData , sizeof( PassData ) );
  593. keytmp = ini_GetKey( PassData );
  594. if( strcmp( keytmp , "Senha" , true ) == 0 )
  595. {
  596. valtmp = ini_GetValue( PassData );
  597. strmid(AccountInfo[playerid][aSenha], valtmp, 0, strlen(valtmp)-1, 255);
  598. }
  599. if(strcmp(AccountInfo[playerid][aSenha],inputtext, true ) == 0)
  600. {
  601. if(strlen(inputtext))
  602. {
  603. for(new p = 0; p < strlen(AccountInfo[playerid][aSenha]); p++)
  604. {
  605. inputtext[p] = '?';
  606. }
  607. SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
  608. printf("%s esta logando.",playername2);
  609. new key[256];
  610. new Data[256];
  611. while ( fread( UserFile , Data , sizeof( Data ) ) )
  612.  
  613. {
  614. key = ini_GetKey( Data );
  615. /*if(strcmp(key, "AdminLevel", true) == 0) // Este é apenas um exemplo, se você quiser acrescentar mais coisas para guardar em um arquivo.
  616.  
  617. {
  618. val = ini_GetValue( Data );
  619. AccountInfo[playerid][AdminLevel] = strval(val); // Descomentando isso vai lhe dar erros se a variável não está definida.
  620.  
  621. }
  622. */
  623.  
  624. }
  625. fclose(UserFile);
  626. }
  627. }
  628. else
  629. {
  630. if(strlen(inputtext))
  631. {
  632. new girismsg[256];
  633. printf("%s esta errando a senha.",playername2);
  634. format(girismsg,256,"SENHA ERRADA\n\nSenha:");
  635. ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
  636. login[playerid] = 1;
  637. registro[playerid] = 0;
  638. fclose(UserFile);
  639. return 1;
  640. }
  641. }
  642. if(!strlen(inputtext))
  643. {
  644. new girismsg[256];
  645. printf("%s did not enter the Senha.",playername2);
  646. format(girismsg,256,"SENHA ERRADA\n\nSenha:");
  647. ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
  648. login[playerid] = 1;
  649. registro[playerid] = 0;
  650. fclose(UserFile);
  651. return 1;
  652. }
  653. }
  654.  
  655. }
  656. }
  657. else return Kick(playerid);
  658. return 0;
  659. }
  660.  
  661.  
  662. public OnVehicleSpawn(vehicleid)
  663. {
  664. return 1;
  665. }
  666.  
  667. public OnVehicleDeath(vehicleid, killerid)
  668. {
  669. return 1;
  670. }
  671.  
  672. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  673. {
  674. return 1;
  675. }
  676.  
  677. public OnPlayerExitVehicle(playerid, vehicleid)
  678. {
  679. return 1;
  680. }
  681.  
  682. public OnPlayerStateChange(playerid, newstate, oldstate)
  683. {
  684. return 1;
  685. }
  686.  
  687. public OnPlayerEnterCheckpoint(playerid)
  688. {
  689. return 1;
  690. }
  691.  
  692. public OnPlayerLeaveCheckpoint(playerid)
  693. {
  694. return 1;
  695. }
  696.  
  697. public OnPlayerEnterRaceCheckpoint(playerid)
  698. {
  699. return 1;
  700. }
  701.  
  702. public OnPlayerLeaveRaceCheckpoint(playerid)
  703. {
  704. return 1;
  705. }
  706.  
  707. public OnRconCommand(cmd[])
  708. {
  709. return 1;
  710. }
  711.  
  712. public OnObjectMoved(objectid)
  713. {
  714. return 1;
  715. }
  716.  
  717. public OnPlayerObjectMoved(playerid, objectid)
  718. {
  719. return 1;
  720. }
  721.  
  722. public OnPlayerPickUpPickup(playerid, pickupid)
  723. {
  724. return 1;
  725. }
  726.  
  727. public OnPlayerSelectedMenuRow(playerid, row)
  728. {
  729. return 1;
  730. }
  731.  
  732. public OnPlayerExitedMenu(playerid)
  733. {
  734. return 1;
  735. }
  736.  
  737. stock ini_GetKey( line[] )
  738. {
  739. new keyRes[256];
  740. keyRes[0] = 0;
  741. if ( strfind( line , "=" , true ) == -1 ) return keyRes;
  742. strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
  743. return keyRes;
  744. }
  745.  
  746. stock ini_GetValue( line[] )
  747. {
  748. new valRes[256];
  749. valRes[0]=0;
  750. if ( strfind( line , "=" , true ) == -1 ) return valRes;
  751. strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
  752. return valRes;
  753. }
  754.  
  755. public LogIn(playerid)
  756. {
  757. AccountInfo[playerid][aLogged] = 1;
  758. registro[playerid] = 0;
  759. login[playerid] = 0;
  760. return 1;
  761. }
  762.  
  763. public OnPlayerUpdate(playerid)
  764. {
  765. if(!IsPlayerConnected(playerid)) return 0;
  766. if(IsPlayerNPC(playerid)) return 1;
  767.  
  768. // changing cities by inputs
  769. if( !gPlayerHasCitySelected[playerid] &&
  770. GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) {
  771. ClassSel_HandleCitySelection(playerid);
  772. return 1;
  773. }
  774.  
  775. // No weapons in interiors
  776. if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
  777. SetPlayerArmedWeapon(playerid,0); // fists
  778. return 0; // no syncing until they change their weapon
  779. }
  780.  
  781. // Don't allow minigun
  782. if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
  783. Kick(playerid);
  784. return 0;
  785. }
  786.  
  787. /* No jetpacks allowed
  788. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
  789. Kick(playerid);
  790. return 0;
  791. }*/
  792.  
  793. /* For testing animations
  794. new msg[128+1];
  795. new animlib[32+1];
  796. new animname[32+1];
  797.  
  798. thisanimid = GetPlayerAnimationIndex(playerid);
  799. if(lastanimid != thisanimid)
  800. {
  801. GetAnimationName(thisanimid,animlib,32,animname,32);
  802. format(msg, 128, "anim(%d,%d): %s %s", lastanimid, thisanimid, animlib, animname);
  803. lastanimid = thisanimid;
  804. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  805. }*/
  806.  
  807. if(IsPlayerConnected(playerid))
  808. {
  809. if(AccountInfo[playerid][aLogged] == 1)
  810. {
  811. new string3[128];
  812. new playername3[MAX_PLAYER_NAME];
  813. GetPlayerName(playerid, playername3, sizeof(playername3));
  814. format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
  815. new ip[20];
  816. GetPlayerIp(playerid,ip,sizeof(ip));
  817. new File: hFile = fopen(string3, io_write);
  818. if (hFile)
  819. {
  820. new var[128];
  821. format(var, 128, "Senha=%s\n", AccountInfo[playerid][aSenha]);fwrite(hFile, var);
  822. format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
  823. fclose(hFile);
  824. }
  825. }
  826. }
  827. return 1;
  828. }
  829.  
  830. Encrypt(string[])
  831. {
  832. for(new x=0; x < strlen(string); x++)
  833. {
  834. string[x] += (3^x) * (x % 15);
  835. if(string[x] > (0xff))
  836. {
  837. string[x] -= 256;
  838. }
  839. }
  840. }
  841.  
  842. //----------------------------------------------------------
  843.  
  844.  
  845. #include <a_samp>
  846. #include <DOF2>
  847. #include <YSI\y_commands>
  848. #include <YSI\y_va>
  849. #define PLAYER_FILE "Spawn/%s.ini"
  850. #define SPAWN_MODE 1
  851. #define SPAWN_TIME 20//utilize em segundos, no caso 10 = 10 segundos.
  852. #define SPAWN_COMMAND_STYLE 2
  853. #define SPAWN_COMMAND "continuar"
  854. #define SPAWN_DIALOG 1380
  855.  
  856. #if SPAWN_MODE == 2
  857. new
  858. timeCheck[MAX_PLAYERS],
  859. timerCheckSpawn[MAX_PLAYERS],
  860. bool: spawningPlayer[MAX_PLAYERS];
  861. #endif
  862. new
  863. bool: playerConnected[MAX_PLAYERS];
  864.  
  865. forward CheckSpawnPos(playerid);
  866. forward CheckSpawnPosTime(playerid);
  867.  
  868. public OnFilterScriptInit()
  869. {
  870. printf("|------------------------------------------------|");
  871. printf("|-------- Sistema de armas editado por caio --------|");
  872. printf("|------------------------------------------------|");
  873. print("Sistema de salvar dinheiro carregado ....");
  874.  
  875. #if SPAWN_MODE == 2
  876. #if SPAWN_COMMAND_STYLE == 2
  877. Command_AddAltNamed("8b89cef034928dc", SPAWN_COMMAND);
  878. #endif
  879. #endif
  880. return 1;
  881. }
  882.  
  883. public OnFilterScriptExit()
  884. {
  885. printf("|------------------------------------------------|");
  886. printf("|--------- Sistema de salvar armas editado por caio ---------|");
  887. printf("|------------------------------------------------|");
  888. new i, Nome[25], Diretorio[40];
  889.  
  890. for ( i = 0; i < MAX_PLAYERS; ++i ) {
  891.  
  892. if ( IsPlayerConnected(i) ) {
  893.  
  894. GetPlayerName(i, Nome, 25);
  895.  
  896. format (Diretorio, sizeof Diretorio, "Dinheiro/%s.ini", Nome);
  897.  
  898. DOF2_SetInt(Diretorio, "Quantia", GetPlayerMoney(i));
  899. DOF2_SaveFile();
  900. }
  901.  
  902. }
  903. DOF2_Exit();
  904.  
  905. DOF2_Exit();
  906. return 1;
  907. }
  908.  
  909. public OnPlayerConnect(playerid)
  910. {
  911. SendClientMessage(playerid, 0xFF8C00, "Sempre use /capacete ou /cinto");
  912. AlreadyGiveWeapons[playerid] = false;
  913. GameTextForPlayer(playerid,"~w~Play Brasil v2.0",3000,4);
  914. SendClientMessage(playerid,COLOR_WHITE,"Bem vindo ao {88AA88}P{FFFFFF}lay {88AA88}B{FFFFFF}rasil");
  915.  
  916. // class selection init vars
  917. gPlayerCitySelection[playerid] = -1;
  918. gPlayerHasCitySelected[playerid] = 0;
  919. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  920. //Tirar postes no ponto de taxi Começo
  921. RemoveBuildingForPlayer(playerid, 1226, 1774.7578, -1931.3125, 16.3750, 0.25);
  922. RemoveBuildingForPlayer(playerid, 1226, 1806.4297, -1931.6016, 16.3750, 0.25);
  923. RemoveBuildingForPlayer(playerid, 1226, 1774.7578, -1901.5391, 16.3750, 0.25);
  924. RemoveBuildingForPlayer(playerid, 1226, 1806.4297, -1901.8281, 16.3750, 0.25);
  925. //Tirar postes no ponto de taxi Fim
  926.  
  927. //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
  928.  
  929. //Kick(playerid);
  930.  
  931. /*
  932. Removes vending machines
  933. RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
  934. RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
  935. RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
  936. RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
  937. RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
  938. */
  939.  
  940. /*
  941. new ClientVersion[32];
  942. GetPlayerVersion(playerid, ClientVersion, 32);
  943. printf("Player %d reports client version: %s", playerid, ClientVersion);*/
  944.  
  945. new name[MAX_PLAYER_NAME];
  946. GetPlayerName(playerid, name, sizeof(name));
  947. new string[128];
  948. format(string, sizeof(string), ACCOUNTS_FOLDER, name);
  949. if (AccountInfo[playerid][aLogged] == 0)
  950. {
  951. if (!fexist(string))
  952. {
  953. new kayitmsg[256];
  954. format(kayitmsg,256,"Seja Bem Vindo\n\n%s Por favor, se registre!\n\nSenha:",name);
  955. ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",kayitmsg,"Registrar","Sair");
  956. GivePlayerMoney(playerid, 30000);
  957. registro[playerid] = 1;
  958. login[playerid] = 0;
  959. }
  960. else if (fexist(string))
  961. {
  962. new girismsg[256];
  963. format(girismsg,256,"Seja Bem Vindo\n\nNick: %s\n\nSenha:",name);
  964. ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Logar",girismsg,"Logar","Sair");
  965. registro[playerid] = 0;
  966. login[playerid] = 1;
  967. }
  968. }
  969.  
  970. playerConnected[playerid]= true;
  971.  
  972. return 1;
  973. }
  974.  
  975. public OnPlayerSpawn(playerid)
  976. {
  977. SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
  978. if (!AlreadyGiveWeapons[playerid]) SetTimerEx("LoadArmasToFile",250,false,"i",playerid);
  979. new Diretorio[40], Nome[25];
  980.  
  981. GetPlayerName(playerid, Nome, 25);
  982.  
  983. format (Diretorio, sizeof Diretorio, "Dinheiro/%s.ini", Nome);
  984.  
  985. if ( fexist(Diretorio) )
  986. GivePlayerMoney(playerid, DOF2_GetInt(Diretorio, "Quantia"));
  987. else {
  988.  
  989. DOF2_CreateFile(Diretorio);
  990. DOF2_SetInt(Diretorio, "Quantia", 0);
  991. DOF2_SaveFile();
  992. }
  993. if(IsPlayerNPC(playerid))
  994. return true;
  995.  
  996. new randSpawn = 0;
  997.  
  998. SetPlayerInterior(playerid,0);
  999. TogglePlayerClock(playerid,0);
  1000.  
  1001. //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
  1002.  
  1003. SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
  1004. SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200);
  1005. SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200);
  1006. SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200);
  1007. SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
  1008. SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200);
  1009. SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
  1010. SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200);
  1011. SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200);
  1012. SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200);
  1013. SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200);
  1014.  
  1015. GivePlayerWeapon(playerid,WEAPON_COLT45,100);
  1016. //GivePlayerWeapon(playerid,WEAPON_MP5,100);
  1017. TogglePlayerClock(playerid, 0);
  1018. if(playerConnected[playerid])
  1019. {
  1020. new
  1021. playerFileFormatted[62];
  1022.  
  1023. format(playerFileFormatted, 62, PLAYER_FILE, GetPlayerNameEx(playerid));
  1024.  
  1025. if(!DOF2_FileExists(playerFileFormatted))
  1026. return DOF2_CreateFile(playerFileFormatted);
  1027.  
  1028. #if SPAWN_MODE == 1
  1029. return SetTimerEx("CheckSpawnPos", 500, false, "i", playerid);
  1030. #elseif SPAWN_MODE == 2
  1031. timerCheckSpawn[playerid] = SetTimerEx("CheckSpawnPosTime", 1000, true, "i", playerid);
  1032. spawningPlayer[playerid] = true;
  1033. return 1;
  1034. #elseif SPAWN_MODE == 3
  1035. ShowDialog(playerid, SPAWN_DIALOG);
  1036. #endif
  1037.  
  1038. playerConnected[playerid] = false;
  1039. }
  1040.  
  1041. return 1;
  1042. }
  1043. #if SPAWN_MODE == 2
  1044. #if SPAWN_COMMAND_STYLE == 1
  1045. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  1046. if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
  1047. if(spawningPlayer[playerid]) {
  1048. BreakLine(playerid);
  1049. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Enviado à última posição salva.");
  1050. KillTimer(timerCheckSpawn[playerid]);
  1051. spawningPlayer[playerid] = false;
  1052. return CheckSpawnPos(playerid);
  1053. }
  1054. return 1;
  1055. }
  1056. #endif
  1057. #elseif SPAWN_MODE == 3
  1058. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1059. {
  1060. switch(dialogid)
  1061. {
  1062. case SPAWN_DIALOG:
  1063. {
  1064. if(!response)
  1065. return 1;
  1066.  
  1067. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Enviado à última posição salva.");
  1068. CheckSpawnPos(playerid);
  1069. return 1;
  1070. }
  1071. }
  1072. return 0;
  1073. }
  1074. #endif
  1075.  
  1076. public OnPlayerDisconnect(playerid)
  1077. {
  1078. SaveWeaponsToFile(playerid);
  1079. new Diretorio[40], Nome[25];
  1080.  
  1081. GetPlayerName(playerid, Nome, 25);
  1082.  
  1083. format (Diretorio, sizeof Diretorio, "Dinheiro/%s.ini", Nome);
  1084. DOF2_SetInt(Diretorio, "Quantia", GetPlayerMoney(playerid) );
  1085. DOF2_SaveFile();
  1086. OnPlayerUpdate(playerid);
  1087. AccountInfo[playerid][aLogged] = 0;
  1088. registro[playerid] = 0;
  1089. login[playerid] = 0;
  1090. new
  1091. Float: flo_player_pos[3],
  1092. Float: flo_player_fa,
  1093. int_player_int = GetPlayerInterior(playerid),
  1094. playerFileFormatted[62];
  1095.  
  1096. GetPlayerPos(playerid, flo_player_pos[0], flo_player_pos[1], flo_player_pos[2]);
  1097. GetPlayerFacingAngle(playerid, flo_player_fa);
  1098.  
  1099. format(playerFileFormatted, 62, PLAYER_FILE, GetPlayerNameEx(playerid));
  1100.  
  1101. if(!DOF2_FileExists(playerFileFormatted))
  1102. DOF2_CreateFile(playerFileFormatted);
  1103.  
  1104. DOF2_SetFloat(playerFileFormatted, "Last Pos X", flo_player_pos[0]);
  1105. DOF2_SetFloat(playerFileFormatted, "Last Pos Y", flo_player_pos[1]);
  1106. DOF2_SetFloat(playerFileFormatted, "Last Pos Z", flo_player_pos[2]);
  1107. DOF2_SetFloat(playerFileFormatted, "Last Pos FA", flo_player_fa);
  1108. DOF2_SetInt(playerFileFormatted, "Last Int", int_player_int);
  1109.  
  1110. DOF2_SaveFile();
  1111.  
  1112. return 1;
  1113. }
  1114.  
  1115. public CheckSpawnPos(playerid)
  1116. {
  1117. new
  1118. Float: oldPlayerPos[3],
  1119. Float: oldPlayerPosFA,
  1120. oldPlayerPosInt,
  1121. playerFileFormatted[62];
  1122.  
  1123. playerConnected[playerid] = false;
  1124.  
  1125. format(playerFileFormatted, 62, PLAYER_FILE, GetPlayerNameEx(playerid));
  1126.  
  1127. oldPlayerPos[0] = DOF2_GetFloat(playerFileFormatted, "Last Pos X");
  1128. oldPlayerPos[1] = DOF2_GetFloat(playerFileFormatted, "Last Pos Y");
  1129. oldPlayerPos[2] = DOF2_GetFloat(playerFileFormatted, "Last Pos Z");
  1130. oldPlayerPosFA = DOF2_GetFloat(playerFileFormatted, "Last Pos FA");
  1131. oldPlayerPosInt = DOF2_GetInt(playerFileFormatted, "Last Int");
  1132.  
  1133. SetPlayerPos(playerid, oldPlayerPos[0], oldPlayerPos[1], oldPlayerPos[2]);
  1134. SetPlayerFacingAngle(playerid, oldPlayerPosFA);
  1135. SetPlayerInterior(playerid, oldPlayerPosInt);
  1136.  
  1137. return 1;
  1138. }
  1139.  
  1140. #if SPAWN_MODE == 2
  1141. public CheckSpawnPosTime(playerid)
  1142. {
  1143. timeCheck[playerid]++;
  1144.  
  1145. if (timeCheck[playerid] == 1)
  1146. {
  1147. #if SPAWN_COMMAND_STYLE == 1
  1148. va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para apertar a tecla {64DCFF}Y {FFFFFF}e continuar aonde", SPAWN_TIME);
  1149. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
  1150. #elseif SPAWN_COMMAND_STYLE == 2
  1151. va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para digitar o comando {64DCFF}/%s {FFFFFF}e continuar aonde", SPAWN_TIME, SPAWN_COMMAND);
  1152. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
  1153. #endif
  1154. }
  1155. else if (timeCheck[playerid] == SPAWN_TIME/2)
  1156. {
  1157. #if SPAWN_COMMAND_STYLE == 1
  1158. BreakLine(playerid);
  1159. va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para apertar a tecla {64DCFF}Y {FFFFFF}e continuar aonde", SPAWN_TIME/2);
  1160. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
  1161. #elseif SPAWN_COMMAND_STYLE == 2
  1162. BreakLine(playerid);
  1163. va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para digitar o comando {64DCFF}/%s {FFFFFF}e continuar aonde", SPAWN_TIME/2, SPAWN_COMMAND);
  1164. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
  1165. #endif
  1166. }
  1167. else if (timeCheck[playerid] == SPAWN_TIME)
  1168. {
  1169. BreakLine(playerid);
  1170. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}O tempo acabou e você vai continuar aonde está.");
  1171. timeCheck[playerid] = 0;
  1172. spawningPlayer[playerid] = false;
  1173. KillTimer(timerCheckSpawn[playerid]);
  1174. return 1;
  1175. }
  1176.  
  1177. return 1;
  1178. }
  1179. #endif
  1180.  
  1181. #if SPAWN_MODE == 2
  1182. #if SPAWN_COMMAND_STYLE == 2
  1183. YCMD:8b89cef034928dc(playerid, params[], help)
  1184. {
  1185. if(!spawningPlayer[playerid])
  1186. return 0;
  1187.  
  1188. BreakLine(playerid);
  1189. SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Enviado à última posição salva.");
  1190. KillTimer(timerCheckSpawn[playerid]);
  1191. spawningPlayer[playerid] = false;
  1192. return CheckSpawnPos(playerid);
  1193. }
  1194. #endif
  1195. #elseif SPAWN_MODE == 3
  1196. ShowDialog(playerid, dialogid)
  1197. {
  1198. switch(dialogid)
  1199. {
  1200. case SPAWN_DIALOG:
  1201. {
  1202. new
  1203. formatMsg[128];
  1204.  
  1205. BreakLine(playerid);
  1206. format(formatMsg, sizeof formatMsg, "{FFFFFF}Olá {64DCFF}%s{FFFFFF}, gostaria de continuar de onde você parou na sua última sessão?", GetPlayerNameEx(playerid));
  1207. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Spawn...", formatMsg, "Sim", "Não");
  1208.  
  1209. return 1;
  1210. }
  1211. }
  1212. return 1;
  1213. }
  1214. #endif
  1215.  
  1216. GetPlayerNameEx(playerid)
  1217. {
  1218. new
  1219. playerName[MAX_PLAYER_NAME];
  1220.  
  1221. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1222.  
  1223. return playerName;
  1224. }
  1225.  
  1226. BreakLine(playerid) {
  1227. return SendClientMessage(playerid, -1, " ");
  1228. }
  1229.  
  1230.  
  1231. //----------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement