Hashing

Problema

Mar 30th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3. #include sscanf
  4. #include dini
  5.  
  6.  
  7. #define Cor_PMilitar 0x4169E199
  8. #define Cor_Groove 0x00FF0099
  9. #define Cor_Ballas 0xA020F099
  10. #define Branco 0xFFFFFFFF
  11. enum Info
  12. {
  13. PMilitar,
  14. Groove,
  15. Ballas
  16. };
  17.  
  18. new PlayerInfo[MAX_PLAYERS][Info];
  19. new VPMilitar[5];
  20. public OnGameModeInit()
  21. {
  22. VPMilitar[0] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 0
  23. VPMilitar[1] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 1
  24. VPMilitar[2] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 2
  25. VPMilitar[3] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 3
  26. }
  27. CMD:convidar(playerid, params[])
  28. {
  29. new id;
  30. if(sscanf(params, "d", id)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
  31. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
  32.  
  33. if(PlayerInfo[playerid][PMilitar] >= 6)
  34. {
  35. PlayerInfo[id][PMilitar] = 1;
  36. SendClientMessage(id, Branco, "Você entrou à Polícia Militar");
  37. SetPlayerColor(id, Cor_PMilitar);
  38. }
  39. else if(PlayerInfo[playerid][Groove] >= 6)
  40. {
  41. PlayerInfo[id][Groove] = 1;
  42. SendClientMessage(id, Branco, "Você entrou à Groove");
  43. SetPlayerColor(id, Cor_Groove);
  44. }
  45. else if(PlayerInfo[playerid][Ballas] >= 6)
  46. {
  47. PlayerInfo[id][Ballas] = 1;
  48. SendClientMessage(id, Branco, "Você entrou aos Ballas");
  49. SetPlayerColor(id, Cor_Ballas);
  50. }
  51. return 1;
  52. }
  53.  
  54. new string[128], promovedor[MAX_PLAYER_NAME];
  55.  
  56. CMD:promover(playerid, params[])
  57. {
  58.  
  59. new id, cargo;
  60. if(sscanf(params, "dd", id, cargo)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
  61. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
  62. if(cargo < 1 || cargo > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
  63. GetPlayerName(playerid, promovedor, sizeof(promovedor));
  64. }
  65. if(PlayerInfo[playerid][PMilitar] >= 6)
  66. {
  67. if(PlayerInfo[id][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
  68. PlayerInfo[id][PMilitar] = cargo;
  69. SendClientMessage(id, Branco, string);
  70. }
  71. else if(PlayerInfo[id][Groove] >= 6)
  72. {
  73. if(PlayerInfo[id][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
  74. PlayerInfo[id][Groove] = cargo;
  75. SendClientMessage(id, Branco, string);
  76. }
  77. else if(PlayerInfo[playerid][Ballas] >= 6)
  78. {
  79. if(PlayerInfo[id][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
  80. PlayerInfo[id][Ballas] = cargo;
  81. format(string, sizeof(string), "Você foi promovido a cargo %d por %s", cargo, promovedor);
  82. SendClientMessage(id, Branco, string);
  83. }
  84. return 1;
  85. }
  86.  
  87. public OnPlayerStateChange(playerid, newstate, oldstate)
  88. {
  89. if(newstate == PLAYER_STATE_DRIVER) VerificarVeiculo(playerid);
  90. {
  91. }
  92. return 1;
  93. }
  94. forward VerificarVeiculo(playerid);
  95. public VerificarVeiculo(playerid)
  96. {
  97. for(new c = 0; c <= 4; c++)
  98. if(IsPlayerInVehicle(playerid, VPMilitar[c]) && PlayerInfo[playerid][PMilitar] < 1)
  99. {
  100. SendClientMessage(playerid, Branco, "Você não é da Policia Militar");
  101. RemovePlayerFromVehicle(playerid);
  102. }
  103. return 1;
  104. }
  105. forward SalvarOrg(playerid);
  106. public SalvarOrg(playerid)
  107. {
  108. new arquivo[60], nome[MAX_PLAYER_NAME];
  109. GetPlayerName(playerid, nome, sizeof(nome));
  110. format(arquivo, sizeof(arquivo), "Contas\%s.ini", nome);
  111. }
  112. if(!dini_Exists(arquivo))
  113. {
  114. dini_Create(arquivo);
  115. }
  116. if(PlayerInfo[playerid][PMilitar] > 0) dini_IntSet(arquivo, "PMilitar", PlayerInfo[playerid][PMilitar]);
  117. if(PlayerInfo[playerid][Groove] > 0) dini_IntSet(arquivo, "Groove", PlayerInfo[playerid][Groove]);
  118. if(PlayerInfo[playerid][Ballas] > 0) dini_IntSet(arquivo, "Ballas", PlayerInfo[playerid][Ballas]);
  119. {
  120. return 1;
  121. }
Advertisement
Add Comment
Please, Sign In to add comment