Advertisement
Guest User

[FS] Roubar Caixa

a guest
May 8th, 2022
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #include <a_samp>
  3. #include <a_samp>
  4. #include <DOF2>
  5. #include <zcmd>
  6. #include <streamer>
  7. #include <sscanf2>
  8. #if defined FILTERSCRIPT
  9.  
  10. #define function%0(%1) forward %0(%1); public %0(%1);
  11. #define COLOR_RED 0xFF0000FF
  12.  
  13.  
  14. enum pInfo
  15. {
  16. Ladrao,
  17. Roubou
  18. }
  19. new PlayerInfo[MAX_PLAYERS][pInfo];
  20.  
  21. forward RoubandoCaixa(playerid);
  22.  
  23. new Str[144];
  24.  
  25.  
  26.  
  27. public OnFilterScriptInit()
  28. {
  29. //=-=-=-=-=-=-=-=-= Caixas =-=-=-=-=-=-=-=-=//
  30. CreateObject(2942, 2941.12231, -1023.85358, 11.41078, 0.00000, 0.00000, 86.46001);//1
  31. CreateObject(2942, 2941.15088, -1025.81519, 11.41078, 0.00000, 0.00000, 86.46001);//2
  32. CreateObject(2942, 2941.20190, -1021.55511, 11.41078, 0.00000, 0.00000, 86.46001);//3
  33. //=-=-=-=-=-=-=-=-= 3D =-=-=-=-=-=-=-=-=//
  34. Create3DTextLabel("Caixa 1'\n use:/roubar",0x5EAF03FF,2941.8210,-1025.9080,11.8258,10.0,0);//caixa1
  35. Create3DTextLabel("Caixa 2'\n use:/roubar",0x5EAF03FF,2941.7786,-1023.9998,11.8258,10.0,0);//caixa2
  36. Create3DTextLabel("Caixa 3'\n use:/roubar",0x5EAF03FF,2941.8572,-1021.6834,11.8258,10.0,0);//caixa3
  37. //=-=-=-=-=-=-=-=-= Pickup =-=-=-=-=-=-=-=-=//
  38. CreatePickup(1274, 1, 2941.8210,-1025.9080,11.8258,0);//caixa1
  39. CreatePickup(1274, 1, 2941.7786,-1023.9998,11.8258,0);//caixa2
  40. CreatePickup(1274, 1, 2941.8572,-1021.6834,11.8258,0);//caixa3
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. DOF2_Exit();
  47. return 1;
  48. }
  49. public OnPlayerConnect(playerid)
  50. {
  51. new arquivo[34], playername[MAX_PLAYER_NAME];
  52. GetPlayerName(playerid, playername, sizeof(playername));
  53. format(arquivo, sizeof(arquivo), "Roubos/%s", playername);
  54.  
  55.  
  56. PlayerInfo[playerid][Ladrao] = DOF2_GetInt(arquivo, "Ladrao");
  57. PlayerInfo[playerid][Roubou] = DOF2_GetInt(arquivo, "Roubou");
  58. return 1;
  59. }
  60. public OnPlayerDisconnect(playerid, reason)
  61. {
  62. new arquivo[34], playername[MAX_PLAYER_NAME];
  63. GetPlayerName(playerid, playername, sizeof(playername));
  64. format(arquivo, sizeof(arquivo), "Roubos/%s", playername);
  65. if(DOF2_FileExists(arquivo))
  66. {
  67. DOF2_SetInt(arquivo, "Ladrao", PlayerInfo[playerid][Ladrao]);
  68. DOF2_SetInt(arquivo, "Roubou", PlayerInfo[playerid][Roubou]);
  69. }
  70. else
  71. {
  72. DOF2_CreateFile(arquivo);
  73. DOF2_SetInt(arquivo, "Ladrao", PlayerInfo[playerid][Ladrao]);
  74. DOF2_SetInt(arquivo, "Roubou", PlayerInfo[playerid][Roubou]);
  75. }
  76. return 1;
  77. }
  78.  
  79. CMD:roubar(playerid)
  80. {
  81. SetTimerEx("RoubandoCaixa", 10000, false, "i", playerid);
  82. GameTextForPlayer(playerid, "Roubando!", 10000, 5);
  83. TogglePlayerControllable(playerid,0);
  84. format(Str, sizeof(Str), "[ INFO ] O Player[%s][%d] Esta Roubando o banco central!", GetPlayerNameEx(playerid), playerid);
  85. SendClientMessageToAll(-1, Str);
  86. SendClientMessage(playerid, COLOR_RED, "A policia foi alertada!");
  87. return 1;
  88. }
  89. public RoubandoCaixa(playerid)
  90. {
  91. format(Str, sizeof(Str), "[ INFO ] O Player[%s][%d] Conseguiu Roubar o Banco Central", GetPlayerNameEx(playerid), playerid);
  92. SendClientMessageToAll(-1, Str);
  93. GivePlayerMoney(playerid, 10000);
  94. TogglePlayerControllable(playerid,1);
  95. return 1;
  96. }
  97. stock GetPlayerNameEx(playerid)
  98. {
  99. new PlayerName[MAX_PLAYER_NAME];
  100. GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  101. return PlayerName;
  102. }
  103. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement