Advertisement
Guest User

Untitled

a guest
May 7th, 2013
2,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.84 KB | None | 0 0
  1. #include <a_samp>
  2. #include <DOF2>
  3. #include <zcmd>
  4. #include <sscanf>
  5.  
  6. #define Maximo_Players 100
  7. #define Preco_Vip 10
  8. #define Dial_Vip 7000
  9.  
  10. new VIP[Maximo_Players];
  11. new Fala[128];
  12. new Nome[24];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. print("Ultimate VIP 0.3x iniciado.");
  17. print("Criador: Biel_COP.");
  18.  
  19. return 1;
  20. }
  21. public OnFilterScriptExit()
  22. {
  23. print("Ultimate VIP 0.3x encerrado.");
  24. print("Criador: Biel_COP.");
  25.  
  26. DOF2_Exit();
  27.  
  28. return 1;
  29. }
  30. public OnPlayerConnect(playerid)
  31. {
  32. GetPlayerName(playerid,Nome,sizeof(Nome));
  33. format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
  34.  
  35. if(DOF2_FileExists(Fala))
  36. {
  37. VIP[playerid] = 1;
  38. }
  39. return 1;
  40. }
  41. public OnPlayerDisconnect(playerid,reason)
  42. {
  43. VIP[playerid] = 0;
  44.  
  45. GetPlayerName(playerid,Nome,sizeof(Nome));
  46. format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
  47.  
  48. if(DOF2_FileExists(Fala))
  49. {
  50. DOF2_SaveFile();
  51. }
  52. return 1;
  53. }
  54. public OnPlayerSpawn(playerid)
  55. {
  56. if(VIP[playerid] == 1)
  57. {
  58. GameTextForPlayer(playerid,"~r~Voce e um~n~Player VIP~n~Aproveite",5000,3);
  59. }
  60. return 1;
  61. }
  62. public OnVehicleDamageStatusUpdate(vehicleid,playerid)
  63. {
  64. if(VIP[playerid] == 1)
  65. {
  66. GameTextForPlayer(playerid,"~r~Veiculo Reparado",1000,3);
  67. RepairVehicle(vehicleid);
  68. }
  69. return 1;
  70. }
  71. public OnPlayerUpdate(playerid)
  72. {
  73. if(VIP[playerid] == 1)
  74. {
  75. GetPlayerName(playerid,Nome,sizeof(Nome));
  76. format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
  77.  
  78. if(DOF2_FileExists(Fala))
  79. {
  80. new Hoje = getdate();
  81.  
  82. new Vencimento = DOF2_GetInt(Fala,"Vencimento");
  83. new Dias = DOF2_GetInt(Fala,"Dias");
  84.  
  85. if(Hoje-Vencimento >= Dias)
  86. {
  87. format(Fala,sizeof(Fala),"Olá %s, seu VIP expirou.\n\nPossível motivo: Vencimento.\n\nEsperamos que tenha aproveitado!\n\nPreço do VIP: R$ %d,00",Nome,Preco_Vip);
  88. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"VIP Expirado",Fala,"Cancelar","");
  89. RemoverVip(playerid);
  90. }
  91. }
  92. else
  93. {
  94. format(Fala,sizeof(Fala),"Olá %s, seu VIP expirou.\n\nPossível motivo: Sua conta na pasta não existe mais.\n\nEsperamos que tenha aproveitado!\n\nPreço do VIP: R$ %d,00",Nome,Preco_Vip);
  95. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"VIP Expirado",Fala,"Cancelar","");
  96. RemoverVip(playerid);
  97. }
  98. }
  99. return 1;
  100. }
  101. public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
  102. {
  103. if(dialogid == Dial_Vip)
  104. {
  105. if(response)
  106. {
  107. if(!strlen(inputtext))
  108. {
  109. ShowPlayerDialog(playerid,Dial_Vip,DIALOG_STYLE_MSGBOX,"Bate Papo VIP","Escreva o texto no campo abaixo","Escrever","Cancelar");
  110. }
  111. else
  112. {
  113. for(new i=0; i<Maximo_Players; i++)
  114. {
  115. if(IsPlayerConnected(i))
  116. {
  117. if(VIP[i] == 1)
  118. {
  119. GetPlayerName(playerid,Nome,sizeof(Nome));
  120. format(Fala,sizeof(Fala),"VIP %s: %s",Nome,inputtext);
  121. SendClientMessage(i,0xEDB2DEAA,Fala);
  122. }
  123. }
  124. }
  125. }
  126. return 1;
  127. }
  128. }
  129. return 1;
  130. }
  131. forward RemoverVip(playerid);
  132.  
  133. public RemoverVip(playerid)
  134. {
  135. VIP[playerid] = 0;
  136.  
  137. GetPlayerName(playerid,Nome,sizeof(Nome));
  138. format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
  139.  
  140. if(DOF2_FileExists(Fala))
  141. {
  142. DOF2_RemoveFile(Fala);
  143. }
  144. return 1;
  145. }
  146.  
  147. CMD:vips(playerid)
  148. {
  149. SendClientMessage(playerid,0xBFBFBFAA,"Vips Online:");
  150.  
  151. for(new i=0; i<Maximo_Players; i++)
  152. {
  153. if(IsPlayerConnected(i))
  154. {
  155. if(VIP[i] == 1)
  156. {
  157. format(Fala,sizeof(Fala),"VIP: %s.",Nome);
  158. SendClientMessage(playerid,0xBBFF00AA,Fala);
  159. }
  160. }
  161. }
  162. return 1;
  163. }
  164. CMD:armasvip(playerid)
  165. {
  166. if(VIP[playerid] == 1)
  167. {
  168. SetPlayerHealth(playerid,100.0);
  169. SetPlayerArmour(playerid,100.0);
  170.  
  171. ResetPlayerWeapons(playerid);
  172.  
  173. GivePlayerWeapon(playerid,24,700);
  174. GivePlayerWeapon(playerid,25,300);
  175. GivePlayerWeapon(playerid,29,500);
  176. GivePlayerWeapon(playerid,31,500);
  177. GivePlayerWeapon(playerid,34,100);
  178. GivePlayerWeapon(playerid,39,50);
  179. GivePlayerWeapon(playerid,40,50);
  180.  
  181. GameTextForPlayer(playerid,"~r~Equipamentos Adquiridos",5000,3);
  182. }
  183. return 1;
  184. }
  185. CMD:roupavip(playerid,params[])
  186. {
  187. new ID;
  188.  
  189. if(VIP[playerid] == 1)
  190. {
  191. if(!sscanf(params,"d",ID))
  192. {
  193. SendClientMessage(playerid,0xBFBFBFAA,"Use: /roupavip ID.");
  194. return 1;
  195. }
  196. if(ID > 299)
  197. {
  198. if(ID < 0)
  199. {
  200. SendClientMessage(playerid,0xBFBFBFAA,"Roupas de 0 a 299.");
  201. return 1;
  202. }
  203. }
  204. else
  205. {
  206. SetPlayerSkin(playerid,ID);
  207. GameTextForPlayer(playerid,"~r~Roupa Trocada",5000,3);
  208. }
  209. }
  210. return 1;
  211. }
  212. CMD:majvip(playerid)
  213. {
  214. if(VIP[playerid] == 1)
  215. {
  216. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  217. GameTextForPlayer(playerid,"~r~Mochila a Jato~n~Adquirida",5000,3);
  218. }
  219. return 1;
  220. }
  221. CMD:vip(playerid)
  222. {
  223. if(VIP[playerid] == 1)
  224. {
  225. ShowPlayerDialog(playerid,Dial_Vip,DIALOG_STYLE_MSGBOX,"Bate Papo VIP","Escreva o texto no campo abaixo","Escrever","Cancelar");
  226. }
  227. return 1;
  228. }
  229. CMD:bvip(playerid)
  230. {
  231. if(VIP[playerid] == 1)
  232. {
  233. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Beneficios VIP","Comando /armasvip disponível para uso.\n\nComando /roupavip disponível para uso.\n\nComando /majvip disponível para uso.\n\nAtendimento mais atencioso.\n\nNome no /vips, com direito ao bate papo.","Cancelar","");
  234. }
  235. return 1;
  236. }
  237. CMD:creditosvip(playerid)
  238. {
  239. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Ultimate VIP 0.3x","Criado por Biel_COP.\n\nAjuda inicial de Paulo Ricardo.\n\nUV 0.3x criado a partir de vários pedidos de usuários do Fórum Samp.","Cancelar","");
  240. return 1;
  241. }
  242. CMD:ajudavip(playerid)
  243. {
  244. if(VIP[playerid] == 1)
  245. {
  246. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Ajuda VIP","/vips, /armasvip, /roupavip\n\n/majvip, /vip, /bvip\n\n/creditosvip, /ajudavip, /planosvip","Cancelar","");
  247. }
  248. if(IsPlayerAdmin(playerid))
  249. {
  250. SendClientMessage(playerid,0xFFFF00AA,"/darvip, /removervip");
  251. }
  252. return 1;
  253. }
  254. CMD:planosvip(playerid)
  255. {
  256. format(Fala,sizeof(Fala),"O VIP custa R$ %d,00.\n\nAproveite e compre!",Preco_Vip);
  257. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Planos VIP",Fala,"Cancelar","");
  258. return 1;
  259. }
  260. CMD:darvip(playerid,params[])
  261. {
  262. new ID;
  263. new Dias;
  264.  
  265. if(IsPlayerAdmin(playerid))
  266. {
  267. if(!sscanf(params,"dd",ID,Dias))
  268. {
  269. SendClientMessage(playerid,0xBFBFBFAA,"Use: /darvip ID Dias.");
  270. return 1;
  271. }
  272. if(!IsPlayerConnected(ID))
  273. {
  274. SendClientMessage(playerid,0xBFBFBFAA,"Player não online.");
  275. return 1;
  276. }
  277. else
  278. {
  279. if(VIP[ID] == 1)
  280. {
  281. SendClientMessage(playerid,0xBFBFBFAA,"O mesmo Já é VIP.");
  282. return 1;
  283. }
  284. else
  285. {
  286. GetPlayerName(ID,Nome,sizeof(Nome));
  287. format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
  288.  
  289. DOF2_CreateFile(Fala);
  290. DOF2_SetInt(Fala,"Vencimento",getdate());
  291. DOF2_SetInt(Fala,"Dias",Dias);
  292. DOF2_SaveFile();
  293.  
  294. VIP[ID] = 1;
  295.  
  296. format(Fala,sizeof(Fala),"O administrador deu VIP para o player %s por %d dias.",Nome,Dias);
  297. SendClientMessageToAll(0xFF8080AA,Fala);
  298. }
  299. }
  300. }
  301. return 1;
  302. }
  303. CMD:removervip(playerid,params[])
  304. {
  305. new ID;
  306.  
  307. if(IsPlayerAdmin(playerid))
  308. {
  309. if(!sscanf(params,"d",ID))
  310. {
  311. SendClientMessage(playerid,0xBFBFBFAA,"Use: /removervip ID.");
  312. return 1;
  313. }
  314. if(!IsPlayerConnected(ID))
  315. {
  316. SendClientMessage(playerid,0xBFBFBFAA,"Player não online.");
  317. return 1;
  318. }
  319. else
  320. {
  321. if(VIP[ID] == 0)
  322. {
  323. SendClientMessage(playerid,0xBFBFBFAA,"O mesmo não é VIP.");
  324. return 1;
  325. }
  326. else
  327. {
  328. GetPlayerName(ID,Nome,sizeof(Nome));
  329. format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
  330.  
  331. DOF2_RemoveFile(Fala);
  332.  
  333. VIP[ID] = 0;
  334.  
  335. format(Fala,sizeof(Fala),"O administrador removeu o VIP do player %s.",Nome);
  336. SendClientMessageToAll(0xFF8080AA,Fala);
  337. }
  338. }
  339. }
  340. return 1;
  341. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement