Advertisement
GiromB

GiromB Vip sistem ( G-VIP)

Jan 11th, 2017
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.45 KB | None | 0 0
  1.  
  2. /* -=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-==-=-=-=-=-=-=-=-=-=-
  3. POR FAVOR NÃO REMOVA OS CRÉDITOS
  4.  
  5.  
  6. PERFIL: http://forum.sa-mp.com/member.php?u=286494
  7.  
  8. MY WORK'S
  9. http://forum.sa-mp.com/showthread.php?t=626051
  10.  
  11. Meu skype:
  12.  
  13. krazy.samp
  14.  
  15. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=*/
  16.  
  17. #include <a_samp>
  18. #include <ZCMD>
  19. #include <sscanf2>
  20. #include <DOF2>
  21.  
  22.  
  23. main()
  24. {
  25. return 0;
  26. }
  27.  
  28. // DEFINES
  29. #define vcmds 10
  30.  
  31. // ENUM'S E VARIAVEIS
  32. enum GVIP
  33. {
  34. gLevel,
  35. gDias,
  36. }
  37.  
  38. new GiromBVip[MAX_PLAYERS][GVIP];
  39. new bool:Vida[MAX_PLAYERS];
  40. new bool:Colete[MAX_PLAYERS];
  41.  
  42. // FORWARD'S
  43.  
  44. forward GiromBaVerificada(playerid);
  45.  
  46.  
  47. public OnFilterScriptInit()
  48. {
  49. SetTimer("GiromBaVerificada", 60000, true);
  50.  
  51. print("\n------------------------|-----------------------------");
  52. print("|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|§ISTEMA G-VIP|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|");
  53. print("|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|CRIADO POR GiromB|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|");
  54. print("|¨¨¨¨¨¨¨¨¨¨¨¨¨¨|Não Remova os Créditos |¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|");
  55. print("--------------------------|------------------------------\n");
  56. return 1;
  57. }
  58.  
  59.  
  60. public OnFilterScriptExit()
  61. {
  62. DOF2_Exit();
  63. return 1;
  64. }
  65.  
  66. public OnPlayerDisconnect(playerid, reason)
  67. {
  68. Vida[playerid] = false;
  69. Colete[playerid] = false;
  70. GiromBVip[playerid][gLevel] = 0;
  71. return 0;
  72. }
  73.  
  74. public OnPlayerConnect(playerid)
  75. {
  76. new GiromBArquivos[100], NomeVip[24];
  77.  
  78. GetPlayerName(playerid, NomeVip, sizeof(NomeVip));
  79. format(GiromBArquivos, sizeof(GiromBArquivos), "GVips/%s.ini", NomeVip);
  80.  
  81. if(PlayerVip(playerid)){
  82.  
  83. GiromBVip[playerid][gDias] = DOF2_GetInt(GiromBArquivos, "Dias");
  84.  
  85. if(gettime() >= GiromBVip[playerid][gDias]){
  86.  
  87. SendClientMessage(playerid, -1, "[INFO] O seu tempo de vip expirou, você não é mais um jogador vip.");
  88. GiromBVip[playerid][gLevel] = 0;
  89. DOF2_RemoveFile(GiromBArquivos);
  90.  
  91. } else {
  92.  
  93. GiromBVip[playerid][gLevel] = DOF2_GetInt(GiromBArquivos, "Level");
  94. SendClientMessage(playerid, -1, "[INFO] Você é um jogador VIP");
  95.  
  96. }
  97. }
  98.  
  99. Vida[playerid] = false;
  100. Colete[playerid] = false;
  101.  
  102. return 0;
  103. }
  104.  
  105. public OnPlayerSpawn(playerid)
  106. {
  107. Vida[playerid] = false;
  108. Colete[playerid] = false;
  109. return 1 ;
  110. }
  111.  
  112. public OnPlayerDeath(playerid, killerid, reason)
  113. {
  114. Vida[playerid] = false;
  115. Colete[playerid] = false;
  116. return 1;
  117. }
  118.  
  119. public OnPlayerText(playerid, text[])
  120. {
  121. if(GiromBVip[playerid][gLevel] >= 1)
  122. {
  123. new Vchat[180], NomeVip[MAX_PLAYER_NAME];
  124. GetPlayerName(playerid, NomeVip, sizeof(NomeVip));
  125. format(Vchat, sizeof(Vchat), "%s {00FF00}[VIP] {FFFFFF}[%i]: %s",NomeVip,playerid, text);
  126. SendClientMessageToAll(GetPlayerColor(playerid), Vchat);
  127. return 0;
  128. }
  129. return 1;
  130. }
  131.  
  132. CMD:setvip(playerid, params[])
  133. {
  134. new TargetID, GiromBArquivos[100], NomeVip[24], TotalDias;
  135.  
  136. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, " [ERROR] Voce não tem permissão para isso.");
  137.  
  138. if(sscanf(params, "ii", TargetID, TotalDias)) return SendClientMessage(playerid, -1, "[ERROR] uso correto: /darvip [ID] [DIAS]");
  139.  
  140. GetPlayerName(TargetID, NomeVip, sizeof(NomeVip));
  141. format(GiromBArquivos, sizeof(GiromBArquivos), "GVips/%s.ini", NomeVip);
  142.  
  143. if(DOF2_FileExists(GiromBArquivos))
  144. return SendClientMessage(playerid, -1, "[ERROR] Este jogador já é vip.");
  145.  
  146. SetPlayerColor(TargetID, GetPlayerColor(TargetID));
  147.  
  148. DOF2_CreateFile(GiromBArquivos);
  149. DOF2_SetInt(GiromBArquivos, "Dias", gettime() + (60*60*24*TotalDias));
  150. DOF2_SetInt(GiromBArquivos, "Level", 1);
  151. DOF2_SaveFile();
  152. GiromBVip[TargetID][gLevel] = 1;
  153.  
  154. return 1;
  155. }
  156.  
  157.  
  158. CMD:tirarvip(playerid, params[])
  159. {
  160. new TargetID, GiromBArquivos[100], pNome[21], xstr[128];
  161.  
  162. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, " [ERROR] Voce não tem permissão para isso.");
  163.  
  164.  
  165. if(sscanf(params, "i", TargetID))
  166. return SendClientMessage(playerid, -1, "USE: /removervip [ID]");
  167.  
  168. if(!IsPlayerConnected(TargetID))
  169. return SendClientMessage(playerid, -1, "{FF0000}[ERRO]: Este jogador não esta conectado.");
  170.  
  171. GetPlayerName(TargetID, pNome, sizeof(pNome));
  172.  
  173. format(GiromBArquivos, sizeof(GiromBArquivos), "GVips/%s.ini", pNome);
  174.  
  175. if(!DOF2_FileExists(GiromBArquivos))
  176. return SendClientMessage(playerid, -1, "[ERRO] Este jogador não é vip.");
  177.  
  178. GiromBVip[TargetID][gLevel] = 0;
  179.  
  180. DOF2_RemoveFile(GiromBArquivos);
  181.  
  182. GetPlayerName(playerid, pNome, sizeof(pNome));
  183. format(xstr, sizeof(xstr), "[INFO] Você removeu o vip do jogador %s.", pNome);
  184. SendClientMessage(playerid, -1, xstr);
  185.  
  186. GetPlayerName(TargetID, pNome, sizeof(pNome));
  187. format(xstr, sizeof(xstr), "[INFO] O admin %s removeu seu vip.", pNome);
  188. SendClientMessage(TargetID, -1, xstr);
  189.  
  190. return 1;
  191. }
  192.  
  193.  
  194. CMD:vips(playerid)
  195. {
  196. new String[500],
  197. gVipNome[24];
  198.  
  199. ShowPlayerDialog(playerid, 373, DIALOG_STYLE_MSGBOX, "VIPS CONECTADOS", " ", "FECHAR","");
  200. for(new i,a = GetMaxPlayers();i < a;i++)
  201. {
  202. if(IsPlayerConnected(i))
  203. {
  204. if(PlayerVip(i))
  205. {
  206. GetPlayerName(i, gVipNome, 24);
  207. format(String, sizeof(String), "%s%s (%i)\n", String, gVipNome,i );
  208. ShowPlayerDialog(playerid, 373, DIALOG_STYLE_MSGBOX, "VIPS CONECTADOS", String, "FECHAR", "");
  209. }
  210. }
  211. }
  212. return 1;
  213. }
  214.  
  215.  
  216.  
  217. CMD:cvip(playerid, params[])
  218. {
  219.  
  220. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] Voce não tem permissão para isso.");
  221.  
  222. new Nome[24], SendVipMessage[160];
  223.  
  224. GetPlayerName(playerid, Nome, 24);
  225.  
  226. format(SendVipMessage, 160, "[{FF66FF}VIP{FFFFFF}] |%s|: %s", Nome, params);
  227.  
  228. for(new i = 0; i < MAX_PLAYERS; i++){
  229.  
  230. if(IsPlayerConnected(i)){
  231.  
  232. if(PlayerVip(i)){
  233.  
  234. SendClientMessage(i, -1, SendVipMessage);
  235. }
  236. }
  237. }
  238. return 1;
  239. }
  240.  
  241. CMD:kitvip(playerid)
  242. {
  243. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] Voce não tem permissão para isso.");
  244.  
  245. GivePlayerWeapon(playerid, 24, 620);
  246. GivePlayerWeapon(playerid, 25, 950);
  247. GivePlayerWeapon(playerid, 29, 1200);
  248. GivePlayerWeapon(playerid, 30, 1500);
  249. GivePlayerWeapon(playerid, 16, 10);
  250. GivePlayerWeapon(playerid, 35, 5);
  251. return 1;
  252. }
  253.  
  254.  
  255. CMD:nitro(playerid)
  256. {
  257. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] Voce não tem permissão para isso.");
  258.  
  259. if(!IsPlayerInAnyVehicle(playerid))
  260. return SendClientMessage(playerid, -1, "[INFO] Para usar este item você deve estar em um veiculo.");
  261. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  262. SendClientMessage(playerid, -1, "[INFO] Foi adicionado nitro ao seu veiculo.");
  263. return 1;
  264. }
  265.  
  266. CMD:jetpack(playerid)
  267. {
  268. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] Voce não tem permissão para isso.");
  269.  
  270. SetPlayerSpecialAction(playerid, 2);
  271. SendClientMessage(playerid, -1, "[INFO] Você pegou seu Jetpack.");
  272. return 1;
  273. }
  274.  
  275. CMD:spawn(playerid)
  276. {
  277. SpawnPlayer(playerid);
  278. return 1;
  279. }
  280. CMD:vida(playerid)
  281. {
  282. if(Vida[playerid] == true) return SendClientMessage(playerid, -1, "[ERRO]: Você só pode comprar VIDA uma vez a cada SPAWN.");
  283. SetPlayerHealth(playerid, 100.0);
  284. Vida[playerid] = true;
  285. return true;
  286. }
  287.  
  288. CMD:colete(playerid)
  289. {
  290. if(Colete[playerid] == true) return SendClientMessage(playerid, -1, "[ERRO]: Você só pode comprar C0LETE uma vez a cada SPAWN.");
  291. SetPlayerArmour(playerid, 100.0);
  292. Colete[playerid] = true;
  293. return true;
  294. }
  295.  
  296.  
  297. CMD:ajudavip(playerid)
  298. {
  299. ShowPlayerDialog(playerid, vcmds, DIALOG_STYLE_MSGBOX," Vip Cmds° ","use /cvip para falar no chat vip\n /vida e /colete \n /Spawn -> Spawnar \n /jetpack \n /nitro \n /kitvip --> armas vip \n /Vips -> Ver Vips ON\n\n","ok","");
  300. return 1;
  301. }
  302.  
  303.  
  304. public GiromBaVerificada(playerid){
  305.  
  306. if(GiromBVip[playerid][gLevel] >= 1){
  307.  
  308. new NomeVip[24], GiromBArquivos[100];
  309.  
  310. GetPlayerName(playerid, NomeVip, sizeof(NomeVip));
  311. format(GiromBArquivos, sizeof(GiromBArquivos), "GVips/%s.ini", NomeVip);
  312.  
  313. GiromBVip[playerid][gDias] = DOF2_GetInt(GiromBArquivos, "Dias");
  314.  
  315. if(gettime() >= GiromBVip[playerid][gDias]){
  316.  
  317. SendClientMessage(playerid, -1, "[INFO] O seu tempo de vip expirou, você não é mais um jogador vip.");
  318. DOF2_RemoveFile(GiromBArquivos);
  319. GiromBVip[playerid][gLevel] = 0;
  320. }
  321. }
  322. return 0;
  323. }
  324.  
  325.  
  326. stock PlayerVip(playerid)
  327. {
  328. new getVip[40],NomeVip[21];
  329. GetPlayerName(playerid, NomeVip, 21);
  330. format(getVip, 40, "GVips/%s.ini", NomeVip);
  331. if(DOF2_FileExists(getVip)) return 1;
  332. return 0;
  333. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement