Advertisement
Guest User

Untitled

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