Guest User

//Sistema de Cash v1.0

a guest
Sep 24th, 2013
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.95 KB | None | 0 0
  1. #include <a_samp> //
  2. #include <SII> //
  3. #include <ZCMD> //
  4. #include <sscanf2>//
  5. //===============//
  6. #if defined FILTERSCRIPT
  7. //--------------------------//
  8. public OnFilterScriptInit()
  9. {
  10. print("\n--------------------------------------");
  11. print("|.|.|.|System Cash v1.0|.|.|.|");
  12. print("|.|.|.|Criado Por Wellington Mateus|.|.|.|\n");
  13. print("--------------------------------------\n");
  14. new AtualizarGrana;// Variavel do Timer de Atualizar A GRANA!
  15. for(new i = 0; i < MAX_PLAYERS; i++) //LOop pra salvar a conta de geral
  16. {
  17. CarregarContas(x);
  18. }
  19. SetTimer("SendMensagens",30000,1);
  20. AtualizarGrana = SetTimer("AtualizarCash", 500, true);
  21. return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26. for(new i = 0; i < MAX_PLAYERS; i++) //LOop pra salvar a conta de geral
  27. {
  28. SalvarContas(i);
  29. }
  30. return 1;
  31. }
  32. #else
  33. main()
  34. {
  35. print("\n--------------------------------------");
  36. print("|.|.|.|System Cash v1.0|.|.|.|");
  37. print("|.|.|.|Criado Por Wellington Mateus|.|.|.|\n");
  38. print("--------------------------------------\n");
  39. }
  40.  
  41. #endif
  42. //---------#Ant Money Hacker----------//
  43. #define GetPlayerMoneyEx(%0) \
  44. (((Cash[%0])))
  45. #define SetPlayerMoneyEx(%0,%1) \
  46. (((Cash[%0] = %1,ResetPlayerMoney(%0),GivePlayerMoney(%0,%1))))
  47. #define GivePlayerMoneyEx(%0,%1) \
  48. (((Cash[%0] += %1,GivePlayerMoney(%0,%1))))
  49. #define ResetPlayerMoneyEx(%0) \
  50. (((Cash[%0] = 0,ResetPlayerMoney(%0))))
  51. //---------#Enums#---------//
  52. enum pInfo
  53. {
  54. pVip,
  55. pAdmin,
  56. pCash,
  57. pLevel,
  58. pDias,
  59. pSkin,
  60. };
  61. new WInfo[MAX_PLAYERS][pInfo];
  62. //--------------------------------
  63. #define iPasta "Contas/%s.ini" //
  64. //----------#Dialogs#-----------//
  65. #define DIALOG_INFO 0
  66. #define DCash 1
  67. #define DGranaCash 2
  68. #define DVipCash 3
  69. #define DLevelCash 4
  70. #define DLogin 5
  71. #define DRegistro 6
  72. #define VIPInfo 7
  73. #define GMXInfo 8
  74. //---------#Variáveis#---------//
  75. new BigEar[MAX_PLAYERS];
  76. new TempoKitVip[MAX_PLAYERS];
  77. new Cash[MAX_PLAYERS];
  78. new cash;
  79. new iddele;
  80. new String[256];
  81. new Logado[MAX_PLAYERS];
  82. new TentandoRegistrar[MAX_PLAYERS];
  83. static corda[MAX_PLAYERS][128],formata[MAX_PLAYERS][30],mandoumensagem[MAX_PLAYERS];
  84. //----------[Stocks]----------//
  85. stock pNome(playerid)
  86. {//Essa função irá returnar o nome do jogador, sendo assim não precisa toda vez usar new nome[MAX_PLAYER_NAME]; GetPlayerName e bla bla bla.
  87. new nome[MAX_PLAYER_NAME];
  88. GetPlayerName(playerid, nome, sizeof(nome));
  89. return nome;
  90. }
  91. stock IsNumero(string[])
  92. {
  93. for (new i = 0, j = strlen(string); i < j; i++)
  94. {
  95. if (string[i] > '9' || string[i] < '0') return 0;
  96. }
  97. return 1;
  98. }
  99. //----------[Cores]----------//
  100. #define COR_VIP 0x98F5FFAA
  101. #define COR_BRANCO 0xFAFAFAFF
  102. #define COR_VERDE 0x00FF00FF
  103. #define COR_AZUL 0x33CCFFAA
  104. #define BRANCO2 0xFFFFFFAA
  105. #define AMARELO 0xFFFF33AA
  106. public OnPlayerRequestClass(playerid, classid)
  107. {
  108. if(Logado[playerid] == 0)
  109. {
  110. SetPlayerPos(playerid, 2173.4932,-1108.9648,25.3100);//Seta a visao da camera!
  111. SetPlayerCameraPos(playerid, 2171.3335,-1107.0033,25.4181);// Seta a posição!
  112. SetPlayerCameraLookAt(playerid, 2146.9326,-1077.8234,41.0193);// Seta o Angulo!
  113. if(fexist(Arquivo(playerid)))
  114. {
  115. format(String, 256, "{FFFFFF}Bem vindo %s\n\nStatus da conta: Registrada\nDigite sua senha abaixo para logar.", pNome(playerid));
  116. ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "Login", String, "Logar", "Sair");
  117. }
  118. else
  119. {
  120. format(String, 256, "{FFFFFF}Bem vindo %s\n\nStatus da conta: Não Registrada\nDigite uma senha abaixo para se registrar.", pNome(playerid));
  121. ShowPlayerDialog(playerid, DRegistro, DIALOG_STYLE_INPUT, "Registro", String, "Registrar", "Sair");
  122. }
  123. }else SpawnPlayer(playerid), OnPlayerSpawn(playerid);
  124. return false;
  125. }
  126.  
  127. public OnPlayerConnect(playerid)
  128. {
  129. CarregarContas(playerid);
  130. WInfo[playerid][pCash] = 0;
  131. WInfo[playerid][pVip] = 0;
  132. WInfo[playerid][pAdmin] = 0;
  133. BigEar[playerid] = 0;
  134. if(Logado[playerid] == 0)
  135. {
  136. SetPlayerPos(playerid, 2173.4932,-1108.9648,25.3100);//Seta a visao da camera!
  137. SetPlayerCameraPos(playerid, 2171.3335,-1107.0033,25.4181);// Seta a posição!
  138. SetPlayerCameraLookAt(playerid, 2146.9326,-1077.8234,41.0193);// Seta o Angulo!
  139. if(fexist(Arquivo(playerid)))
  140. {
  141. format(String, 256, "{FFFFFF}Bem vindo %s\n\nStatus da conta: Registrada\nDigite sua senha abaixo para logar.", pNome(playerid));
  142. ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "Login", String, "Logar", "Sair");
  143. }
  144. else
  145. {
  146. format(String, 256, "{FFFFFF}Bem vindo %s\n\nStatus da conta: Não Registrada\nDigite uma senha abaixo para se registrar.", pNome(playerid));
  147. ShowPlayerDialog(playerid, DRegistro, DIALOG_STYLE_INPUT, "Registro", String, "Registrar", "Sair");
  148. }
  149. }else SpawnPlayer(playerid), OnPlayerSpawn(playerid);
  150. return 1;
  151. }
  152.  
  153. public OnPlayerDisconnect(playerid, reason)
  154. {
  155. SalvarContas(playerid);
  156. switch(reason)
  157. {
  158. case 0: format(String, 40, "%s crashou do servidor", pNome(playerid));
  159. case 1: format(String, 55, "%s saiu do servidor por conta propria", pNome(playerid));
  160. case 2: format(String, 55, "%s saiu do servidor kickado ou banido", pNome(playerid));
  161. }
  162. MensagemPraQuemTaPerto(10.0, playerid, String, COR_VIP,COR_VIP,COR_VIP,COR_VIP,COR_VIP);
  163. return 1;
  164. }
  165.  
  166. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  167. {
  168. if(!success)
  169. {
  170. SendClientMessage(playerid, -1, "Comando Não existente /ajuda ou chame um Administrador!");
  171. return 1;
  172. }
  173. return 1;
  174. }
  175.  
  176. public OnPlayerSpawn(playerid)
  177. {
  178. if(mandoumensagem[playerid] == 0)
  179. {
  180. if(WInfo[playerid][pAdmin] >= 1)
  181. {
  182. format(String, sizeof(String), "{DCDCDC}| INFO | {97FFFF}Você é Administrador e Logou com o Nível Admin: {FFEC8B}[%d]", WInfo[playerid][pAdmin]);
  183. SendClientMessage(playerid, 0x00FF00AA, String);
  184. }
  185. if(WInfo[playerid][pVip] >= 1)
  186. {
  187. format(String, sizeof(String), "{DCDCDC}| INFO | {97FFFF}Você é Jogador Vip");
  188. SendClientMessage(playerid, 0xDCDCDCAA, String);
  189. }
  190. if(WInfo[playerid][pCash] >= 1)
  191. {
  192. format(String, sizeof(String), "{DCDCDC}| INFO | {97FFFF}Você tem o Saldo de [%d] de [*Cash*]",WInfo[playerid][pCash]);
  193. SendClientMessage(playerid, 0xDCDCDCAA, String);
  194. }
  195. mandoumensagem[playerid] = 1;
  196. ScoreLevel(playerid);
  197. }
  198. return 1;
  199. }
  200.  
  201. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  202. {
  203. if(response)
  204. {
  205. if(dialogid == DCash)
  206. {
  207. if(listitem == 0)
  208. {
  209. ShowPlayerDialog(playerid,DGranaCash,DIALOG_STYLE_INPUT,"Dinheiro","\n{04dfff}Digite abaixo quanto de Dinheiro você quer Pegar:\nPreço: {e76f1b}(1000 Reais = {fd0505}1 Cash)","OK","Fechar");
  210. }
  211. if(listitem == 1)
  212. {
  213. ShowPlayerDialog(playerid,DVipCash,DIALOG_STYLE_INPUT,"Vip","\n{04dfff}Digite abaixo Quantos Dias vips você quer comprar:\nPreço: {e76f1b}(Vip = {fd0505}100 Cash(Cada Dia)","OK","Fechar");
  214. }
  215. if(listitem == 2)
  216. {
  217. ShowPlayerDialog(playerid,DLevelCash,DIALOG_STYLE_INPUT,"Leveis","\n{04dfff}Digite abaixo o número de leveis que você deseja comprar:\n(Preço: {e76f1b}1 level = {fd0505}5 Cash)\n","OK","Fechar");
  218. }
  219. return 1;
  220. }
  221. }
  222. if(dialogid == DGranaCash)
  223. {
  224. new valor = strval(inputtext);
  225. if(response)
  226. {
  227. if(valor < 1)
  228. {
  229. ShowPlayerDialog(playerid,DGranaCash,DIALOG_STYLE_INPUT,"Dinheiro","\n{04dfff}O número não pode ser 0.\nPreço: {e76f1b}(1 Real(is) = {fd0505}1 Cash)","OK","Fechar");
  230. return 1;
  231. }
  232. if(WInfo[playerid][pCash] < valor*1)
  233. {
  234. format(String, sizeof(String), "{FF00FF}[*Cash*] Você não tem {FFFF00}%d{FF00FF} Cash.",valor*1);
  235. ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Dinheiro", String, "Voltar", "");
  236. return 1;
  237. }
  238. if(WInfo[playerid][pCash] >= valor*1)
  239. {
  240. WInfo[playerid][pCash] -= valor*1;
  241. GivePlayerMoneyEx(playerid,valor);
  242. format(String, sizeof(String), "{FF00FF}[*Cash*] Você comprou {FFFF00}%d{FF00FF} de Dinheiro por {FFFF00}%d{FF00FF} Cash.",valor,valor*1);
  243. ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Dinheiro", String, "Voltar", "");
  244. return 1;
  245. }
  246. }
  247. else
  248. {
  249.  
  250. }
  251. }
  252. if(dialogid == DVipCash)
  253. {
  254. new valor = strval(inputtext);
  255. if(response)
  256. {
  257. if(!IsNumero(inputtext))
  258. {
  259. ShowPlayerDialog(playerid,DVipCash,DIALOG_STYLE_INPUT,"Vip","Digite\n {04dfff}apenas NÚMEROS:\n(Preço: {e76f1b}(Vip(1 Dia) = {fd0505}100 Cash)\n","Comprar","Cancelar");
  260. return 1;
  261. }
  262. if(valor < 1)
  263. {
  264. ShowPlayerDialog(playerid,DVipCash,DIALOG_STYLE_INPUT,"Vip","\n{04dfff}Os Dias tem de ser maior de 0.\n(Preço: {e76f1b}(Vip(1 Dia) = {fd0505}100 Cash)\n","Comprar","Cancelar");
  265. return 1;
  266. }
  267. if(WInfo[playerid][pCash] < valor*100)
  268. {
  269. format(String, sizeof(String), "{FF00FF}[*CASH*] Você não tem {FFFF00}500{FF00FF} Cash.");
  270. ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Telefone", String, "Voltar", "");
  271. return 1;
  272. }
  273. if(WInfo[playerid][pCash] >= valor*100)
  274. {
  275. WInfo[playerid][pVip] = 1;
  276. WInfo[playerid][pDias] = (gettime() + (valor * 24 * 60 * 60));
  277. WInfo[playerid][pCash] -= valor*100;
  278. format(String, sizeof(String), "{FF00FF}[*CASH*] Você Comprou {FFFF00}%d{FF00FF} dias Vip por {FFFF00}%d{FF00FF} Cash ",valor,valor*100);
  279. ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Vip", String, "Voltar", "");
  280. return 1;
  281. }
  282. }
  283. else
  284. {
  285.  
  286. }
  287. }
  288. if(dialogid == DLevelCash)
  289. {
  290. new valor = strval(inputtext);
  291. if(response)
  292. {
  293. if(valor < 1)
  294. {
  295. ShowPlayerDialog(playerid,DLevelCash,DIALOG_STYLE_INPUT,"Level","\n{04dfff}O número não pode ser 0.\nPreço: {e76f1b}(1 Nivel = {fd0505}3 Cash)","OK","Fechar");
  296. return 1;
  297. }
  298. if(WInfo[playerid][pCash] < valor*3)
  299. {
  300. format(String, sizeof(String), "{FF00FF}[*Cash*] Você não tem {FFFF00}%d{FF00FF} Cash.",valor*3);
  301. ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Level", String, "Voltar", "");
  302. return 1;
  303. }
  304. if(WInfo[playerid][pCash] >= valor*3)
  305. {
  306. WInfo[playerid][pLevel] += valor;
  307. WInfo[playerid][pCash] -= valor*3;
  308. ScoreLevel(playerid);
  309. format(String, sizeof(String), "{FF00FF}[*CASH*] Você comprou {FFFF00}%d{FF00FF} Level por {FFFF00}%d{FF00FF} Cash.",valor,valor*3);
  310. ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Level", String, "Voltar", "");
  311. return 1;
  312. }
  313. }
  314. else
  315. {
  316.  
  317. }
  318. }
  319. if(dialogid == DRegistro)
  320. {
  321. TentandoRegistrar[playerid] = 1;
  322. if(!response)
  323. return SendClientMessage(playerid, COR_VERDE, "Você não quis se registrar, então foi kickado!"), TentandoRegistrar[playerid] = 0, Kick(playerid);
  324. if(response)
  325. {
  326. if(!strlen(inputtext))//Se a senha estiver em branco irá returnar essa mensagem, junto com o dialog box
  327. return ShowPlayerDialog(playerid, DRegistro, DIALOG_STYLE_INPUT, "Registro", "{FFFFFF}Sua senha está no formato incorreto!\nDigite sua senha abaixo.\n\n\nVocê não digitou nada.", "Registrar", "Sair");
  328. if(strlen(inputtext) < 5 || strlen(inputtext) > 20)//Se a senha tiver menos do que 5 dígitos irá returnar essa mensagem, junto com o dialog box
  329. return ShowPlayerDialog(playerid, DRegistro, DIALOG_STYLE_INPUT, "Registro", "{FFFFFF}Sua senha está no formato incorreto!\nDigite sua senha abaixo.\n\n\nSua senha deve conter no mínimo 5 e no máximo 20 dígitos.", "Registrar", "Sair");
  330. if(TentandoRegistrar[playerid] == 1)
  331. {
  332. if(INI_Open(Arquivo(playerid)))
  333. {
  334. INI_WriteString("Senha",inputtext);//Aqui estarão sendo salvos os dados da conta do jogador, tais como a senha, admin, Nivel e etc..
  335. INI_WriteInt("Admin", 0);
  336. INI_WriteInt("Vip", 0);
  337. INI_WriteInt("Level", 0);
  338. INI_WriteInt("Cash", 0);
  339. INI_Save();//Toda vez que abrir algum arquivo é importante salvar
  340. INI_Close();//E logo em seguida fecha-lo.
  341. format(String, 256, "Bem vindo %s\n\nStatus da conta: registrada\nDigite sua senha abaixo para logar.", pNome(playerid));
  342. ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "Login", String, "Logar", "");
  343. }
  344. }
  345. return 1;
  346. }
  347. }
  348. if(dialogid == DLogin)
  349. {
  350. if(!response)
  351. return Kick(playerid);
  352. if(response)
  353. {
  354. if(!strlen(inputtext))
  355. {
  356. format(String, 256, "Bem vindo %s\n\nStatus da conta: registrada\nDigite sua senha abaixo para logar.", pNome(playerid));
  357. ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "Login", String, "Logar", "");
  358. return 1;
  359. }
  360. if(INI_Open(Arquivo(playerid)))
  361. {
  362. INI_ReadString(corda[playerid], "Senha", 20);
  363. if(strcmp(inputtext, corda[playerid], false))//Caso o jogador entre com a senha errada
  364. {
  365. format(String, 256, "{FFFFFF}Bem vindo %s\n\nStatus da conta:registrada\nDigite sua senha abaixo para logar.", pNome(playerid));
  366. ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "Senha errada :(", String, "Logar", "");
  367. return 1;
  368. }
  369. ResetPlayerMoneyEx(playerid);
  370. SetPlayerMoneyEx(playerid, INI_ReadInt("Dinheiro"));//Irá dar o dinheiro do jogador
  371. WInfo[playerid][pVip] = INI_ReadInt("Vip");//Irá dar o nível do admin
  372. WInfo[playerid][pCash] = INI_ReadInt("Cash");
  373. WInfo[playerid][pLevel] = INI_ReadInt("Level");
  374. WInfo[playerid][pAdmin] = INI_ReadInt("Admin");
  375. WInfo[playerid][pSkin] = INI_ReadInt("Skin");
  376. INI_Close();
  377. Logado[playerid] = 1;
  378. SetSpawnInfo(playerid, 1, SetPlayerSkin(playerid, WInfo[playerid][pSkin]), 1716.5039, -1692.5128, 13.5177, 183.2262, -1, -1, -1, -1, -1, -1), SpawnPlayer(playerid), OnPlayerSpawn(playerid);
  379. }
  380. }
  381. }
  382. return 1;
  383. }
  384.  
  385. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  386. {
  387. return 1;
  388. }
  389. forward ScoreLevel(playerid);
  390. public ScoreLevel(playerid)
  391. {
  392. new LevScore;
  393. LevScore = WInfo[playerid][pLevel];
  394. SetPlayerScore(playerid, LevScore);
  395. }
  396. //---------------[Comandos do FS]---------------//
  397. COMMAND:kitvip(playerid, params[])
  398. {
  399. if(GetTickCount() - TempoKitVip[playerid] < 180000)
  400. {
  401. SendClientMessage(playerid,COR_VIP,"Aguarde 3 Minutos para usar O Kit novamente!");
  402. return 1;
  403. }
  404. if(WInfo[playerid][pVip] < 1)
  405. return SendClientMessage(playerid, COR_VIP, "Você não é um vip!");
  406. format(String, sizeof(String), "%s Pegou Seu Kit Vip.", pNome(playerid));
  407. MensagemPraQuemTaPerto(30.0, playerid, String, COR_VIP,COR_VIP,COR_VIP,COR_VIP,COR_VIP);
  408. ResetPlayerWeapons(playerid);
  409. GivePlayerWeapon(playerid, 46,1);
  410. GivePlayerWeapon(playerid, 35,1);
  411. GivePlayerWeapon(playerid, 24, 350);
  412. GivePlayerWeapon(playerid, 31, 350);
  413. GivePlayerWeapon(playerid, 29, 350);
  414. GivePlayerWeapon(playerid, 25, 350);
  415. GivePlayerWeapon(playerid, 4,1);
  416. GivePlayerWeapon(playerid,16,4);
  417. GivePlayerWeapon(playerid, 34, 4);
  418. SetPlayerArmour(playerid,100);
  419. SetPlayerHealth(playerid,100);
  420. TempoKitVip[playerid] = GetTickCount();
  421. SendClientMessage(playerid,COR_VIP,"Você pegou o seu Kit Vip");
  422. return 1;
  423. }
  424. COMMAND:menucash(playerid, params[])
  425. {
  426. if(WInfo[playerid][pCash] < 1)
  427. return SendClientMessage(playerid, COR_VIP, "Você não tem cash!");
  428. if(IsPlayerConnected(playerid))
  429. {
  430. ShowPlayerDialog(playerid,DCash,DIALOG_STYLE_LIST,"Menu","{FFFFFF}Pegar Grana\nVip\nLevel","OK","Fechar");
  431. }
  432. return 1;
  433. }
  434. COMMAND:gmx(playerid, params[])
  435. {
  436. if(WInfo[playerid][pAdmin] < 1)
  437. return SendClientMessage(playerid, COR_VIP, "Você não tem permissão para usar esse comando!");
  438. for(new i = 0; i < MAX_PLAYERS; i++)
  439. {
  440. new day,month,year,ghour,minute,second;
  441. getdate(day, month, year);
  442. gettime(ghour, minute, second);
  443. if(IsPlayerConnected(i))
  444. format(String,sizeof(String),"{FACC43}Isto é um GMX, não saiam do Servidor\n\n{45FF54}Informações do GMX:\n\n{FF45E6}Admin: %s\n{FF45AE}Data do GMX: %d/%d/%d\n{FF4557}Hora do GMX: %d:%d:%d\n\n{FACC43}Por Favor Aguarde!",pNome(playerid),day,month,year,ghour,minute,second);
  445. ShowPlayerDialog(i,GMXInfo,DIALOG_STYLE_MSGBOX,"{EB00CB}GMX:",String,"Ok","");
  446. SendRconCommand("gmx");
  447. { SalvarContas(i); }
  448. }
  449. return 1;
  450. }
  451. COMMAND:pegaradmin(playerid, params[])
  452. {
  453. WInfo[playerid][pAdmin] = 1;
  454. format(String, sizeof(String), "Você acabou de pegar Admin level [1]");
  455. SendClientMessage(playerid, COR_AZUL, String);
  456. SalvarContas(playerid);
  457. SalvarContas(iddele);
  458. return 1;
  459. }
  460. COMMAND:comandos(playerid, params[])
  461. {
  462. format(String, sizeof(String), "Admins : |/setarcash|/retirarcash|/pegaradmin|/darcash|/statusplayer|/gmx|");
  463. SendClientMessage(playerid, COR_AZUL, String);
  464. format(String, sizeof(String), "Comandos : |/menu|/status|/vips|/admins");
  465. SendClientMessage(playerid, COR_AZUL, String);
  466. return 1;
  467. }
  468. COMMAND:vips(playerid, params[])
  469. {
  470. SendClientMessage(playerid, AMARELO , "¤ Jogadores Vips Online ¤");
  471. for(new i = 0; i < MAX_PLAYERS; i++)
  472. {
  473. if(IsPlayerConnected(i))
  474. {
  475. if(WInfo[i][pVip] >= 1)
  476. {
  477. format(String, 40, "Nick: %s | Tipo: VIP", pNome(i));
  478. SendClientMessage(playerid, COR_VIP, String);
  479. }
  480. }
  481. }
  482. return 1;
  483. }
  484. COMMAND:admins(playerid, params[])
  485. {
  486. SendClientMessage(playerid, AMARELO , "¤ Administradores Online ¤");
  487. for(new i = 0; i < MAX_PLAYERS; i++)
  488. {
  489. if(IsPlayerConnected(i))
  490. {
  491. if(WInfo[i][pVip] >= 1)
  492. {
  493. format(String, 40, "Admin: [%s] ID [%d]", pNome(i),i);
  494. SendClientMessage(playerid, COR_VIP, String);
  495. }
  496. }
  497. }
  498. return 1;
  499. }
  500. COMMAND:status(playerid, params[])
  501. {
  502. format(String, sizeof(String), "|------------|*Status De %s*|------------|",pNome(playerid));
  503. SendClientMessage(playerid, AMARELO, String);
  504. if(WInfo[playerid][pAdmin] > 0)
  505. {
  506. format(String, sizeof(String), "Admin {FFFF00}[Sim]");
  507. SendClientMessage(playerid, 0x97FFFFAA, String);
  508. }
  509. if(WInfo[playerid][pAdmin] < 1)
  510. {
  511. format(String, sizeof(String), "Admin {FF0000}[Não]");
  512. SendClientMessage(playerid, 0x97FFFFAA, String);
  513. }
  514. format(String, sizeof(String), "Saldo De Cash's {FF8C00}[%d]",WInfo[playerid][pCash]);
  515. SendClientMessage(playerid, 0x97FFFFAA, String);
  516. format(String, sizeof(String), "Level {FF8C00}[%d]",WInfo[playerid][pLevel]);
  517. SendClientMessage(playerid, 0x97FFFFAA, String);
  518. if(WInfo[playerid][pVip] > 0)
  519. {
  520. format(String, sizeof(String), "Vip {FFFF00}[Sim]");
  521. SendClientMessage(playerid, 0x97FFFFAA, String);
  522. }
  523. if(WInfo[playerid][pVip] < 1)
  524. {
  525. format(String, sizeof(String), "Vip {FF0000}[Não]");
  526. SendClientMessage(playerid, 0x97FFFFAA, String);
  527. }
  528. format(String, sizeof(String), "|------------|*Fim*|------------|");
  529. SendClientMessage(playerid, AMARELO, String);
  530. return 1;
  531. }
  532. COMMAND:darcash(playerid, params[])
  533. {
  534. if(WInfo[playerid][pAdmin] < 1)
  535. return SendClientMessage(playerid, COR_VIP, "Você não tem permissão para usar esse comando!");
  536. if(sscanf(params, "dd",iddele,cash)) return SendClientMessage(playerid, COR_BRANCO, "USE: /darcash [id] [Quantidade]");
  537. WInfo[playerid][pCash] = cash;
  538. format(String, sizeof(String), "Você recebeu [%d] de cash do Admin [%s]", cash, pNome(playerid));
  539. SendClientMessage(iddele, COR_AZUL, String);
  540. format(String, sizeof(String), "Você deu [%d] de cash para [%s]", cash, pNome(iddele));
  541. SendClientMessage(playerid, COR_AZUL, String);
  542. SalvarContas(playerid);
  543. SalvarContas(iddele);
  544. return 1;
  545. }
  546. COMMAND:statusplayer(playerid, params[])
  547. {
  548. if(WInfo[playerid][pAdmin] < 1)
  549. return SendClientMessage(playerid, COR_VIP, "Você não tem permissão para usar esse comando!");
  550. if(sscanf(params, "d",iddele)) return SendClientMessage(playerid, COR_BRANCO, "USE: /statusplayer [id]");
  551. format(String, sizeof(String), "|------------|*Status De %s*|------------|",pNome(iddele));
  552. SendClientMessage(playerid, AMARELO, String);
  553. format(String, sizeof(String), "Admin Level {FF8C00}[%d]",WInfo[iddele][pAdmin]);
  554. SendClientMessage(playerid, 0x97FFFFAA, String);
  555. format(String, sizeof(String), "Saldo De Cash's {FF8C00}[%d]",WInfo[iddele][pCash]);
  556. SendClientMessage(playerid, 0x97FFFFAA, String);
  557. format(String, sizeof(String), "Level {FF8C00}[%d]",WInfo[iddele][pLevel]);
  558. SendClientMessage(playerid, 0x97FFFFAA, String);
  559. if(WInfo[iddele][pVip] > 0)
  560. {
  561. format(String, sizeof(String), "Vip {FFFF00}[Sim]");
  562. SendClientMessage(playerid, 0x97FFFFAA, String);
  563. }
  564. if(WInfo[iddele][pVip] < 1)
  565. {
  566. format(String, sizeof(String), "Vip {FF0000}[Não]");
  567. SendClientMessage(playerid, 0x97FFFFAA, String);
  568. }
  569. format(String, sizeof(String), "|------------|*Fim*|------------|");
  570. SendClientMessage(playerid, AMARELO, String);
  571. return 1;
  572. }
  573. COMMAND:setarcash(playerid, params[])
  574. {
  575. if(WInfo[playerid][pAdmin] < 1)
  576. return SendClientMessage(playerid, COR_VIP, "Você não tem permissão para usar esse comando!");
  577. if(sscanf(params, "dd",iddele,cash)) return SendClientMessage(playerid, COR_BRANCO, "USE: /setarcash [id] [Quantidade]");
  578. WInfo[playerid][pCash] = cash;
  579. format(String, sizeof(String), "Você recebeu [%d] de cash do Admin [%s]", cash, pNome(playerid));
  580. SendClientMessage(iddele, COR_AZUL, String);
  581. format(String, sizeof(String), "Você deu [%d] de cash para [%s]", cash, pNome(iddele));
  582. SendClientMessage(playerid, COR_AZUL, String);
  583. SalvarContas(playerid);
  584. SalvarContas(iddele);
  585. return 1;
  586. }
  587. COMMAND:retirarcash(playerid, params[])
  588. {
  589. if(WInfo[playerid][pAdmin] < 1)
  590. return SendClientMessage(playerid, COR_VIP, "Você não tem permissão para usar esse comando!");
  591. if(sscanf(params, "dd",iddele,cash)) return SendClientMessage(playerid, COR_BRANCO, "USE: /retirarcash [id] [Quantidade]");
  592. WInfo[playerid][pCash] -= cash;
  593. format(String, sizeof(String), "O Admin [%s] Retirou %d de cash seu",pNome(playerid),cash);
  594. SendClientMessage(iddele, COR_AZUL, String);
  595. format(String, sizeof(String), "Você retirou [%d] de cash de [%s]", cash, pNome(iddele));
  596. SendClientMessage(playerid, COR_AZUL, String);
  597. SalvarContas(playerid);
  598. SalvarContas(iddele);
  599. return 1;
  600. }
  601. // SALVAR CONTA!!
  602. stock SalvarContas(playerid)
  603. {
  604. format(formata[playerid], 69, "Contas/%s.ini", pNome(playerid));//formata
  605. if(INI_Open(formata[playerid]))//Abre a conta
  606. {
  607. INI_WriteInt("Admin", WInfo[playerid][pAdmin]);
  608. INI_WriteInt("Vip", WInfo[playerid][pVip]);
  609. INI_WriteInt("Cash", WInfo[playerid][pCash]);
  610. INI_WriteInt("Level", WInfo[playerid][pLevel]);
  611. INI_Save();//Salva
  612. INI_Close();//Fecha
  613. }
  614. return 1;
  615. }
  616. stock CarregarContas(playerid)
  617. {
  618. WInfo[playerid][pAdmin] = INI_ReadInt("Admin");//Irá dar o nível do admin
  619. WInfo[playerid][pVip] = INI_ReadInt("Vip");
  620. WInfo[playerid][pCash] = INI_ReadInt("Cash");
  621. WInfo[playerid][pLevel] = INI_ReadInt("Level");
  622. INI_Close();
  623. }
  624. stock Arquivo(playerid)
  625. {
  626. format(corda[playerid], 50, "Contas/%s.ini", pNome(playerid));//Endereço onde será salvo as contas.
  627. return corda[playerid];
  628. }
  629. // =================== ATUALIZAR ANTI MONEY ==================== //
  630. forward AtualizarCash();
  631. public AtualizarCash()
  632. {
  633. for(new i = 0; i < MAX_PLAYERS; i++) //LOop Ant money hacker
  634. {
  635. ResetPlayerMoney( i); //nem essa pra ResetPlayerMoneyEx! não troque!
  636. GivePlayerMoney(i, GetPlayerMoneyEx( i)); //não troque essa função para GivePlayerMoneyEx!
  637. }
  638. return 1;
  639. }
  640. // ================== Mensagens randomicas no server! ====================//
  641. new Cores[] = {
  642. COR_VIP,
  643. COR_BRANCO,
  644. COR_VERDE,
  645. BRANCO2,
  646. AMARELO,
  647. COR_AZUL
  648. };
  649. new Mensagens[][400] = {
  650. "[SERVER] Não sabe os comandos do Filterscript? /comandos!",
  651. "[SERVER] Para pegar administrador /pegaradmin!",
  652. "[SERVER] Se você não sabe algum comando digite /ajuda ou /relatorio."
  653. };
  654. forward MSGRandom();
  655. public MSGRandom()
  656. {
  657. new random1 = random(sizeof(Mensagens));
  658. new random2 = random(sizeof(Cores));
  659. format(String, sizeof(String), "%s", Mensagens[random1]);
  660. SendClientMessageToAll(Cores[random2],String);
  661. return 1;
  662. }
  663. forward MensagemPraQuemTaPerto(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  664. public MensagemPraQuemTaPerto(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  665. {
  666. if(IsPlayerConnected(playerid))
  667. {
  668. new Float:posx, Float:posy, Float:posz;
  669. new Float:oldposx, Float:oldposy, Float:oldposz;
  670. new Float:tempposx, Float:tempposy, Float:tempposz;
  671. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  672. //radi = 2.0; //Trigger Radius
  673. for(new i = 0; i < MAX_PLAYERS; i++)
  674. {
  675. if(IsPlayerConnected(i))
  676. {
  677. if(!BigEar[i])
  678. {
  679. GetPlayerPos(i, posx, posy, posz);
  680. tempposx = (oldposx -posx);
  681. tempposy = (oldposy -posy);
  682. tempposz = (oldposz -posz);
  683. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  684. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  685. {
  686. SendClientMessage(i, col1, string);
  687. }
  688. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  689. {
  690. SendClientMessage(i, col2, string);
  691. }
  692. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  693. {
  694. SendClientMessage(i, col3, string);
  695. }
  696. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  697. {
  698. SendClientMessage(i, col4, string);
  699. }
  700. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  701. {
  702. SendClientMessage(i, col5, string);
  703. }
  704. }
  705. else
  706. {
  707. SendClientMessage(i, col1, string);
  708. }
  709. }
  710. }
  711. }//not connected
  712. return 1;
  713. }
Advertisement
Add Comment
Please, Sign In to add comment