Guest User

TDM - HomeHots

a guest
Jul 28th, 2014
1,472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.27 KB | None | 0 0
  1. // ----------------------------------
  2. //
  3. // Team Death-Math base.
  4. // Created by: Pocahontas.
  5. //
  6. // ----------------------------------
  7. #include a_samp
  8. #include sscanf2
  9. #include dof2
  10. #include zcmd
  11. #include streamer
  12.  
  13. enum
  14. {
  15. // Cores:
  16. Vermelho = 0xFF0000AA,
  17. Branco = -1,
  18. Cinza = 0xC0C0C0AA,
  19. Verde = 0x00FF00AA,
  20. Groove_Color = 0x0FEA1F96,
  21. Ballas_Color = 0xBC0EC096,
  22.  
  23. // Times:
  24. Groove_Street = 1,
  25. Ballas = 2,
  26.  
  27. // Dialog's:
  28. Login = 0,
  29. Registro = 1
  30. };
  31. enum PlayerInfo
  32. {
  33. Administrador,
  34. Matou,
  35. Morreu,
  36. Dinheiro,
  37. Banco,
  38. Team,
  39. bool:Logado
  40. };
  41. new Salvamento[MAX_PLAYERS][PlayerInfo];
  42. new Kill[MAX_PLAYERS];
  43. new String[128];
  44. new Pontuacao[3];
  45. new Veiculo[3][10];
  46.  
  47. forward BDD(playerid, action[], password[]); // Banco de Dados.
  48.  
  49. #define Comando:%1(%2,%3) CMD:%1(%2,%3)
  50. #define SendClientMessageToAllFormat(%0,%1,%2) format(String, sizeof String, %1, %2) && SendClientMessageToAll(%0, String)
  51. #define SendClientMessageFormat(%0,%1,%2,%3) format(String, sizeof String, %2, %3) && SendClientMessage(%0, %1, String)
  52. #define Nome_Projeto "Team death math - Base v0.1"
  53.  
  54. main()
  55. {
  56. print("\n----------------------------------");
  57. print(" TDM - BASE by Pocahontas");
  58. print("----------------------------------\n");
  59. }
  60.  
  61. public OnGameModeInit()
  62. {
  63. // Don't use these lines if it's a filterscript
  64. SetGameModeText("TDM");
  65. SendRconCommand("hostname "Nome_Projeto#);
  66. UsePlayerPedAnims();
  67. DisableInteriorEnterExits();
  68.  
  69. // Pickups:
  70. AddStaticPickup(1274, 23, 1480.8556, -1772.1321, 18.7958, -1);
  71. AddStaticPickup(-1, 23, 834.1981, 7.2459, 1004.1870, -1);
  72.  
  73. // 3D Texts:
  74. CreateDynamic3DTextLabel("Banco de Los Santos\nPrecione 'F' para entrar.", -1, 1480.8556, -1772.1321, 18.7958, 10.0);
  75. CreateDynamic3DTextLabel("Banco de Los Santos\nComandos Dísponiveis:\n/transferir - /transferiroff - /extrato - /sacar - /depositar.", -1, 834.1981, 7.2459, 1004.1870, 10.0);
  76. // Grove Street
  77. for(new loop = 105; loop < 108; loop ++)
  78. AddPlayerClass(loop, 2509.7781, -1674.8879, 13.5491, 50.8363, 24, 500, 30, 500, 28, 1500);
  79. // Ballas
  80. for(new loop = 102; loop < 105; loop ++)
  81. AddPlayerClass(loop, 1075.0508, -1204.6870, 18.0800, 180.9501, 24, 500, 30, 500, 28, 1500);
  82.  
  83. // Veículos Ballas:
  84. Veiculo[Ballas][0] = AddStaticVehicle(418,1085.7220,-1249.2032,15.9200,268.7770,5,5); // Veículo Ballas
  85. Veiculo[Ballas][1] = AddStaticVehicle(565,1085.1257,-1242.5172,15.4503,271.7016,5,5); // Veículo Ballas
  86. Veiculo[Ballas][2] = AddStaticVehicle(600,1085.7804,-1237.3239,15.5436,271.9027,5,5); // Veículo Ballas
  87. Veiculo[Ballas][3] = AddStaticVehicle(522,1087.5216,-1214.3868,17.3763,288.0798,5,5); // Veículo Ballas
  88. Veiculo[Ballas][4] = AddStaticVehicle(522,1087.6760,-1215.5813,17.3727,278.6648,5,5); // Veículo Ballas
  89. Veiculo[Ballas][5] = AddStaticVehicle(554,1092.4329,-1219.0280,17.8914,2.2093,5,5); // Veículo Ballas
  90. Veiculo[Ballas][6] = AddStaticVehicle(492,1097.9784,-1218.8232,17.5930,358.4544,5,5); // Veículo Ballas
  91. Veiculo[Ballas][7] = AddStaticVehicle(580,1104.0320,-1218.9852,17.6051,3.2421,5,5); // Veículo Ballas
  92. Veiculo[Ballas][8] = AddStaticVehicle(567,1110.3269,-1218.7145,17.6813,359.0785,5,5); // Veículo Ballas
  93. Veiculo[Ballas][9] = AddStaticVehicle(560,1085.6012,-1232.0308,15.7542,271.7858,5,5); // Veículo Ballas
  94.  
  95. // Veículos Groove Street:
  96. Veiculo[Groove_Street][0] = AddStaticVehicle(600,2484.4436,-1654.7025,13.0795,113.5418,86,86); // Veículo Groove Street
  97. Veiculo[Groove_Street][1] = AddStaticVehicle(560,2508.7129,-1660.2385,13.4829,92.9735,86,86); // Veículo Groove Street
  98. Veiculo[Groove_Street][2] = AddStaticVehicle(580,2485.0789,-1683.5950,13.2193,85.2037,86,86); // Veículo Groove Street
  99. Veiculo[Groove_Street][3] = AddStaticVehicle(565,2493.2585,-1683.2814,13.0326,87.2719,86,86); // Veículo Groove Street
  100. Veiculo[Groove_Street][4] = AddStaticVehicle(522,2500.4136,-1685.0634,13.0160,38.1701,86,86); // Veículo Groove Street
  101. Veiculo[Groove_Street][5] = AddStaticVehicle(522,2501.3826,-1684.1349,12.9967,37.6968,86,86); // Veículo Groove Street
  102. Veiculo[Groove_Street][6] = AddStaticVehicle(492,2510.3350,-1676.9670,13.3415,58.3662,86,86); // Veículo Groove Street
  103. Veiculo[Groove_Street][7] = AddStaticVehicle(567,2514.7153,-1671.9999,13.5861,68.0075,86,86); // Veículo Groove Street
  104. Veiculo[Groove_Street][8] = AddStaticVehicle(554,2512.5115,-1664.3812,13.6795,99.0274,86,86); // Veículo Groove Street
  105. Veiculo[Groove_Street][9] = AddStaticVehicle(418,2503.0981,-1654.8083,13.6077,109.3788,86,86); // Veículo Groove Street
  106. return 1;
  107. }
  108.  
  109. public OnGameModeExit()
  110. {
  111. DOF2_Exit();
  112. return 1;
  113. }
  114.  
  115. public OnPlayerRequestClass(playerid, classid)
  116. {
  117. SetPlayerCameraPos(playerid, 1024.4758,-2160.1909,39.8466);
  118. SetPlayerCameraLookAt(playerid, 1018.5209,-2160.5066,38.5108);
  119. SetPlayerPos(playerid, 1009.5659,-2161.0220,36.4699);
  120. SetPlayerFacingAngle(playerid, 273.9439);
  121. SetPlayerInterior(playerid, 0);
  122. switch( classid )
  123. {
  124. case 0..3: Salvamento[playerid][Team] = Groove_Street;
  125. case 4..6: Salvamento[playerid][Team] = Ballas;
  126. }
  127. format(String, sizeof String, "~r~%s", GetPlayerTeamName(playerid));
  128. GameTextForPlayer(playerid, String, 2000, 1);
  129. return ApplyAnimation(playerid, "PARK", "Tai_Chi_Loop", 4.0, 1, 0, 0, 0, 0);
  130. }
  131.  
  132.  
  133. public OnPlayerConnect(playerid)
  134. {
  135. new file[70];
  136. format(file, sizeof file, "Contas/%s.ini", Nome(playerid));
  137. Kill[playerid] = 0;
  138. Salvamento[playerid][Logado] = false;
  139. SetPlayerMapIcon(playerid, 52, 834.1981, 7.2459, 1004.1870, 52, 0, MAPICON_GLOBAL);
  140.  
  141. // ------------------------------------------------
  142. for(new clear; clear < 100; ++ clear) // Loop para executar a limpeza do chat.
  143. SendClientMessage(playerid, Branco, " ");
  144. // ------------------------------------------------
  145.  
  146. if(DOF2_FileExists(file))
  147. {
  148. ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, "Fazendo seu login:", "Conta cadastrada! Digite sua senha para entrar no servidor.", "Entrar", "Sair");
  149. }
  150. else
  151. {
  152. ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_PASSWORD, "Fazendo seu cadastro:", "Conta não cadastrada! Digite sua senha para se cadastrar no servidor.", "Cadastrar", "Sair");
  153. }
  154. SendClientMessage(playerid, Cinza, "OBS: Você precisa precionar 'T' antes de digitar algo.");
  155. return 1;
  156. }
  157.  
  158. public OnPlayerDisconnect(playerid, reason)
  159. {
  160. for(new i = 0; i < MAX_PLAYERS; i++)
  161. {
  162. if(Salvamento[i][Logado])
  163. {
  164. BDD(i, "Save", #);
  165. }
  166. }
  167. return 1;
  168. }
  169.  
  170. public OnPlayerSpawn(playerid)
  171. {
  172. if(!Salvamento[playerid][Logado]) return Kick(playerid);
  173. SetPlayerTeamColor(playerid);
  174. ResetPlayerMoney(playerid);
  175. GivePlayerMoney(playerid, Salvamento[playerid][Dinheiro]);
  176. return 1;
  177. }
  178.  
  179. public OnPlayerDeath(playerid, killerid, reason)
  180. {
  181. Salvamento[playerid][Morreu] --;
  182. Salvamento[killerid][Matou] ++;
  183. Kill[killerid] ++;
  184. Kill[playerid] = 0;
  185. Pontuacao[Salvamento[playerid][Team]] ++;
  186. if(Kill[playerid] >= 2)
  187. {
  188. SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Neutralizado ] %s", Nome(killerid), Nome(playerid));
  189. }
  190. else
  191. {
  192. switch( Kill[killerid] )
  193. {
  194. case 1: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Matou ] %s", Nome(killerid), Nome(playerid));
  195. case 2: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Double Kill ] %s", Nome(killerid), Nome(playerid));
  196. case 3: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Triple Kill ] %s", Nome(killerid), Nome(playerid));
  197. case 4: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Quadra Kill ] %s", Nome(killerid), Nome(playerid));
  198. case 5: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Penta Kill ] %s", Nome(killerid), Nome(playerid));
  199. case 6: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Hexa Kill ] %s", Nome(killerid), Nome(playerid));
  200. case 7..1000: SendClientMessageToAllFormat(Vermelho, "[Kill System] %s [ Chain Killer ] %s", Nome(killerid), Nome(playerid));
  201. }
  202. }
  203. return 1;
  204. }
  205.  
  206. public OnPlayerText(playerid, text[])
  207. {
  208. format(String, sizeof String, "[ Chat Team ] %s[ID:%d] diz: %s.", Nome(playerid), playerid, text);
  209. for(new i = 0; i < MAX_PLAYERS; i++)
  210. {
  211. if(Salvamento[i][Team] == Salvamento[playerid][Team])
  212. SendClientMessage(i, Branco, String);
  213. }
  214. return false;
  215. }
  216.  
  217. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  218. {
  219. switch( dialogid )
  220. {
  221. case Login:
  222. {
  223. if (!response) return ( Kick(playerid) );
  224. if (response) return ( cmd_login(playerid, inputtext) );
  225. }
  226. case Registro:
  227. {
  228. if (!response) return ( Kick(playerid) );
  229. if (response) return ( cmd_cadastrar(playerid, inputtext) );
  230. }
  231. }
  232. return true;
  233. }
  234.  
  235. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  236. {
  237. new newstate = GetPlayerState(playerid);
  238. if(newkeys == 16 && newstate == PLAYER_STATE_ONFOOT)
  239. {
  240. if(IsPlayerInRangeOfPoint(playerid, 2.0, 1480.8556, -1772.1321, 18.7958)) // Entrada Banco.
  241. {
  242. SetPlayerPos(playerid, 834.1981, 7.2459, 1004.1870);
  243. SetPlayerInterior(playerid, 3);
  244. SendClientMessage(playerid, Vermelho, "Você entrou no banco.");
  245. }
  246. if(IsPlayerInRangeOfPoint(playerid, 2.0, 834.1981, 7.2459, 1004.1870)) // Saída Banco.
  247. {
  248. SetPlayerPos(playerid, 1480.8556, -1772.1321, 18.7958);
  249. SetPlayerInterior(playerid, 0);
  250. SendClientMessage(playerid, Vermelho, "Você saiu do banco.");
  251. }
  252. }
  253. return true;
  254. }
  255.  
  256. public OnPlayerStateChange(playerid, newstate, oldstate)
  257. {
  258. new vehicle = GetPlayerVehicleID(playerid);
  259. if(newstate == PLAYER_STATE_DRIVER)
  260. {
  261. for(new v = 0; v < 10; v++)
  262. {
  263. if(vehicle == Veiculo[Groove_Street][v])
  264. {
  265. if(Salvamento[playerid][Team] != Groove_Street)
  266. return RemovePlayerFromVehicle(playerid);
  267. }
  268. if(vehicle == Veiculo[Ballas][v])
  269. {
  270. if(Salvamento[playerid][Team] != Ballas)
  271. return RemovePlayerFromVehicle(playerid);
  272. }
  273. }
  274. }
  275. return true;
  276. }
  277.  
  278. public BDD(playerid, action[], password[])
  279. {
  280. new file[70];
  281. format(file, sizeof file, "Contas/%s.ini", Nome(playerid));
  282. if(!strcmp(action, "Cadastro", true))
  283. {
  284. DOF2_CreateFile(file);
  285. DOF2_SetString(file, "Senha", password);
  286. DOF2_SetInt(file, "Administrador", 0);
  287. DOF2_SetInt(file, "Matou", 0);
  288. DOF2_SetInt(file, "Morreu", 0);
  289. DOF2_SetInt(file, "Dinheiro", 350);
  290. DOF2_SetInt(file, "Banco", 0);
  291. DOF2_SaveFile();
  292. Salvamento[playerid][Administrador] = DOF2_GetInt(file, "Administrador");
  293. Salvamento[playerid][Matou] = DOF2_GetInt(file, "Matou");
  294. Salvamento[playerid][Morreu] = DOF2_GetInt(file, "Morreu");
  295. Salvamento[playerid][Dinheiro] = DOF2_GetInt(file, "Dinheiro");
  296. Salvamento[playerid][Banco] = DOF2_GetInt(file, "Banco");
  297. SendClientMessage(playerid, Branco, "Seja bem vindo ao seu servidor!");
  298. Salvamento[playerid][Logado] = true;
  299. }
  300. if(!strcmp(action, "Login", true))
  301. {
  302. if(!strcmp(password, DOF2_GetString(file, "Senha"), true))
  303. {
  304. Salvamento[playerid][Administrador] = DOF2_GetInt(file, "Administrador");
  305. Salvamento[playerid][Matou] = DOF2_GetInt(file, "Matou");
  306. Salvamento[playerid][Morreu] = DOF2_GetInt(file, "Morreu");
  307. Salvamento[playerid][Dinheiro] = DOF2_GetInt(file, "Dinheiro");
  308. Salvamento[playerid][Banco] = DOF2_GetInt(file, "Banco");
  309. SendClientMessage(playerid, Branco, "Seja bem vindo ao seu servidor!");
  310. Salvamento[playerid][Logado] = true;
  311. }
  312. else
  313. {
  314. SendClientMessage(playerid, Cinza, "Senha incorreta, tente novamente ( /login )");
  315. }
  316. }
  317. if(!strcmp(action, "Save", true))
  318. {
  319. DOF2_SetInt(file, "Administrador", Salvamento[playerid][Administrador]);
  320. DOF2_SetInt(file, "Matou", Salvamento[playerid][Matou]);
  321. DOF2_SetInt(file, "Morreu", Salvamento[playerid][Morreu]);
  322. DOF2_SetInt(file, "Banco", Salvamento[playerid][Banco]);
  323. DOF2_SetInt(file, "Dinheiro", Salvamento[playerid][Dinheiro]);
  324. DOF2_SaveFile();
  325. }
  326. return true;
  327. }
  328. // ============================== [ Comandos ] ============================== //
  329. Comando:ajuda(playerid, params[])
  330. {
  331. SendClientMessage(playerid, Vermelho, " --------------------------------------------------------------------------------- ");
  332. SendClientMessage(playerid, Verde, "Comandos dísponiveis:");
  333. SendClientMessage(playerid, Branco, "Cadastro: /login - /cadastrar.");
  334. SendClientMessage(playerid, Branco, "Geral: /all - /admins - /report - /status - /criarveh - /placar.");
  335. SendClientMessage(playerid, Branco, "Banco: /transferir - /transferiroff - /extrato - /sacar - /depositar.");
  336. SendClientMessage(playerid, Vermelho, " --------------------------------------------------------------------------------- ");
  337. return true;
  338. }
  339.  
  340. Comando:placar(playerid, params[])
  341. {
  342. if(Pontuacao[Groove_Street] > Pontuacao[Ballas])
  343. {
  344. SendClientMessageFormat(playerid, Groove_Color, "A Groove Street lidera o TDM com o placar %d/%d.", Pontuacao[Groove_Street], Pontuacao[Ballas]);
  345. }
  346. else if(Pontuacao[Groove_Street] < Pontuacao[Ballas])
  347. {
  348. SendClientMessageFormat(playerid, Ballas_Color, "Os Ballas lidera o TDM com o placar %d/%d.", Pontuacao[Ballas], Pontuacao[Groove_Street]);
  349. }
  350. else if(Pontuacao[Groove_Street] == Pontuacao[Ballas])
  351. {
  352. SendClientMessageFormat(playerid, Branco, "O TDM está empatado com %d pontos para a Groove Street e %d pontos para os Ballas.", Pontuacao[Groove_Street], Pontuacao[Ballas]);
  353. }
  354. return true;
  355. }
  356.  
  357. Comando:criarveh(playerid, params[])
  358. {
  359. new v[3];
  360. new Float: p[4];
  361. if(sscanf(params,"iii",v[0],v[1],v[2]))
  362. return SendClientMessage(playerid, Cinza, "Sintaxe: /criarveh [model id] [color] [color]");
  363. GetPlayerPos(playerid, p[0], p[1], p[2]) && GetPlayerFacingAngle(playerid, p[3]);
  364. CreateVehicle(v[0],p[0],p[1],p[2],p[3],v[1],v[2],-1);
  365. return true;
  366. }
  367.  
  368. Comando:status(playerid, params[])
  369. return SendClientMessage(playerid, Branco, " ") && SendClientMessageFormat(playerid, Branco, "Dinheiro: [$%d] Banco: [$%d] Matou/Morreu: [%d/%d]", Salvamento[playerid][Dinheiro], Salvamento[playerid][Banco], Salvamento[playerid][Matou], Salvamento[playerid][Morreu]) && SendClientMessage(playerid, Branco, " ");
  370.  
  371. Comando:admins(playerid, params[])
  372. {
  373. SendClientMessage(playerid, Vermelho, "Administradores Online:");
  374. for(new i = 0; i < MAX_PLAYERS; i++)
  375. {
  376. if(Salvamento[i][Administrador] > 0)
  377. SendClientMessageFormat(playerid, Branco, "[ADMIN]: %s Nivel: [%d]", Nome(i), Salvamento[i][Administrador]);
  378. }
  379. return true;
  380. }
  381.  
  382. Comando:report(playerid, params[])
  383. {
  384. new text[128];
  385. if(!Salvamento[playerid][Logado])
  386. return SendClientMessage(playerid, Cinza, "Você ainda não está logado.");
  387. if(sscanf(params, "s[128]", text))
  388. return SendClientMessage(playerid, Cinza, "Sintaxe: /report [text]");
  389. for(new i = 0; i < MAX_PLAYERS; i++)
  390. {
  391. if(Salvamento[i][Administrador] > 0)
  392. SendClientMessageFormat(i, Vermelho, "[REPORT] %s[ID:%d] reportou: %s.", Nome(playerid), playerid, text);
  393. }
  394. SendClientMessage(playerid, Cinza, "Report enviado para os administradores online.");
  395. return true;
  396. }
  397.  
  398. Comando:all(playerid, params[])
  399. {
  400. new text[300];
  401. if(!Salvamento[playerid][Logado])
  402. return SendClientMessage(playerid, Cinza, "Você não está logado.");
  403. if(sscanf(params, "s[300]", text))
  404. return SendClientMessage(playerid, Cinza, "Sintaxe: /all [mensagem]");
  405. SendClientMessageToAllFormat(Verde, "[ Chat All ] %s[ID:%d] diz: %s.", Nome(playerid), playerid, text);
  406. return true;
  407. }
  408.  
  409. Comando:cadastrar(playerid, params[])
  410. {
  411. new password[50];
  412. new file[70];
  413. format(file, sizeof file, "Contas/%s.ini", Nome(playerid));
  414. if(DOF2_FileExists(file))
  415. return SendClientMessage(playerid, Cinza, "Conta já existente.");
  416. if(sscanf(params,"s[50]",password))
  417. return SendClientMessage(playerid, Cinza, "Sintaxe: /cadastrar [password]");
  418. if(!strlen(password))
  419. return SendClientMessage(playerid, Cinza, "Digite uma senha.");
  420. BDD(playerid, "Cadastro", password);
  421. return true;
  422. }
  423.  
  424. Comando:login(playerid, params[])
  425. {
  426. new password[50];
  427. new file[70];
  428. format(file, sizeof file, "Contas/%s.ini", Nome(playerid));
  429. if(!DOF2_FileExists(file))
  430. return SendClientMessage(playerid, Cinza, "Conta não existente.");
  431. if(Salvamento[playerid][Logado])
  432. return SendClientMessage(playerid, Cinza, "Você já está logado.");
  433. if(sscanf(params,"s[50]",password))
  434. return SendClientMessage(playerid, Cinza, "Sintaxe: /login [password]");
  435. if(!strlen(password))
  436. return SendClientMessage(playerid, Cinza, "Digite uma senha.");
  437. BDD(playerid, "Login", password);
  438. return true;
  439. }
  440. // Comandos Banco:
  441. Comando:transferir(playerid, params[])
  442. {
  443. new parametro[2];
  444. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 834.1981, 7.2459, 1004.1870))
  445. return SendClientMessage(playerid, Cinza, "[ERRO] Você não está no banco.");
  446. if(sscanf(params, "ii", parametro[0], parametro[1]))
  447. return SendClientMessage(playerid, Cinza, "Sintaxe: /transferir [playerid] [quantia]");
  448. if(parametro[0] == playerid)
  449. return SendClientMessage(playerid, Cinza, "[ERRO] Você não pode transferir dinheiro para si mesmo.");
  450. if(!IsPlayerConnected(parametro[0]))
  451. return SendClientMessage(playerid, Cinza, "[ERRO] Jogador não conectado, use /transferiroff.");
  452. if(parametro[1] > Salvamento[playerid][Banco])
  453. return SendClientMessage(playerid, Cinza, "[ERRO] Você não possuí esta quantia.");
  454. Salvamento[playerid][Banco] -= parametro[1];
  455. Salvamento[parametro[0]][Banco] += parametro[1];
  456. SendClientMessageFormat(playerid, Branco, "Você transferiu $%d para o jogador %s.", parametro[1], Nome(parametro[0]));
  457. SendClientMessageFormat(parametro[0], Branco, "Você recebeu $%d do jogador %s em uma transferencia bancaria.", parametro[1], Nome(playerid));
  458. return true;
  459. }
  460.  
  461. Comando:transferiroff(playerid, params[])
  462. {
  463. new quantia;
  464. new jogador[MAX_PLAYER_NAME];
  465. new file[70];
  466. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 834.1981, 7.2459, 1004.1870))
  467. return SendClientMessage(playerid, Cinza, "[ERRO] Você não está no banco.");
  468. if(sscanf(params, "s[24]i", jogador, quantia))
  469. return SendClientMessage(playerid, Cinza, "Sintaxe: /transferiroff [nome do jogador] [quantia] ( Só use se o jogador estiver offline, caso contrario seu dinheiro será perdido. )");
  470. if(quantia > Salvamento[playerid][Banco])
  471. return SendClientMessage(playerid, Cinza, "[ERRO] Você não possuí esta quantia.");
  472. format(file, sizeof file, "Contas/%s.ini", jogador);
  473. DOF2_SetInt(file, "Banco", quantia);
  474. DOF2_SaveFile();
  475. Salvamento[playerid][Banco] -= quantia;
  476. SendClientMessageFormat(playerid, Branco, "Você transferiu $%d para o jogador %s.", quantia, jogador);
  477. return true;
  478. }
  479.  
  480. Comando:extrato(playerid, params[])
  481. {
  482. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 834.1981, 7.2459, 1004.1870))
  483. return SendClientMessage(playerid, Cinza, "[ERRO] Você não está no banco.");
  484. SendClientMessageFormat(playerid, Cinza, "Você possuí $%d,00 na sua conta bancária.", Salvamento[playerid][Banco]);
  485. return true;
  486. }
  487.  
  488. Comando:sacar(playerid, params[])
  489. {
  490. new quantia;
  491. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 834.1981, 7.2459, 1004.1870))
  492. return SendClientMessage(playerid, Cinza, "[ERRO] Você não está no banco.");
  493. if(sscanf(params,"i",quantia))
  494. return SendClientMessage(playerid, Cinza, "Sintaxe: /sacar [quantia]");
  495. if(quantia > Salvamento[playerid][Banco])
  496. return SendClientMessage(playerid, Cinza, "[ERRO] Você não possuí esta quantia.");
  497. Salvamento[playerid][Banco] -= quantia;
  498. Salvamento[playerid][Dinheiro] += quantia;
  499. SendClientMessageFormat(playerid, Cinza, "Você sacou $%d,00.", quantia);
  500. GivePlayerMoney(playerid, quantia);
  501. return true;
  502. }
  503.  
  504. Comando:depositar(playerid, params[])
  505. {
  506. new quantia;
  507. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 834.1981, 7.2459, 1004.1870))
  508. return SendClientMessage(playerid, Cinza, "[ERRO] Você não está no banco.");
  509. if(sscanf(params,"i",quantia))
  510. return SendClientMessage(playerid, Cinza, "Sintaxe: /depositar [quantia]");
  511. if(quantia > Salvamento[playerid][Dinheiro])
  512. return SendClientMessage(playerid, Cinza, "[ERRO] Você não possuí esta quantia.");
  513. Salvamento[playerid][Banco] += quantia;
  514. Salvamento[playerid][Dinheiro] -= quantia;
  515. SendClientMessageFormat(playerid, Cinza, "Você depositou $%d,00.", quantia);
  516. GivePlayerMoney(playerid, -quantia);
  517. return true;
  518. }
  519. //
  520. stock Nome(playerid)
  521. {
  522. new givename[MAX_PLAYER_NAME];
  523. GetPlayerName(playerid, givename, sizeof givename);
  524. return ( givename );
  525. }
  526.  
  527. stock GetPlayerTeamName(playerid)
  528. {
  529. new team_name[20];
  530. switch( Salvamento[playerid][Team] )
  531. {
  532. case Groove_Street: team_name = "Groove Street";
  533. case Ballas: team_name = "Ballas";
  534. }
  535. return ( team_name );
  536. }
  537.  
  538. stock SetPlayerTeamColor(playerid)
  539. {
  540. switch( Salvamento[playerid][Team] )
  541. {
  542. case Groove_Street: SetPlayerColor(playerid, Groove_Color);
  543. case Ballas: SetPlayerColor(playerid, Ballas_Color);
  544. }
  545. return true;
  546. }
Advertisement
Add Comment
Please, Sign In to add comment