Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.58 KB | None | 0 0
  1. //======================================[ INCLUDE ]====================================||
  2. #include a_samp
  3. #include DOF2
  4. #include zcmd
  5. #include sscanf2
  6. #include sii
  7. //======================================[ DEFINE ]====================================||
  8. #undef MAX_PLAYERS
  9. #define MAX_PLAYERS 50
  10. #define Controle TogglePlayerControllable
  11. #define DarMoney(%0,%1) ResetPlayerMoney(%0) && GivePlayerMoney(%0,%1)
  12. #define VDaOrg(%0,%1,%2) GetPlayerVehicleID(playerid) >= %0[%1] && GetPlayerVehicleID(playerid) <= %0[%2]
  13. //======================================[ DIALOG ]====================================||
  14. #define DIALOG_REGISTER 0
  15. #define DIALOG_LOGIN 1
  16. #pragma tabsize 0
  17.  
  18.  
  19. // CORES
  20. #define COLOR_RG 0xA8F0F4FF
  21. #define Color_Admin 0xFF80FFFF
  22. #define COR_PM 0x8470FFFF //0x5C3CE8F6
  23. #define COR_BOPE 0x19197096
  24. #define COR_BOPE2 0x408080FF
  25. #define COR_SWAT 0x7D03FFFF
  26. #define COR_EXE 0x00660CF6
  27. #define COR_Medicos 0xFF8282FF
  28. #define COR_AZULZAO 0x005FFFFF
  29. #define ROXO 0xC2A2DAAA
  30. #define COR_CINZA1 0xB4B5B7FF
  31. #define RED1 0xE60000FF
  32. #define GREEN1 0x21DD00FF
  33. #define COR_AZTECAS 0x2641FEAA
  34. #define COR_BOP 0x330099AA
  35. #define COR_Rifa 0xC599C8AA
  36. #define COR_BOMBEIROS 0xF05353AA //0xFF0000FF
  37. #define COR_PRE 0x6699FFFF
  38. #define COR_HITMAN 0x696969FF //0xB4B5B7FF
  39. #define COR_REPORTER 0xFF9900FF
  40. #define COR_TAXI 0x33FFFFFF //0xEE4000AA
  41. #define COR_PF 0x91766296
  42. #define COR_PRp 0x996600FF
  43. #define COR_YAK 0x00483AF6
  44. #define COLOR_BARZ 0x00483AAA
  45. #define COLOR_RIFA 0xFBC63FAA //0xF09F50AA
  46. #define COR_GRO 0x33FF00FF
  47. #define COR_FARC 0x676767FF
  48. #define COR_PC 0x666699FF
  49. #define COR_BALLAS 0x9900CCFF
  50. #define COR_VAGOS 0xFFFF00FF
  51. #define COR_CVSF 0xB60000AA
  52. #define COR_PR 0xF09F50FF
  53. #define COR_HELPER 0x55F6ACFF
  54. #define CORGZ_COPS 0x5B88ACAA
  55. #define COR_TRIADS 0xB0DDF3FF //0xBCD2EEFF antiga cor by info
  56. #define COR_GI 0x33CCFFAA
  57. #define COR_GIC 0xFE005DFF
  58. #define COR_WHITE 0xFFF8F8AA
  59. #define VERDE2 0x33FF00FF
  60. #define COLOR_CORLEONE 0xFF6200AA
  61. #define COLOR_VERDE2 0x33FF00FF
  62. #define COLOR_DEPTH 0x993333FF
  63. #define COR_ADMIN -10043754
  64. #define COLOR_ADMIN 0xF64CCAFF
  65. #define COR_PCC 0x9ACD32AA
  66. #define COR_CRIPS 0xFFFF99AA
  67. #define COR_MERCENARIOS 0xFF333365
  68. #define COR_TALIBAN 0xFF1493AA
  69. #define COR_COSANOSTRA 0x33FFFFAA
  70. #define COLOR_WHITE 0xFFFFFFFF
  71. #define COR_MAYAN 0x8B2252AA
  72. #define COLOR_CHAT_PCC 0x9ACD32FF
  73. #define LARANJA 0xFF6600AA
  74. #define VERDECLARO 0x00FF0CAA
  75. #define COLOR_ALIANCA 0xA9A9A9FF
  76. #define VERDEFRACO 0x80cf80AA
  77. #define COLOR_AMARELOR 0xFFFF00AA
  78. #define VERDEFRACOR 0x80cf80AA
  79. #define COR_3DLABEL 0x0FFFC8FF
  80. #define COLOR_AZULBB 0xE6D4D1FF
  81. #define TEAM_CYAN_COLOR 0xA92BF6F6
  82. #define TEAM_CYAN_COLOR2 0xFF8282AA
  83. #define GCOP_COLOR 0x6666FFC8
  84. #define COLOR_LIGHTRED 0xFF6347AA
  85. #define COLORGZ_BARZINI 0x006699C8
  86. #define COLORGZ_PF 0x000000C8
  87. #define COLOR_GREEN 0x33AA33AA
  88. #define COLOR_PURPLE 0xC2A2DAAA
  89. #define TEAM_GROVE_COLOR 0x00D900AA
  90. #define TEAM_BALLAS_COLOR 0x9900FFAA
  91. #define TEAM_AZTECAS_COLOR 0x2641FEAA
  92. #define COLOR_GRAD1 0xB4B5B7FF
  93. #define COLOR_GRAD2 0xBFC0C2FF
  94. #define COLOR_GRAD3 0xBFC0C2FF
  95. #define COLOR_GRAD4 0xD8D8D8FF
  96. #define COLOR_GRAD5 0xF0F0F0FF
  97. #define COLOR_GRAD6 0xF0F0F0FF
  98. #define COLOR_LIGHTBLUE 0x33CCFFAA
  99. #define COLOR_DBLUE 0x2641FEAA
  100. #define COLOR_SAMP 0xACCBF1FF
  101. #define COLOR_YELLOW 0xFFFF00FF
  102. #define COLOR_YELLOWF 0xFFFF00FF
  103. #define COLOR_GREY 0xAFAFAFAA
  104. #define COLOR_RED 0xAA3333AA
  105. #define COLOR_LIGHTGREEN 0x9ACD32AA
  106. #define TEAM_VAGOS_COLOR 0xFFC801AA
  107. #define CINZA 0xAFAFAFAA
  108. #define PRETO 0x000000FF
  109. #define COLOR_FADE4 0x8C8C8C8C
  110. #define COLOR_FADE5 0x6E6E6E6E
  111. #define COLOR_FADE3 0xAAAAAAAA
  112. #define COLOR_RCARRO 0x80FF8096
  113. #define TEAM_HIT_COLOR 0xFFFFFF00
  114. #define CINZA2 0xBFC0C2FF
  115. #define COLOR_FADE2 0xC8C8C8C8
  116. #define COLOR_NEWS 0xFFA500AA
  117. #define COLOR_NEWS 0xFFA500AA
  118. #define COLOR_ALLDEPT 0xFF8282AA
  119. #define COLOR_FADE1 0xE6E6E6E6
  120. #define COLOR_R 0x6666CCFF
  121. #define COLORGZ_ALCAIDA 0x10100FAA
  122. #define COLOR_MSG 0x934FF6F6
  123. #define COLORGZ_Rifa 0xC599C8AA
  124. #define COLORGZ_GI 0x00ECF6AA
  125. #define AZUL3 0x33CCFFAA
  126. #define CINZA1 0xB4B5B7FF
  127. #define AN_COLOR 0x00E7C6F6
  128. #define COLOR_YELLOW2 0xF5DEB3AA
  129. #define COLOR_TAXISTA 0xF68E00F6
  130. #define TEAM_BLUE_COLOR 0x8D8DFF00
  131. #define COLORGZ_LH 0x00E7C6C8
  132. #define COLORGZ_EXE 0x33AA33C8
  133. #define COLOR_EXE 0x33AA33C8
  134. // GANGZONES
  135. new GZhospital1;
  136. // NEWS
  137. new Text:textmorte[2];
  138. new MEGAString[2500];
  139. new Texto[256]; //Lembrando, é uma variável global, não deve ser posta dentro de qualquer estrutura que use chaves.
  140.  
  141.  
  142. // /chatkill
  143. new bool:ChatKill[MAX_PLAYERS];
  144. stock SendDeathMessageBPW(killerid,playerid,reason)
  145. {
  146. foreach(Player, i){
  147.  
  148. if(ChatKill[i]){
  149.  
  150. SendDeathMessageToPlayer(i, killerid,playerid,reason);
  151. }
  152. }
  153. }
  154. #define SendDeathMessage SendDeathMessageBPW
  155.  
  156. stock ResetVars(playerid)
  157. {
  158. ChatKill[playerid] = false;
  159. return true;
  160. }
  161.  
  162.  
  163.  
  164. //======================================[ Start ]======================================||
  165. main(){}
  166.  
  167. enum Info
  168. {
  169. Membro, //Identifica de que organização o player é membro. 0 para civil.
  170. Cargo, //Identifica qual o cargo do player. 10 para líder.
  171. };
  172. new ProgressaoInfo[MAX_PLAYERS][Info]; //Utilizaremos essa variável com arrays em conjunto com o enum
  173.  
  174. enum pInfo
  175. {
  176. pAdmin,
  177. pSkin,
  178. pScore,
  179. pMoney,
  180. Float:pPosX,
  181. Float:pPosY,
  182. Float:pPosZ,
  183. Float:pPosA,
  184. pInterior,
  185. pVW,
  186. bool:pLogado
  187. }
  188.  
  189. new
  190. Player[MAX_PLAYERS][pInfo],reset[pInfo],
  191. Conta[256]
  192. ;
  193.  
  194. new Nomeorgs[5][128] = //[5] representa o numero de linhas iniciando do 0 e [128] o numero de caracters máximo de cada string.
  195. {
  196. "Civil", //Org [0]: Como dito no enum, a org 0 é civil, não é propriamente uma org mas é necessário ter pois o player será automaticamente membro da org 0 caso não definido.
  197. "Assassinos", //Org [1]: Assassinos por contrato, Hitmans.
  198. "Aeronautica", //Org [2]: Aeronautica, controle aéreo.
  199. "Drifters", //Org [3]: Drifters, corredores de derrapagem.
  200. "Policial Federal" //Org [4]: Policiais Federais, casos de escala nacional.
  201. };
  202.  
  203. const C_Civil = 0xFFFFFFFF; //Cor dos civis, branco.
  204. const C_Assassinos = 0x000000FF; //Cor dos assassinos, preto.
  205. const C_Aeronautica = 0x1E90FF99; //Cor da aeronautica, azul.
  206. const C_Drifters = 0x1E90AA99; //Cor dos drifters, verde.
  207. const C_PFederal = 0x6C7B8BFF; //Cor da Policia Federal, azul escuro.
  208.  
  209. new VCivil[3]; //Os Civis tem 3 veículos
  210. new VAssassinos[5]; //Os Assassinos tem 5 veículos.
  211. new VAeronautica[7]; //A Aeronautica tem 7 veículos.
  212. new VDrifters[4]; //Os Drifters tem 4 veículos.
  213. new VPFederal[6]; //A Policia Federal tem 6 veículos.
  214. //=====================================[ CALLBACKS ]====================================||
  215. public OnGameModeInit()
  216. {
  217. print("\n ====================================================================");
  218. print(" | |");
  219. print(" | GameMode Base DOF2 Version 1.5 Started... |");
  220. print(" | |");
  221. print(" | * By KinG7. * |");
  222. print(" | |");
  223. print(" ====================================================================\n");
  224. SetGameModeText("by KinG7");
  225. DisableInteriorEnterExits();
  226. UsePlayerPedAnims();
  227. ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
  228. ShowNameTags(1);
  229. SetNameTagDrawDistance(100.0);
  230.  
  231. // GANGZONES
  232. GZhospital1 = GangZoneCreate(1249.3438,-1288.7474, 1069.0786,-1387.2887);
  233.  
  234. // TEXTDRAW
  235.  
  236.  
  237. textmorte[0] = TextDrawCreate(655.000000, 0.000000, "_");
  238. TextDrawBackgroundColor(textmorte[0], 255);
  239. TextDrawFont(textmorte[0], 1);
  240. TextDrawLetterSize(textmorte[0], 0.500000, 49.600021);
  241. TextDrawColor(textmorte[0], -1);
  242. TextDrawSetOutline(textmorte[0], 0);
  243. TextDrawSetProportional(textmorte[0], 1);
  244. TextDrawSetShadow(textmorte[0], 1);
  245. TextDrawUseBox(textmorte[0], 1);
  246. TextDrawBoxColor(textmorte[0], 180);
  247. TextDrawTextSize(textmorte[0], -10.000000, 0.000000);
  248. TextDrawSetSelectable(textmorte[0], 0);
  249.  
  250. textmorte[1] = TextDrawCreate(140.000000, 205.000000, "voce morreu");
  251. TextDrawBackgroundColor(textmorte[1], 255);
  252. TextDrawFont(textmorte[1], 3);
  253. TextDrawLetterSize(textmorte[1], 1.550000, 4.800002);
  254. TextDrawColor(textmorte[1], -16776961);
  255. TextDrawSetOutline(textmorte[1], 1);
  256. TextDrawSetProportional(textmorte[1], 1);
  257. TextDrawSetSelectable(textmorte[1], 0);
  258.  
  259. // CARROS
  260.  
  261. //**********************************[ Veículos Civis]*************************************************
  262. VCivil[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  263. VCivil[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  264. VCivil[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  265.  
  266. //******************************[ Veículos dos Assassinos]*************************************************
  267. VAssassinos[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  268. VAssassinos[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  269. VAssassinos[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  270. //E assim vai até criar todos os veículos pra completar as arrays da variável.
  271.  
  272. //******************************[ Veículos da Aeronautica]*************************************************
  273. VAeronautica[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  274. VAeronautica[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  275. VAeronautica[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  276. //E assim vai até criar todos os veículos pra completar as arrays da variável.
  277.  
  278. //******************************[ Veículos dos Drifters]*************************************************
  279. VDrifters[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  280. VDrifters[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  281. VDrifters[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  282. //E assim vai até criar todos os veículos pra completar as arrays da variável.
  283.  
  284. //***************************[ Veículos da Policia Federal]**********************************************
  285. VPFederal[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  286. VPFederal[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  287. VPFederal[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
  288. //E assim vai até criar todos os veículos pra completar as arrays da variável.
  289.  
  290. //============ Carros extras
  291. AddStaticVehicleEx(400,2293.6978,-1671.7883,14.7966,359.0262,-1,-1,-1); //
  292. AddStaticVehicleEx(401,2568.5051,-1724.2327,13.3263,89.8617,-1,-1,-1); // 2
  293. AddStaticVehicleEx(402,1857.4216,-1759.2261,13.3784,90.4204,-1,-1,-1); // 3
  294. AddStaticVehicleEx(403,1820.8308,-1467.8524,14.1557,269.8344,-1,-1,-1); // 4
  295. AddStaticVehicleEx(404,1755.3098,-1344.1333,15.4895,268.9281,-1,-1,-1);// 5
  296. AddStaticVehicleEx(405,1958.3906,-1333.3604,22.6108,270.2152,-1,-1,-1); // 6
  297. AddStaticVehicleEx(412,1081.9503,-1703.7773,13.3845,270.0951,-1,-1,-1); // 7
  298. AddStaticVehicleEx(415,1381.1915,-1848.0261,13.3185,178.8771,-1,-1,-1); // 8
  299. AddStaticVehicleEx(419,1745.2642,-1860.0833,13.2886,270.6426,-1,-1,-1); // 9
  300. AddStaticVehicleEx(421,1867.1594,-1036.5278,23.7917,242.8647,-1,-1,-1); // 10
  301. AddStaticVehicleEx(429,2740.9465,-1143.8796,44.9619,271.0641,-1,-1,-1); // 11
  302. AddStaticVehicleEx(434,2790.1929,-1883.4969,11.0383,89.0240,-1,-1,-1); // 12
  303. AddStaticVehicleEx(439,-2843.5898,387.3704,4.3959,0.8420,-1,-1,-1); // 13
  304. AddStaticVehicleEx(442,925.1368,-1122.3147,23.8355,359.8628,0,0,80); // 14 cemiterio
  305. AddStaticVehicleEx(442,936.0014,-1122.5574,23.8264,359.5724,0,0,80); // 15 cemiterio
  306. AddStaticVehicleEx(443,-2217.4207,-258.7235,36.1471,180.6103,-1,-1,-1); // 16
  307. AddStaticVehicleEx(458,-2103.2908,-560.2798,32.1236,231.4280,-1,-1,-1); // 17
  308. AddStaticVehicleEx(466,-1461.6459,-567.2202,13.8901,200.7890,-1,-1,-1); // 18
  309. AddStaticVehicleEx(513,-1461.0604,-521.4478,14.8829,205.9236,-1,-1,-1); // 19
  310. AddStaticVehicleEx(593,-1433.8032,-507.8747,14.9001,208.0814,-1,-1,-1); // 20
  311. AddStaticVehicleEx(500,-1317.9556,-495.7501,14.2491,29.0032,-1,-1,-1); // 21
  312. AddStaticVehicleEx(504,-1287.7189,-313.0418,13.9409,201.9427,-1,-1,-1); // 22
  313. AddStaticVehicleEx(566,2657.2393,-1691.9628,9.0937,269.5798,13,13,-1); // carro 13
  314. AddStaticVehicleEx(578,2792.8848,-1673.7758,10.5196,179.8651,1,1,-1); // carro 14
  315. AddStaticVehicleEx(560,1400.5226,-2262.8608,13.2517,358.3562,3,3,-1); // carro aero
  316. AddStaticVehicleEx(475,1552.7026,-2361.6294,13.3589,358.4216,9,39,-1); // carro aero
  317. AddStaticVehicleEx(526,1385.0472,-2347.6960,13.3057,358.8528,5,5,-1); // carro aero
  318. AddStaticVehicleEx(418,1838.0145,-1871.1613,13.4829,359.4306,7,7,-1); // carro 2
  319. AddStaticVehicleEx(405,1564.19995117,-1445.69995117,13.39999962,89.99993896,0,0,-1); //Sentinel
  320. AddStaticVehicleEx(560,1388.3287,-1454.3060,13.2515,342.0545,0,0,-1); // carro extra
  321. AddStaticVehicleEx(526,1425.0472,-1143.3719,23.6817,178.8585,182,182,-1); // ao lado da zip perto do banco
  322. //Trem
  323. AddStaticVehicleEx(538,1698.0930,-1953.8319,13.5469,0.0,0,0,256);
  324.  
  325.  
  326. return 1;
  327. }
  328.  
  329. public OnGameModeExit()
  330. {
  331. DOF2_Exit();
  332. return 1;
  333. }
  334.  
  335. public OnPlayerRequestClass(playerid, classid)
  336. {
  337. IsPlayerLogged(playerid);
  338. return false;
  339. }
  340.  
  341. public OnPlayerRequestSpawn(playerid) return IsPlayerLogged(playerid);
  342.  
  343. IsPlayerLogged(playerid)
  344. {
  345. if(Player[playerid][pLogado] == true)
  346. {
  347. SetSpawnInfo(playerid,-1,Player[playerid][pSkin],Player[playerid][pPosX],Player[playerid][pPosY],Player[playerid][pPosZ],Player[playerid][pPosA],0,0,0,0,0,0);
  348. SpawnPlayer(playerid);
  349. SetPlayerInterior(playerid, 0);
  350. SetCameraBehindPlayer(playerid);
  351. }
  352. return 1;
  353. }
  354.  
  355. public OnPlayerDeath(playerid, killerid, reason)
  356. {
  357. TextDrawShowForPlayer(playerid, textmorte[0]);
  358. TextDrawShowForPlayer(playerid, textmorte[1]);
  359. //hospital
  360. Player[playerid][pPosX]=2034.1435;
  361. Player[playerid][pPosY]=-1402.1190;
  362. Player[playerid][pPosZ]=16.6299;
  363. Player[playerid][pPosA]=90.0;
  364. return 1;
  365. }
  366.  
  367. public OnPlayerText(playerid, text[]) {
  368. if(Player[playerid][pLogado] == false) return SendClientMessage(playerid,-1,"[ERRO] Você não está logado!"),false;
  369. new i, Float:Pos[3], str[128], Nome[MAX_PLAYER_NAME];
  370. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  371. GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
  372.  
  373. format (str, 128, "%s diz: %s", Nome, text);
  374.  
  375. for ( i = 0; i < MAX_PLAYERS; ++i) {
  376.  
  377. if ( IsPlayerConnected(i) && IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]) ) {
  378.  
  379. SendClientMessage(i, -1, str);
  380. }
  381. }
  382. return 0;
  383. }
  384.  
  385. public OnPlayerConnect(playerid)
  386. {
  387. GangZoneShowForPlayer(playerid, GZhospital1, 0x00FFFFFF);
  388. Player[playerid][pLogado]=false;
  389.  
  390. //=================================[ LOGIN/REGISTRO ]===============================||
  391. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  392. if(!DOF2_FileExists(Conta))
  393. {
  394. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Escreva uma senha, para se registrar!", "Registrar", "Sair");
  395. }
  396. else
  397. {
  398. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN", "Bem vindo ! \nEscreva uma senha abaixo para entrar em sua conta.", "Entrar", "Sair");
  399. }
  400. //==================================================================================|
  401. new nome[MAX_PLAYER_NAME];
  402. GetPlayerName(playerid, nome, sizeof(nome));
  403. format(Texto, 35, "Jogadores/%s", nome); //Formatará na variável Texto o caminho onde fica o arquivo com os dados do player.
  404. if(fexist(Texto)) //Verificará se o arquivo existe, caso exista executará o que vem entre as chaves abaixo.
  405. {
  406. INI_Open(Texto); //É necessário abrir o arquivo antes de tudo.
  407. ProgressaoInfo[playerid][Membro] = INI_ReadInt("Organização");
  408. ProgressaoInfo[playerid][Cargo] = INI_ReadInt("Cargo");
  409. INI_Close(); //É necessário apenas fechar o arquivo sem salvar, pois nada foi modificado nele.
  410. }
  411. return 1;
  412. }
  413.  
  414. stock SalvarPlayer(playerid)
  415. {
  416. new nome[MAX_PLAYER_NAME];
  417. GetPlayerName(playerid, nome, sizeof(nome));
  418. format(Texto, 35, "Jogadores/%s", nome); //Formatará na variável Texto o caminho onde ficará o arquivo com os dados do player.
  419. INI_Open(Texto); //Abrirá o arquivo para escrever as informações, caso não exista, ele criará automaticamente.
  420. INI_WriteInt("Organização", ProgressaoInfo[playerid][Membro]); //Setará na TAG Organização o valor inteiro da variável Membro do playerid(No caso o ID da org dele).
  421. INI_WriteInt("Cargo", ProgressaoInfo[playerid][Cargo]); //Setará na TAG Cargo o valor inteiro da variável Cargo do playerid(No caso, o cargo dele na org).
  422. INI_Save(); //Salvar é necessário, caso não salve, não verá nada escrito no arquivo.
  423. INI_Close(); //Também é necessário Fechar oa rquivo aberto.
  424. return true;
  425. }
  426.  
  427. public OnPlayerDisconnect(playerid, reason)
  428. {
  429. SalvarConta(playerid);
  430. SalvarPlayer(playerid);
  431.  
  432. //reset in variable's
  433. Player[playerid] = reset;
  434. return 1;
  435. }
  436.  
  437. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  438. {
  439. //=================================[ DIALOG_REGISTER ]==============================||
  440. if(dialogid == DIALOG_REGISTER)
  441. {
  442. if(!response) return Kick(playerid);
  443. if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Escreva uma senha, para se registrar!", "registrar", "sair");
  444. if(response)
  445. {
  446. if(strlen(inputtext))
  447. {
  448. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  449. DOF2_CreateFile(Conta);
  450. DOF2_SetString(Conta, "Password", inputtext);
  451. DOF2_SaveFile();
  452.  
  453. CriarConta(playerid);
  454. CarregarConta(playerid);
  455. }
  456. else ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Escreva uma senha, para se registrar!", "registrar", "Sair");
  457. }
  458. return 1;
  459. }
  460. //=================================[ DIALOGO LOGIN ]==============================||
  461. if(dialogid == DIALOG_LOGIN)
  462. {
  463. if(!response) return Kick(playerid);
  464. if(response)
  465. {
  466. if(!strlen(inputtext))
  467. {
  468. return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "LOGIN", "Bem vindo ! \nEscreva uma senha abaixo para entrar em sua conta.","entrar", "sair");
  469. }
  470. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  471. if(strcmp(inputtext, DOF2_GetString(Conta, "Password"), true))
  472. {
  473. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "LOGIN", "Bem vindo ! \nEscreva uma senha abaixo para entrar em sua conta.","entrar", "sair");
  474. SendClientMessage(playerid, -1, "[ SERVER ] a senha está errada!");
  475. }
  476. else //se acertar a senha
  477. {
  478. CarregarConta(playerid);
  479. }
  480. }
  481. return 1;
  482. }
  483. return 1;
  484. }
  485.  
  486. // DIALOG ORGANIZAÇÃO
  487. if(dialogid == 100 && response) //100 é o ID do dialog que usamos no ShowPlayerDialog do comando /convidar. Response é a resposta ao primeiro botão do dialog, no caso, "Sim".
  488. {
  489. ProgressaoInfo[playerid][Membro] = GetPVarInt(playerid, "OrgConvidado"); //Setaremos a org do player = a org setada no PVar dele, que é a mesma do player que o convidou.
  490. ProgressaoInfo[playerid][Cargo] = 1; //Setaremos o cargo do player para 1 afinal ele acabou de entrar na nova organização.
  491. DeletePVar(playerid, "OrgConvidado"); //Deletaremos a PVar que usamos no comando /convidar.
  492. return true;
  493. }
  494. return true;
  495. }
  496.  
  497. public OnPlayerSpawn(playerid)
  498. {
  499. SetPlayerSkin(playerid, Player[playerid][pSkin]);
  500. DarMoney(playerid,Player[playerid][pMoney]);
  501. TogglePlayerControllable(playerid,true);
  502. TextDrawHideForPlayer(playerid, textmorte[0]);
  503. TextDrawHideForPlayer(playerid, textmorte[1]);
  504.  
  505. return 1;
  506. }
  507.  
  508. public OnPlayerStateChange(playerid, newstate, oldstate) //Verificará a mudança de estado do player
  509. {
  510. if(newstate == PLAYER_STATE_DRIVER) //O novo estado do player é de motorista.
  511. {
  512. if(VDaOrg(VCivil,0,2)) SendClientMessage(playerid, C_Civil, "Você entrou em um veículo Civil");
  513. if(VDaOrg(VAssassinos,0,4) && ProgressaoInfo[playerid][Membro] != 2) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Assassinos, "Você não é um Assassino");
  514. if(VDaOrg(VAeronautica,0,6) && ProgressaoInfo[playerid][Membro] != 3) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Aeronautica, "Você não é da Aeronautica");
  515. if(VDaOrg(VDrifters,0,3) && ProgressaoInfo[playerid][Membro] != 4) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Drifters, "Você não é um Drifter");
  516. if(VDaOrg(VPFederal,0,5) && ProgressaoInfo[playerid][Membro] != 5) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_PFederal, "Você não é um Policial Federal");
  517. }
  518. return true;
  519. }
  520.  
  521. //=============================[Comandos]==============================================||
  522. cmd(membros, playerid, params[])
  523. {
  524. #pragma unused params //Não estamos usando parametros no comando, por isso o pragma.
  525. new corda[70];
  526. for(new i, PP = GetMaxPlayers(); i < PP; i++)
  527. {
  528. if(!IsPlayerConnected(PP)) continue; //Caso o player não esteja conectado ele dará continuidade no loop
  529. if(ProgressaoInfo[i][Membro] == ProgressaoInfo[playerid][Membro]) //Caso a org do player [i] for igual a org do player [playerid] Executará o que vem abaixo.
  530. {
  531. new nome[MAX_PLAYER_NAME]; //Criará a variável que acumulará o nome do player membro da org.
  532. GetPlayerName(playerid, nome, sizeof(nome)); //Pegará o nome do player membro da org pra acumular na variável acima.
  533. format(corda, sizeof(corda), "%s membro da org %s cargo %d\n", nome, Orgnome[ProgressaoInfo[i][Membro]], ProgressaoInfo[i][Cargo]); //Formatará a string corda com o nome, cargo e nome da org pertencente.
  534. strcat(Texto, corda, 70);
  535. }
  536. }
  537. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Lista de membros online", Texto, "OK", ""); //Mostratá ao player o dialog com a lista de membros.
  538. strdel(Texto, 0, sizeof(Texto)); //Deletará os dados da string pra que ela possa ser reutilizada e evitando um 'bug' que repete as mensagens.
  539. return true;
  540. }
  541.  
  542. cmd(equipar, playerid, params[])
  543. {
  544. #pragma unused params //Não estamos usando parametros no comando, por isso o pragma.
  545. if(ProgressaoInfo[playerid][Membro] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 1 = Assassinos
  546. {
  547. ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
  548. GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
  549. GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
  550. GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
  551. SendClientMessage(playerid, C_Assassinos, "Você foi equipado");
  552. return true;
  553. }
  554. else if(ProgressaoInfo[playerid][Membro] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 2 = Aeronautica
  555. {
  556. ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
  557. GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
  558. GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
  559. GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
  560. SendClientMessage(playerid, C_Aeronautica, "Você foi equipado");
  561. return true;
  562. }
  563. else if(ProgressaoInfo[playerid][Membro] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 3 = Drifters
  564. {
  565. ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
  566. GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
  567. GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
  568. GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
  569. SendClientMessage(playerid, C_Drifters, "Você foi equipado");
  570. return true;
  571. }
  572. else if(ProgressaoInfo[playerid][Membro] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 4 = Policia Federal
  573. {
  574. ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
  575. GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
  576. GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
  577. GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
  578. SendClientMessage(playerid, C_PFederal, "Você foi equipado");
  579. return true;
  580. }
  581. return true;
  582. }
  583.  
  584. cmd(chatorg, playerid, params[])
  585. {
  586. //Usaremos parâmetros então não precisaremos do pragma.
  587. new corda[128];
  588. if(sscanf(params, "s[128]", corda)) return SendClientMessage(playerid, GetPlayerColor(playerid), "Uso correto: /ChatOrg [Mensagem]");
  589. if(ProgressaoInfo[playerid][Membro] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Civis não tem chat próprio"); //Caso o player tente utilizar chat sendo civil.
  590. new nome[MAX_PLAYER_NAME]; //Criamos a variável que acumulará o nome do player que está mandando a mensagem à org.
  591. GetPlayerName(playerid, nome, sizeof(nome)); //Getamos o nome do player e acoplamos à variável criada acima.
  592. format(Texto, 128, "%s[%d] diz: %s", nome, ProgressaoInfo[playerid][Cargo], corda); //Lembra da variável global chamada de Texto que criamos? Reutilizaremos ela para armazenar o texto que será mandado aos membros da org. Junto com o mandante e seu cargo.
  593. for(new PP, Progressao = GetMaxPlayers(); PP < Progressao; PP++)
  594. {
  595. if(!IsPlayerConnected(PP)) continue; //Caso o player do loop não esteja conectado ele dará continuidade no loop sem executar o que está abaixo.
  596. if(ProgressaoInfo[PP][Membro] == ProgressaoInfo[playerid][Membro]) //Verificará se o player no Loop é da mesma organização do player que mandou a mensagem à org.
  597. {
  598. SendClientMessage(PP, GetPlayerColor(playerid), Texto); //Mandará a mensagem ao player no loop com a cor do player que mandou que lógicamente será a cor da org dele.
  599. }
  600. }
  601. return true;
  602. }
  603.  
  604. cmd(convidar, playerid, params[])
  605. {
  606. new PlayerB, nome[MAX_PLAYER_NAME]; //Criará as variáveis PlayerB que acumulará o ID do player convidado e nome que acumulará o nome de dois players(Um de cada vez, claro).
  607. if(sscanf(params, "d", PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Uso correto: /convidar [id]"); //Caso o player não digite o comando completo retornará à esta mensagem.
  608. if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não está online"); //Caso o jogador convidado não esteja online retornará à esta mensagem.
  609. GetPlayerName(PlayerB, nome, sizeof(nome)); //Pegará o nome do player convidado para usar ao formatar a variável Texto.
  610. format(Texto, 70, "Você convidou %s para sua organização", nome); //Formatará a variável texto com a mensagem e o nome do convidante.
  611. SendClientMessage(playerid, GetPlayerColor(playerid), Texto); //Mandará a mensagem ao convidante informando-o que ele convidou um player.
  612. GetPlayerName(playerid, nome, sizeof(nome)); //Pegará o nome do player convidante para usar ao formatar a variável Texto
  613. format(Texto, 128, "%s está lhe convidando para fazer parte da organização: %s \nDeseja aceitar?", nome, Nomeorgs[ProgressaoInfo[playerid][Membro]]); //Formatará a variável Texto com o nome do player convidante e o nome da organização
  614. ShowPlayerDialog(PlayerB, 100, DIALOG_STYLE_MSGBOX, "Convite para organização", Texto, "Sim", "Não"); //Mostrará ao player convidado o dialog de aceitação da org.
  615. SetPVarInt(PlayerB, "OrgConvidado", ProgressaoInfo[playerid][Membro]); //Setará a PVar do player convidado com o id da org que ele está sendo convidado, caso aceite, será setado.
  616. return true;
  617. }
  618.  
  619. cmd(promover, playerid, params[])
  620. {
  621. new PlayerB, cargo;
  622. if(sscanf(params, "dd", PlayerB, Cargo)) return SendClientMessage(playerid, 0x1E90FF99, "Uso correto: /Promover [id] [cargo]");
  623. if(ProgressaoInfo[playerid][Cargo] != 10) return SendClientMessage(playerid, 0x1E90FF99, "Você não é líder");
  624. if(ProgressaoInfo[PlayerB][Membro] != ProgressaoInfo[playerid][Membro]) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não é da mesma organização que você.");
  625. ProgressaoInfo[playerid][Cargo] = cargo;
  626. return true;
  627. }
  628.  
  629. cmd(demitir, playerid, params[])
  630. {
  631. new PlayerB;
  632. if(sscanf(params, "d", PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Uso correto: /Demitir [id]");
  633. if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não está online");
  634. if(ProgressaoInfo[playerid][Membro] != ProgressaoInfo[PlayerB][Membro]) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não é da sua organização");
  635. if(ProgressaoInfo[playerid][Cargo] != 10) return SendClientMessage(playerid, 0x1E90FF99, "Você não é líder da organização");
  636. ProgressaoInfo[PlayerB][Membro] = 0; //Tornará o player demitido um civil novamente.
  637. ProgressaoInfo[PlayerB][Cargo] = 0; //Atribuirá o cargo 0 ao player demitido, afinal, agora ele não pertence à org alguma.
  638. SendClientMessage(PlayerB, C_Civil, "Você foi demitido");
  639. SetPlayerColor(playerid, C_Civil);
  640. SendClientMessage(playerid, 0x1E90FF99, "Jogador demitido");
  641. return true;
  642. }
  643.  
  644. CMD:creditos(playerid, params[])
  645. {
  646. MEGAString[0] = EOS;
  647. strcat(MEGAString, "{33CCFF}| -------------------------------- Creditos do servidor -------------------------------- |\n\n\n");
  648.  
  649. strcat(MEGAString, "{33CCFF}• Raayzeck & Fórum SA-MP:\n");
  650. strcat(MEGAString, "{FFFFFF} Por sistemas únicos.\n\n");
  651.  
  652. strcat(MEGAString, "{33CCFF}• PeterLinkson & Fórum SA-MP:\n");
  653. strcat(MEGAString, "{FFFFFF} Por ajudar em diversos scripts.\n\n");
  654.  
  655. strcat(MEGAString, "{33CCFF}• PeterLinkson:\n");
  656. strcat(MEGAString, "{FFFFFF} Por sempre me apoiar e me incentivar e também pela criação da base desta gamemode.\n\n");
  657.  
  658. strcat(MEGAString, "{33CCFF}• Fórum SA-MP:\n");
  659. strcat(MEGAString, "{FFFFFF} Por ajudar em alguns bugs do servidor.\n\n");
  660.  
  661. strcat(MEGAString, "{33CCFF}| -------------------------------- Creditos do servidor -------------------------------- |\n\n");
  662. ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Creditos", MEGAString, "BPW", "");
  663. return true;
  664. }
  665.  
  666.  
  667. CMD:chatkill(playerid)
  668. {
  669. if(ChatKill[playerid]){
  670. ChatKill[playerid] = false;
  671. SendClientMessage(playerid, COLOR_GREY, "Você desligou o chat kill!");
  672. }
  673. else{
  674. ChatKill[playerid] = true;
  675. SendClientMessage(playerid, COLOR_GREY, "Você ligou o chat kill!");
  676. }
  677. return 1;
  678. }
  679.  
  680.  
  681. CMD:mudarsenha(playerid,params[])
  682. {
  683. new KinG1[48 + 42];
  684. if(isnull(params)) return SendClientMessage(playerid, -1, "[ERRO] Use: /MudarSenha [nova senha]");
  685.  
  686. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  687. DOF2_SetString(Conta, "Password", params);
  688. DOF2_SaveFile();
  689.  
  690. format(KinG1, sizeof(KinG1), "[SERVER] Sua nova senha é {12FF05}'%s'",params);
  691. SendClientMessage(playerid, -1, KinG1);
  692. return 1;
  693. }
  694.  
  695. CMD:setadming(playerid, params[])
  696. {
  697. new id;
  698. if(sscanf(params, "ud", id, Player[id][pAdmin])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetAdming [ID] [level-admin]");
  699. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
  700. if(Player[id][pAdmin] > 3) return SendClientMessage(playerid,-1,"[ ERROR ] level-admin [0-3]");
  701.  
  702. SendClientMessage(id,-1,"[ ADMIN ] you're an admin now!");
  703. return 1;
  704. }
  705.  
  706. CMD:setskin(playerid ,params[])
  707. {
  708. if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins!");
  709.  
  710. new id,KinG1[38 + 4];
  711. if(sscanf(params, "ud", id, Player[id][pSkin])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetSkin [ID] [skin]");
  712. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
  713. if(Player[id][pSkin] > 311) return SendClientMessage(playerid,-1,"[ ERROR ] skin validas [0-311]");
  714.  
  715. format(KinG1, sizeof(KinG1), "AdmCmd: sua skin foi setada para %d", Player[id][pSkin]);
  716. SendClientMessage(id, -1, KinG1);
  717.  
  718. return SetPlayerSkin(id,Player[id][pSkin]);
  719. }
  720.  
  721. CMD:setscore(playerid ,params[])
  722. {
  723. if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins");
  724.  
  725. new id,KinG2[32 + 11];
  726. if(sscanf(params, "ud", id, Player[id][pScore])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetScore [ID] [score]");
  727. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
  728.  
  729. format(KinG2, sizeof(KinG2), "[ SERVER ] You received %d Score", Player[id][pScore]);
  730. SendClientMessage(id, -1, KinG2);
  731.  
  732. return SetPlayerScore(id,Player[id][pScore]);
  733. }
  734.  
  735. CMD:setmoney(playerid, params[])
  736. {
  737. if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins");
  738.  
  739. new id,KinG1[28 + 11];
  740. if(sscanf(params, "ud", id, Player[id][pMoney])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetMoney [ID] [money]");
  741. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
  742.  
  743. format(KinG1, sizeof(KinG1), "[ SERVER ] You received $ %d", Player[id][pMoney]);
  744. SendClientMessage(id, -1, KinG1);
  745.  
  746. DarMoney(id,Player[id][pMoney]);
  747. return 1;
  748. }
  749.  
  750. CMD:limparchat(playerid)
  751. {
  752. if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins");
  753. for(new i = 0; i < 50; i++) SendClientMessageToAll(-1,"");
  754. return 1;
  755. }
  756.  
  757. public OnPlayerCommandReceived(playerid, cmdtext[])
  758. {
  759. if(Player[playerid][pLogado] == false) return SendClientMessage(playerid, -1, "[ ERROR ] Você não está logado!"),false;
  760. return 1;
  761. }
  762.  
  763. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  764. {
  765. if(!success) return SendClientMessage(playerid, -1, "[ ERROR ] Comando invalido");
  766. return 1;
  767. }
  768.  
  769. CMD:ajuda(playerid)
  770. {
  771. new ajudaz[500];
  772. strcat(ajudaz,"Comando para jogadores\n");
  773. strcat(ajudaz,"/ajuda, /MudarSenha, /MudarNick\n\n");
  774. strcat(ajudaz,"Comando para Admins\n");
  775. strcat(ajudaz,"/SetSkin, /SetScore, /SetMoney, /LimparChat\n\n");
  776. return ShowPlayerDialog(playerid,7984, DIALOG_STYLE_MSGBOX, "commands",ajudaz, "Exit", "");
  777. }
  778.  
  779. //=====================================================================================||
  780.  
  781. CriarConta(playerid)
  782. {
  783. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  784.  
  785. DOF2_SetInt(Conta, "Admin", 0);
  786. DOF2_SetInt(Conta, "Skin", 98);
  787. DOF2_SetInt(Conta, "Money", 500);
  788. DOF2_SetInt(Conta, "Score", 0);
  789. DOF2_SetFloat(Conta, "PosX", 2069.8767);
  790. DOF2_SetFloat(Conta, "PosY", -1766.6870);
  791. DOF2_SetFloat(Conta, "PosZ", 13.5621);
  792. DOF2_SetFloat(Conta, "PosA", 90.0);
  793. DOF2_SetInt(Conta, "Interior", 0);
  794. DOF2_SetInt(Conta, "VW", 0);
  795.  
  796. DOF2_SaveFile();
  797. }
  798.  
  799. CarregarConta(playerid)
  800. {
  801. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  802.  
  803. Player[playerid][pAdmin] = DOF2_GetInt(Conta, "Admin");
  804. Player[playerid][pSkin] = DOF2_GetInt(Conta, "Skin");
  805. Player[playerid][pMoney] = DOF2_GetInt(Conta, "Money");
  806. Player[playerid][pScore] = DOF2_GetInt(Conta, "Score");
  807. Player[playerid][pPosX] = DOF2_GetInt(Conta, "PosX");
  808. Player[playerid][pPosY] = DOF2_GetInt(Conta, "PosY");
  809. Player[playerid][pPosZ] = DOF2_GetInt(Conta, "PosZ");
  810. Player[playerid][pPosA] = DOF2_GetInt(Conta, "PosA");
  811. Player[playerid][pInterior] = DOF2_GetInt(Conta, "Interior");
  812. Player[playerid][pVW] = DOF2_GetInt(Conta, "VW");
  813. Player[playerid][pLogado]=true;
  814.  
  815. SetPlayerScore(playerid, Player[playerid][pScore]);
  816. DarMoney(playerid, Player[playerid][pMoney]);
  817. SetPlayerInterior(playerid, Player[playerid][pInterior]);
  818. SetPlayerVirtualWorld(playerid, Player[playerid][pVW]);
  819. SetSpawnInfo(playerid, -1, Player[playerid][pSkin], Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ], Player[playerid][pPosA],0,0,0,0,0,0);
  820. SpawnPlayer(playerid);
  821. }
  822.  
  823. SalvarConta(playerid)
  824. {
  825. format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
  826. DOF2_SetInt(Conta, "Admin", Player[playerid][pAdmin]);
  827. DOF2_SetInt(Conta, "Skin", Player[playerid][pSkin]);
  828. DOF2_SetInt(Conta, "Money", Player[playerid][pMoney]);
  829. DOF2_SetInt(Conta, "Score", Player[playerid][pScore]);
  830.  
  831. DOF2_SetFloat(Conta, "PosX", Player[playerid][pPosX]);
  832. DOF2_SetFloat(Conta, "PosY", Player[playerid][pPosY]);
  833. DOF2_SetFloat(Conta, "PosZ", Player[playerid][pPosZ]);
  834. DOF2_SetFloat(Conta, "PosA", Player[playerid][pPosA]);
  835. DOF2_SetInt(Conta, "Interior", GetPlayerInterior(playerid));
  836. DOF2_SetInt(Conta, "VW", GetPlayerVirtualWorld(playerid));
  837.  
  838. DOF2_SaveFile();
  839. }
  840.  
  841. Name(playerid)
  842. {
  843. new pNome[MAX_PLAYER_NAME];
  844. GetPlayerName(playerid, pNome, 24);
  845. return pNome;
  846. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement