Advertisement
Guest User

[FS] Sistema de Roubo v1.0

a guest
Aug 22nd, 2011
1,419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MaxPlayers (20) // Quantidade total de player em seu servidor
  4.  
  5. #define cX 153.1188 // Coordenada X do roubo
  6. #define cY -64.5729 // Coordenada Y do roubo
  7. #define cZ 1.5781 // Coordenada Z do roubo
  8.  
  9. #define IconeRoubo 1274
  10. #define PickupCor 0x008080FF
  11.  
  12. #define TempoRoubo 1 // Tempo em minutos para esperar o roubo ser concluído
  13. #define AReceber 10000 // Valor em dólares que o ladrão irá receber
  14.  
  15. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  16.  
  17. static Roubando[MaxPlayers];
  18.  
  19. forward Roubou(playerid);
  20.  
  21. public OnFilterScriptInit()
  22. {
  23. print("\n~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~");
  24. print(" [FS] Roubar\n");
  25. print(" [KoS] Shickcard\n");
  26. print("~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n");
  27. CreatePickup(IconeRoubo, 1, cX, cY, cZ, -1);
  28. Create3DTextLabel("Cofre", PickupCor, cX, cY, cZ, 30.0, 0);
  29. return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34. for(new i=0; i<MaxPlayers; i++)
  35. {
  36. Roubando[i] = 0;
  37. }
  38. return 1;
  39. }
  40.  
  41. main()
  42. {
  43. print("\n~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~");
  44. print(" [FS] Roubar\n");
  45. print(" [KoS] Shickcard\n");
  46. print("~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n");
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51. Roubando[playerid] = 0;
  52. return 1;
  53. }
  54.  
  55. public OnPlayerDisconnect(playerid, reason)
  56. {
  57. Roubando[playerid] = 0;
  58. return 1;
  59. }
  60.  
  61. public OnPlayerSpawn(playerid)
  62. {
  63. Roubando[playerid] = 0;
  64. return 1;
  65. }
  66.  
  67. public OnPlayerDeath(playerid, killerid, reason)
  68. {
  69. static Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
  70. GetPlayerName(killerid, Matou, sizeof(Matou));
  71. GetPlayerName(playerid, Morreu, sizeof(Morreu));
  72. format(sStr, sizeof(sStr), "[NOTÍCIAS] %s[%d] matou o ladrão %s[%d]", Matou, killerid, Morreu, playerid);
  73. if(Roubando[playerid] == 1)
  74. {
  75. SendClientMessage(playerid, 0xE31919FF, "[~] Você morreu quando estava roubando!");
  76. Roubando[playerid] = 0;
  77. return 1;
  78. }
  79. if(Roubando[killerid] == 1)
  80. {
  81. SendClientMessage(playerid, 0xE31919FF, "[~] Você matou o ladrão!");
  82. Roubando[killerid] = 0;
  83. return 1;
  84. }
  85. return 1;
  86. }
  87.  
  88. public OnPlayerCommandText(playerid, cmdtext[])
  89. {
  90. dcmd(creditosfs, 10, cmdtext);
  91. return 0;
  92. }
  93.  
  94. public OnPlayerPickUpPickup(playerid, pickupid)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  100. {
  101. if(newkeys == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, cX, cY, cZ)) // Tecla » [ \| ]
  102. {
  103. static Ladrao[MAX_PLAYER_NAME], sStr[70];
  104. GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
  105. if(Roubando[playerid] == 1) return SendClientMessage(playerid, 0xE31919FF, "[~] Você já está assaltando!");
  106. format(sStr, sizeof(sStr), "[NOTÍCIAS] %s[%d] está roubando um local!", Ladrao, playerid);
  107. SendClientMessageToAll(0xE31919FF, sStr);
  108. format(sStr, sizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!", TempoRoubo);
  109. SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1);
  110. SendClientMessage(playerid, 0xC9C9C9FF, sStr);
  111. SetTimer("Roubou", 60000*TempoRoubo, false);
  112. Roubando[playerid] = 1;
  113. return 1;
  114. }
  115. return 1;
  116. }
  117.  
  118. public Roubou(playerid)
  119. {
  120. new Grana = random(AReceber);
  121. static Ladrao[MAX_PLAYER_NAME], sStr[100];
  122. GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
  123. GivePlayerMoney(playerid, Grana);
  124. format(sStr, sizeof(sStr), "[NOTÍCIAS] A Polícia demorou e %s[%d] conseguiu roubar o local!", Ladrao, playerid);
  125. SendClientMessageToAll(0xE31919FF, sStr);
  126. Roubando[playerid] = 0;
  127. return 1;
  128. }
  129.  
  130. dcmd_creditosfs(playerid, params[])
  131. {
  132. #pragma unused params
  133. SendClientMessage(playerid, 0xC9C9C9FF, "~. Créditos do FS a [KoS]Shickcard .~");
  134. return 1;
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement