Advertisement
didimk

[Gamemode] Mata - Mata Base

Jan 25th, 2017
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.93 KB | None | 0 0
  1. //===================Includes========================//
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <sscanf2>
  5. #include <DOF2>
  6. //===================dialogs========================//
  7. #define DIALOG_REGISTRO 0
  8. #define DIALOG_LOGIN 1
  9. //===================Cores==========================//
  10. #define COR_PRINCIPAL 0x33AAFFFF
  11. #define COR_ERRO 0xFF0000AA
  12. #define COR_USOCORRETO 0x3552F2FF
  13. #define COR_ROXO 0xC798FAAA
  14. #define COR_RED 0xFF0000AA
  15. #define COR_BRANCO
  16. //=================defines=========================//
  17. #define Conta "Players/%s.ini"
  18. //==================Forwards=======================//
  19. forward MensagemAdmin(const string[]);
  20. //==================Variaveis e enums======================//
  21. enum pDados
  22. {
  23. Matou,
  24. Morreu,
  25. Float:LastPos[3],
  26. bool:BlockIR,
  27. bool:BlockTR,
  28. Admin,
  29. Logou,
  30. Vip
  31. }
  32. new Player[MAX_PLAYERS][pDados];
  33. new bool:Logado[MAX_PLAYERS char];
  34. new HoraL[MAX_PLAYERS];
  35. new AnoL[MAX_PLAYERS];
  36. new MesL[MAX_PLAYERS];
  37. new DiaL[MAX_PLAYERS];
  38. new MinutoL[MAX_PLAYERS];
  39. new HighestID;
  40.  
  41. new Float:Spawns[][4] =
  42. {
  43. {2880.5957,-2170.0557,3.4774,38.7993}, //Los Santos
  44. {972.4814,-2110.8853,3.4027,345.1821},
  45. {2941.1909,-2051.7246,3.5480,89.9617},
  46. {2912.9241,-2020.3119,1.2104,100.6778},
  47. {2880.6594,-1846.5564,2.1070,157.8120},
  48. {17.2789,-1546.8250,2.6433,299.1058},
  49. {-32.6180,-1593.1462,3.3386,342.3671},
  50. {-61.9838,-1624.4888,3.5350,1.4180},
  51. {6.0960,-2518.5007,36.6484,65.3176},
  52. {-1984.1560,-2429.6050,30.6250,64.5606},
  53. {165.4114,-254.1129,1.5781,89.1862},
  54. {103.1874,-190.0887,1.5526,176.9362},
  55. {-474.7529,-42.6864,59.9844,139.2315},
  56. {256.5624,-137.6565,1.5781,67.3940},
  57. {664.9687,-459.8052,16.3359,181.3389},
  58. {2328.6951,51.1456,32.9884,21.3912},
  59. {-877.9271,-382.6847,15.7645,117.4575}, //San Fierro
  60. {-741.8128,-111.7056,67.0503,45.2231},
  61. {-2928.0564,-629.5295,2.7627,274.2302},
  62. {-2915.4749,-501.5479,3.0981,274.2302},
  63. {-2910.9980,-126.1767,3.0636,271.8487},
  64. {-2959.2498,429.4636,2.0893,270.6581},
  65. {-2625.6543,1450.8965,7.1875,196.8179},
  66. {-1895.1195,2171.1807,1.7822,316.6610}, //Las Venturas
  67. {-2020.9771,2343.1365,2.3820,332.9521},
  68. {-2315.8979,2518.4412,2.5308,100.7698},
  69. {-800.1105,673.5194,10.7457,300.4251},
  70. {-684.6343,1277.7700,9.1661,80.5282},
  71. {-726.5945,1617.8795,27.1172,101.1849},
  72. {-1450.4762,2552.3130,55.8359,53.9547},
  73. {-423.2437,2191.0681,42.1336,329.8134},
  74. {-535.2921,2593.2822,53.4154,269.9010},
  75. {-785.7039,2770.6057,45.6349,202.4110},
  76. {603.9664,1241.7435,11.7188,159.9435},
  77. {19.6538,1173.1602,19.4757,5.1554},
  78. {-1505.0404,1965.5636,48.4219,303.6554},
  79. {-1227.3040,1835.5507,41.6093,325.1060},
  80. {-648.0820,1055.0486,12.1262,146.9012},
  81. {797.2725,1678.9242,5.2813,335.4253},
  82. {302.2009,1150.2301,8.5859,207.2289},
  83. {-292.0122,1802.3247,42.7813,158.8080}
  84. };
  85.  
  86. public OnGameModeInit()
  87. {
  88. SetGameModeText("Mata-Mata");
  89. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  90. return 1;
  91. }
  92.  
  93. public OnGameModeExit()
  94. {
  95. return 1;
  96. }
  97.  
  98. public OnPlayerRequestClass(playerid, classid)
  99. {
  100. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  101. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  102. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  103. return 1;
  104. }
  105.  
  106. public OnPlayerConnect(playerid)
  107. {
  108. PegarConta(playerid);
  109. if(!DOF2_FileExists(PegarConta(playerid)))
  110. {
  111. new string[128];
  112. format(string, sizeof(string), "Conta: {40E0D0}%s{40E0D0}\nStatus: Não Registrada{FFFFFF}\nDigite uma senha para registrar-se no servidor", Nome(playerid));
  113. ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{40E0D0}Gamemode Base Mata Mata - RJ",string, "Registrar", "Sair");
  114. }
  115. else
  116. {
  117. new string[128];
  118. format(string, sizeof(string), "Conta: {40E0D0}%s{40E0D0}\nStatus: {FF0000}Registrada{FFFFFF}\nDigite uma senha Válida para Conectar-se ao servidor ", Nome(playerid));
  119. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{40E0D0}Gamemode Base Mata Mata - RJ}", string, "Conectar", "Sair");
  120. }
  121. return 1;
  122. }
  123.  
  124. public OnPlayerDisconnect(playerid, reason)
  125. {
  126. CarregarDados(playerid);
  127. return 1;
  128. }
  129.  
  130. public OnPlayerSpawn(playerid)
  131. {
  132. new rand = random(sizeof(Spawns));
  133. SetPlayerPos(playerid, Spawns[rand][0], Spawns[rand][1], Spawns[rand][2]);
  134. SetPlayerInterior(playerid, 0);
  135. SetPlayerFacingAngle(playerid, Spawns[rand][3]);
  136. SetPlayerVirtualWorld(playerid, 0);
  137. return 1;
  138. }
  139.  
  140. public OnPlayerDeath(playerid, killerid, reason)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnPlayerText(playerid, text[])
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  151. {
  152. if(!success)
  153. {
  154. SendClientMessage(playerid, -1, "[FALHOU!]: Este comando Que Você Digito não existe use '/comandos' para ver os comandos do servidor!.");
  155. }
  156. return 1;
  157. }
  158.  
  159. CMD:comandosadmin(playerid)
  160. {
  161. if(Player[playerid][Admin] < 1)return SendClientMessage(playerid, COR_ERRO,"[ERRO]: Você não é um administrador para acessar este comando.");
  162. ComandosAdmin(playerid);
  163. return 1;
  164. }
  165.  
  166. CMD:creditos(playerid)
  167. {
  168. Creditos(playerid);
  169. return 1;
  170. }
  171.  
  172. CMD:kill(playerid)
  173. {
  174. if(Logado{playerid} == false)return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Você não está logado para utilizar este comando!");
  175. GetPlayerPos(playerid, Player[playerid][LastPos][0], Player[playerid][LastPos][1], Player[playerid][LastPos][2]);
  176. SetTimerEx("AutoKill", 5000, false, "i", playerid);
  177. SendClientMessage(playerid, COR_PRINCIPAL,"[INFO]: Não se mova para que sua morte desejada seja um sucesso.");
  178. return 1;
  179. }
  180.  
  181. CMD:trazer(playerid, params[])
  182. {
  183. new id,Float:plocx,Float:plocy,Float:plocz;
  184. if(GetPlayerInterior(playerid) > 0)
  185. if(sscanf(params,"u",id)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /trazer [id]");
  186. if(Player[playerid][Admin] >= 1)
  187. {
  188. if(Player[id][BlockTR] == false)
  189. {
  190. new str[90];
  191. format(str, sizeof(str), " %s foi puxado por %s.", Nome(id), Nome(playerid));
  192. MensagemLocal(playerid, COR_ROXO, str, 50);
  193.  
  194. format(str, sizeof(str), " %s puxou %s.", Nome(playerid), Nome(id));
  195. MensagemLocal(id, COR_ROXO, str, 50);
  196.  
  197. GetPlayerPos(playerid, plocx, plocy, plocz);
  198.  
  199. new intid = GetPlayerInterior(playerid);
  200. SetPlayerInterior(id,intid);
  201.  
  202. new world = GetPlayerVirtualWorld(playerid);
  203. SetPlayerVirtualWorld(id, world);
  204.  
  205. if (GetPlayerState(id) == 2)
  206. {
  207. new tmpcar = GetPlayerVehicleID(id);
  208. SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  209. }
  210. else
  211. {
  212. SetPlayerPos(id,plocx,plocy+2, plocz);
  213. }
  214. }
  215. else SendClientMessage(playerid,COR_ERRO,"[ERRO]: Este player está com o trazer bloqueado.");
  216. }
  217. else
  218. {
  219. SendClientMessage(playerid, COR_RED, "[ERRO]: Você não tem permissão para usar este comando!");
  220. }
  221. return 1;
  222. }
  223.  
  224. CMD:ir(playerid, params[])
  225. {
  226. if(Logado{playerid}==false)return SendClientMessage(playerid,COR_ERRO,"[ERRO]: Você não está Logado para usar este comando!");
  227. new Float:x,Float:y,Float:z,id,intid = GetPlayerInterior(playerid),string[128],tmpcar = GetPlayerVehicleID(playerid);
  228. if(sscanf(params,"u",id)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /ir [id]");
  229.  
  230. if(Logado{id}==false)return SendClientMessage(playerid,COR_ERRO,"[ERRO]: Este player não está logado.");
  231.  
  232. if(!(Player[playerid][Admin] >= 1))return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Você não tem permissão para usar este comando!");
  233. if(Player[id][BlockIR] == false)
  234. {
  235. GetPlayerPos(id, x, y, z);
  236. SetPlayerInterior(id,intid);
  237. if(!(IsPlayerConnected(id))) return SendClientMessage(playerid,COR_ERRO,"[ERRO]: Jogador não está Logado.");
  238. if (GetPlayerState(playerid) == 2)
  239. {
  240. SetVehiclePos(tmpcar, x, y+4, z);
  241. }
  242. else
  243. {
  244. SetPlayerPos(playerid,x,y+2, z);
  245. format(string, sizeof(string), " %s foi até %s.", Nome(playerid), Nome(id));
  246. MensagemLocal(playerid, COR_ROXO, string, 60);
  247. format(string, sizeof(string), " %s veio até %s.", Nome(playerid), Nome(id));
  248. MensagemLocal(id, COR_ROXO, string, 60);
  249. }
  250. }
  251. else
  252. {
  253. SendClientMessage(playerid,COR_ERRO,"[ERRO]: Este player está com o ir bloqueado.");
  254. }
  255. return 1;
  256. }
  257. CMD:colete(playerid, params[])
  258. {
  259. if(Logado{playerid}==false)return SendClientMessage(playerid,COR_ERRO,"[ERRO]: Você não está Logado para usar este comando!");
  260. new id, colete, str[66];
  261. if(sscanf(params,"ud",id,colete)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /colete [id] [quantidade]");
  262. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Este jogador não está Logado.");
  263. if(!(Player[playerid][Admin] >= 2))return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Você não tem permissão para usar este comando!");
  264. format(str, sizeof(str), " %s deu colete para %s.", Nome(playerid), Nome(id));
  265. MensagemLocal(playerid, COR_ROXO, str, 50);
  266. SetPlayerArmour(id,colete);
  267. return 1;
  268. }
  269. CMD:vida(playerid, params[])
  270. {
  271. if(Logado{playerid}==false)return SendClientMessage(playerid,COR_ERRO,"[ERRO]: Você não está Logado para usar este comando!");
  272. new id, health,str[66];
  273. if(sscanf(params,"ud",id,health)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /vida [id] [quantidade]");
  274. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Este jogador não está Logado.");
  275. if(!(Player[playerid][Admin] >= 1))return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Você não tem permissão para usar este comando!");
  276. format(str, sizeof(str), " %s deu vida para %s.", Nome(playerid), Nome(id));
  277. MensagemLocal(playerid, COR_ROXO, str, 50);
  278. SetPlayerHealth(id,health);
  279. return 1;
  280. }
  281.  
  282. CMD:setadmin(playerid,params[])
  283. {
  284. new id, level, string[256];
  285. if(Logado{playerid}==false)return SendClientMessage(playerid,COR_ERRO,"[ERRO]: Você não está Logado para usar este comando!");
  286. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COR_ERRO, "[ERRO]: Você tem que está logado na rcon para utilizar esse comando.");
  287. if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /setadmin [id] [level]");
  288. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Este id está offline");
  289. if(level > 4) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Máximo de Level a ser setado é 5.");
  290. if(Logado{id} == false) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Este jogador não está Logado.");
  291. new AdmLevel[500];
  292. if(Player[playerid][Admin] == 4) { AdmLevel = "Game Master"; }
  293. if(Player[playerid][Admin] == 3) { AdmLevel = "Administrador Fixo"; }
  294. if(Player[playerid][Admin] == 2) { AdmLevel = "Administrador Ajudante"; }
  295. if(Player[playerid][Admin] == 1) { AdmLevel = "Administrador Temporário"; }
  296. if(level>=1)
  297. {
  298. format(string,sizeof(string),"[INFO]: O %s %s te setou de administrador level %d.",AdmLevel,Nome(playerid),level);
  299. SendClientMessage(id, COR_PRINCIPAL,string);
  300. format(string,sizeof(string),"[INFO]: Você setou %s de administrador level %d.",Nome(id),level);
  301. SendClientMessage(playerid, COR_PRINCIPAL,string);
  302. Player[id][Admin] = level;
  303. format(string, sizeof(string),"-Log-Admin- %s foi promovido a nível %d de Administrador pelo %s.", Nome(id), level, Nome(playerid));
  304. MensagemAdmin(string);
  305. format(string, sizeof(string), "-LOG- O %s %s setou %s de Administrador Level %d.",AdmLevel,Nome(playerid),Nome(id),level);
  306. DarAdmin(string);
  307. SalvarDados(id);
  308.  
  309. printf("[SET ADMIN]: O %s %s setou %s de Administrador Level %d.", AdmLevel, Nome(playerid), Nome(id),level);
  310. }
  311. if(level==0)
  312. {
  313. format(string,sizeof(string),"[INFO]: O %s %s te desetou de administrador.",AdmLevel,Nome(playerid));
  314. SendClientMessage(id,COR_PRINCIPAL,string);
  315. format(string,sizeof(string),"[INFO]: Você retirou o administrador do player %s.",Nome(id));
  316. SendClientMessage(playerid,COR_PRINCIPAL,string);
  317. Player[id][Admin]=level;
  318. format(string, sizeof(string),"-Log-Admin- O %s %s desetou %s de Administrador.", AdmLevel,Nome(playerid), Nome(id));
  319. MensagemAdmin(string);
  320. SalvarDados(id);
  321.  
  322. format(string, sizeof(string), "-LOG-: O %s %s desetou %s de Administrador.",AdmLevel,Nome(playerid),Nome(id));
  323. DarAdmin(string);
  324. printf("[SET ADMIN]: O %s %s desetou %s de Administrador.", AdmLevel,Nome(playerid), Nome(id));
  325. }
  326. return 1;
  327. }
  328.  
  329. CMD:duvida(playerid, params[])
  330. {
  331. if(sscanf(params, "s", params)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /duvida [texto]");
  332.  
  333. new string[128];
  334. format(string, sizeof(string), "[DÚVIDA DE %s] (ID: %d): %s", Nome(playerid), playerid, params);
  335. MensagemAdmin(string);
  336. SendClientMessage(playerid, COR_PRINCIPAL, "[INFO]: Sua duvida foi enviada para os Helpers on-line, aguarde para ser respondido!");
  337. return 1;
  338. }
  339.  
  340. CMD:rduvida(playerid, params[])
  341. {
  342. new id, msg[50], str[120];
  343. if(Player[playerid][Admin] < 1) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Você não tem permissão!");
  344. if(sscanf(params,"us", id, msg)) return SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /rduvida [id] [mensagem]");
  345. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "[ERRO]: Este jogador está offline!");
  346. format(str, sizeof(str),"[DUVIDA] Sua duvida foi respondida pelo helper %s: %s ", Nome(playerid), msg);
  347. SendClientMessage(id, COR_PRINCIPAL, str);
  348.  
  349. format(str, sizeof(str),"[DUVIDA] Você acaba de responder a duvida de %s", Nome(id));
  350. SendClientMessage(playerid, COR_PRINCIPAL,str);
  351. return true;
  352. }
  353.  
  354. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  355. {
  356. if(dialogid == DIALOG_LOGIN)
  357. {
  358. if(!response) return Kick(playerid);
  359. if(response)
  360. {
  361. if(!strlen(inputtext))
  362. {
  363. return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "LOGIN", "Entrar no servidor","Entrar", "Sair");
  364. }
  365. PegarConta(playerid);
  366. if(strcmp(inputtext, DOF2_GetString(Conta, "Senha"), true))
  367. {
  368. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "LOGIN", "Entrar no servidor","Entrar", "Sair");
  369. return SendClientMessage(playerid, -1, "Senha incorreta!");
  370. }
  371. else //se conseguir logar
  372. {
  373. return CarregarDados(playerid);
  374. }
  375. }
  376. return 1;
  377. }
  378. if(dialogid == DIALOG_REGISTRO)
  379. {
  380. if(!response) return Kick(playerid);
  381. if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registro", "Digite Sua Senha Para Se Registrar!", "Registrar", "Sair");
  382. if(response)
  383. {
  384. if(strlen(inputtext))
  385. {
  386. PegarConta(playerid);
  387. DOF2_CreateFile(Conta);
  388. DOF2_SetString(Conta, "Senha", inputtext);
  389. DOF2_SetString(Conta,"Email", inputtext);
  390. DOF2_SaveFile();
  391.  
  392. SalvarDados(playerid);
  393. CarregarDados(playerid);
  394. }
  395. else return ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registro", "Digite Sua Senha Para Se Registrar!", "Registrar", "Sair");
  396. }
  397. return 1;
  398. }
  399. return 1;
  400. }
  401.  
  402. stock MensagemLocal(playerid, cor, text[], distancia)
  403. {
  404. for(new i=0; i <= MAX_PLAYERS; i++)
  405. if(GetandoDistancia(playerid, i) <= distancia)
  406. {
  407. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  408. {
  409. new string[128];
  410. format(string, 128, text);
  411. SendClientMessage(i,cor,string);
  412. }
  413. }
  414. return 1;
  415. }
  416.  
  417. stock Nome(playerid)
  418. {
  419. static Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); return Name;
  420. }
  421.  
  422. stock GetandoDistancia(playerid,playerid2)
  423. {
  424. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  425. new Float:tmpdis;
  426. GetPlayerPos(playerid,x1,y1,z1);
  427. GetPlayerPos(playerid2,x2,y2,z2);
  428. tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  429. return floatround(tmpdis);
  430. }
  431.  
  432. stock SalvarDados(playerid)
  433. {
  434. getdate(AnoL[playerid], MesL[playerid], DiaL[playerid]);
  435. gettime(HoraL[playerid], MinutoL[playerid]);
  436. DOF2_SetInt(PegarConta(playerid), "Level", GetPlayerScore(playerid));
  437. DOF2_SetInt(PegarConta(playerid), "Dinheiro", GetPlayerMoney(playerid));
  438. DOF2_SetInt(PegarConta(playerid), "SkinAtual", GetPlayerSkin(playerid));
  439. DOF2_SetInt(PegarConta(playerid), "AdminLevel", Player[playerid][Admin]);
  440. DOF2_SetInt(PegarConta(playerid), "Vip", Player[playerid][Vip]);
  441. DOF2_SetInt(PegarConta(playerid), "Logou", Player[playerid][Logou]);
  442. DOF2_SetInt(PegarConta(playerid), "Matou", Player[playerid][Matou]);
  443. DOF2_SetInt(PegarConta(playerid), "Morreu", Player[playerid][Morreu]);
  444. DOF2::SetInt(PegarConta(playerid), "MinutoL", MinutoL[playerid]);
  445. DOF2::SetInt(PegarConta(playerid), "HoraL", HoraL[playerid]);
  446. DOF2::SetInt(PegarConta(playerid), "DiaL", DiaL[playerid]);
  447. DOF2::SetInt(PegarConta(playerid), "MesL", MesL[playerid]);
  448. DOF2::SetInt(PegarConta(playerid), "AnoL", AnoL[playerid]);
  449.  
  450.  
  451. if(Player[playerid][BlockIR] == true)
  452. {
  453. DOF2_SetInt(PegarConta(playerid),"StatusIR", 1);
  454. }
  455. else DOF2_SetInt(PegarConta(playerid),"StatusIR", 0);
  456. if(Player[playerid][BlockTR] == true)
  457. {
  458. DOF2_SetInt(PegarConta(playerid),"StatusTR", 1);
  459. }
  460. else DOF2_SetInt(PegarConta(playerid),"StatusTR", 0);
  461. DOF2_SaveFile();
  462. }
  463.  
  464. stock CarregarDados(playerid)
  465. {
  466. if(DOF2_FileExists(PegarConta(playerid)))
  467. {
  468. SetPlayerScore(playerid, DOF2_GetInt(PegarConta(playerid), "Level"));
  469. GivePlayerMoney(playerid, DOF2_GetInt(PegarConta(playerid), "Dinheiro"));
  470. SetPlayerSkin(playerid, DOF2_GetInt(PegarConta(playerid), "SkinAtual"));
  471. Player[playerid][Admin] = DOF2_GetInt(PegarConta(playerid), "AdminLevel");
  472. Player[playerid][Vip] = DOF2_GetInt(PegarConta(playerid), "Vip");
  473. Player[playerid][Logou] = DOF2_GetInt(PegarConta(playerid), "Logou");
  474. Player[playerid][Matou] = DOF2_GetInt(PegarConta(playerid), "Matou");
  475. Player[playerid][Morreu] = DOF2_GetInt(PegarConta(playerid), "Morreu");
  476.  
  477. MinutoL[playerid] = DOF2_GetInt(PegarConta(playerid), "MinutoL");
  478. HoraL[playerid] = DOF2_GetInt(PegarConta(playerid), "HoraL");
  479. DiaL[playerid] = DOF2_GetInt(PegarConta(playerid), "DiaL");
  480. MesL[playerid] = DOF2_GetInt(PegarConta(playerid), "MesL");
  481. AnoL[playerid] = DOF2_GetInt(PegarConta(playerid), "AnoL");
  482.  
  483. if(DOF2_GetInt(PegarConta(playerid), "StatusIR") == 1)
  484. {
  485. Player[playerid][BlockIR] = true;
  486. }
  487. else Player[playerid][BlockIR] = false;
  488. if(DOF2_GetInt(PegarConta(playerid), "StatusTR") == 1)
  489. {
  490. Player[playerid][BlockTR] = true;
  491. }
  492. else Player[playerid][BlockTR] = false;
  493. }
  494. DOF2_SaveFile();
  495. return 1;
  496. }
  497.  
  498. stock PegarConta(playerid)
  499. {
  500. static Arquivo[2000]; format(Arquivo, sizeof(Arquivo), "Players/%s.ini", Nome(playerid)); return Arquivo;
  501. }
  502.  
  503. stock DarAdmin(DeuAdmin[])
  504. {
  505. new string[256];
  506. format(string, sizeof(string), "%s \r\n", DeuAdmin);
  507. new File:hFile;
  508. hFile = fopen("FA/logs/-LOG- Setadmin.txt", io_append);
  509. fwrite(hFile, string);
  510. fclose(hFile);
  511. }
  512.  
  513. stock ComandosAdmin(playerid)
  514. {
  515. new dialogrande[1050];
  516. if(Player[playerid][Admin]>=1)
  517. {
  518. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{33AAFF}• Level 1\n");
  519. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{FFFFFF}/a - /asay - /vida - /colete - /tapa - /ir - /trazer - /rc - /prender - /pinfo - /jetpack - /veh - /at - /respawn\n");
  520. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande," /rduvida - /reports - /setskin - /kick - /coletet - /vidat - /dc - /tempban - /olhar\n\n");
  521. }
  522. if(Player[playerid][Admin]>=2)
  523. {
  524. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{33AAFF}• Level 2\n");
  525. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{FFFFFF}/supertapa - /congelar - /desarmar - /grade - /rgrade\n\n");
  526. }
  527. if(Player[playerid][Admin]>=3)
  528. {
  529. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{33AAFF}• Level 3\n");
  530. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande," {FFFFFF}/criar_e - /armas - /bir - /btr - /falat - /granat\n\n");
  531. }
  532.  
  533. if(Player[playerid][Admin]>=4)
  534. {
  535. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{33AAFF}• Level 5\n");
  536. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{FFFFFF}/clima - /payday - /reiniciar - /falat - /tempo - /dararma - /sethelper - /editarinfo\n\n");
  537. }
  538. ShowPlayerDialog(playerid,666, DIALOG_STYLE_MSGBOX, "{FFFFFF}Comandos Administrador - {FF0000}Mata - Mata RJ", dialogrande, "OK", "");
  539. }
  540.  
  541. stock Creditos(playerid)
  542. {
  543. new dialogrande[1050];
  544. {
  545. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{33AAFF}Scripter • Didimk157\n");
  546. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{FFFFFF}Mappers : Então os Mappers não chegaram a fazer mapas.");
  547. format(dialogrande, sizeof(dialogrande),"%s%s",dialogrande,"{33AAFF}Agradecimentos: www.Forum-Samp.com");
  548. }
  549. ShowPlayerDialog(playerid,666, DIALOG_STYLE_MSGBOX, "{FFFFFF}Creditos do Servidor - {FF0000}Mata - Mata RJ", dialogrande, "OK", "");
  550. }
  551.  
  552. public MensagemAdmin(const string[])
  553. {
  554. for(new i = 0; i <= HighestID; i++)
  555. {
  556. if(IsPlayerConnected(i) == 1)
  557. {
  558. if(Player[i][Admin] >= 1)
  559. {
  560. SendClientMessage(i, 0xFFBD9DFF, string);
  561. }
  562. }
  563. }
  564. return 1;
  565. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement