Advertisement
GiromB

GiromB system vip

Feb 17th, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.23 KB | None | 0 0
  1. /* -=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-==-=-=-=-=-=-=-=-=-=-
  2. PLEASE DO NOT REMOVE CREDITS
  3.  
  4.  
  5. PERFIL: http://forum.sa-mp.com/member.php?u=286494
  6.  
  7. MY WORK'S
  8. http://forum.sa-mp.com/showthread.php?t=626051
  9.  
  10. MY skype:
  11.  
  12. krazy.samp
  13.  
  14. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=*/
  15.  
  16. #include <a_samp>
  17. #include <ZCMD>
  18. #include <sscanf2>
  19. #include <DOF2>
  20.  
  21.  
  22. main()
  23. {
  24. return 0;
  25. }
  26.  
  27. // DEFINES
  28. #define vcmds 10
  29.  
  30. // ENUM'S AND VARIAVEIS
  31. enum GVIP
  32. {
  33. gLevel,
  34. gDays,
  35. }
  36.  
  37. static GiromBVip[MAX_PLAYERS][GVIP];
  38. static bool:Life[MAX_PLAYERS];
  39. static bool:Armour[MAX_PLAYERS];
  40.  
  41. // FORWARD'S
  42.  
  43. forward GiromBaCheck(playerid);
  44.  
  45.  
  46. public OnFilterScriptInit()
  47. {
  48. SetTimer("GiromBaCheck", 60000, true);
  49.  
  50. print("\n------------------------|-----------------------------");
  51. print("|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|§YSTEM G-VIP|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|");
  52. print("|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|CREATED BY GiromB|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|");
  53. print("|¨¨¨¨¨¨¨¨¨¨¨¨¨¨| DO NOT REMOVE CREDITS |¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|");
  54. print("--------------------------|------------------------------\n");
  55. return 1;
  56. }
  57.  
  58.  
  59. public OnFilterScriptExit()
  60. {
  61. DOF2_Exit();
  62. return 1;
  63. }
  64.  
  65. public OnPlayerDisconnect(playerid, reason)
  66. {
  67. Life[playerid] = false;
  68. Armour[playerid] = false;
  69. GiromBVip[playerid][gLevel] = 0;
  70. return 0;
  71. }
  72.  
  73. public OnPlayerConnect(playerid)
  74. {
  75. static GiromBFiles[100], NameVip[24];
  76.  
  77. GetPlayerName(playerid, NameVip, sizeof(NameVip));
  78. format(GiromBFiles, sizeof(GiromBFiles), "GVips/%s.ini", NameVip);
  79.  
  80. if(PlayerVip(playerid)){
  81.  
  82. GiromBVip[playerid][gDays] = DOF2_GetInt(GiromBFiles, "Days");
  83.  
  84. if(gettime() >= GiromBVip[playerid][gDays]){
  85.  
  86. SendClientMessage(playerid, -1, "[INFO] Your VIP time is over");
  87. GiromBVip[playerid][gLevel] = 0;
  88. DOF2_RemoveFile(GiromBFiles);
  89.  
  90. } else {
  91.  
  92. GiromBVip[playerid][gLevel] = DOF2_GetInt(GiromBFiles, "Level");
  93. SendClientMessage(playerid, -1, "[INFO] you are is player VIP");
  94.  
  95. }
  96. }
  97.  
  98. Life[playerid] = false;
  99. Armour[playerid] = false;
  100.  
  101. return 0;
  102. }
  103.  
  104. public OnPlayerSpawn(playerid)
  105. {
  106. Life[playerid] = false;
  107. Armour[playerid] = false;
  108. return 1 ;
  109. }
  110.  
  111. public OnPlayerDeath(playerid, killerid, reason)
  112. {
  113. Life[playerid] = false;
  114. Armour[playerid] = false;
  115. return 1;
  116. }
  117.  
  118. public OnPlayerText(playerid, text[])
  119. {
  120. if(GiromBVip[playerid][gLevel] >= 1)
  121. {
  122. static Vchat[180], NameVip[MAX_PLAYER_NAME];
  123. GetPlayerName(playerid, NameVip, sizeof(NameVip));
  124. format(Vchat, sizeof(Vchat), "%s {00FF00}[VIP] {FFFFFF}[%i]: %s",NameVip,playerid, text);
  125. SendClientMessageToAll(GetPlayerColor(playerid), Vchat);
  126. return 0;
  127. }
  128. return 1;
  129. }
  130.  
  131. CMD:setvip(playerid, params[])
  132. {
  133. static TargetID, GiromBFiles[100], NameVip[24], TotalDays;
  134.  
  135. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, " [ERROR] You are not allowed to do this.");
  136.  
  137. if(sscanf(params, "ii", TargetID, TotalDays)) return SendClientMessage(playerid, -1, "[ERROR] CORRECT: /setvip [ID] [DAYS]");
  138.  
  139. GetPlayerName(TargetID, NameVip, sizeof(NameVip));
  140. format(GiromBFiles, sizeof(GiromBFiles), "GVips/%s.ini", NameVip);
  141.  
  142. if(!IsPlayerConnected(TargetID))
  143. return SendClientMessage(playerid, -1, "{FF0000}[ERRO]: This player is offline.");
  144.  
  145. if(DOF2_FileExists(GiromBFiles))
  146. return SendClientMessage(playerid, -1, "[ERROR] This player is already vip.");
  147.  
  148. SetPlayerColor(TargetID, GetPlayerColor(TargetID));
  149.  
  150. DOF2_CreateFile(GiromBFiles);
  151. DOF2_SetInt(GiromBFiles, "Days", gettime() + (60*60*24*TotalDays));
  152. DOF2_SetInt(GiromBFiles, "Level", 1);
  153. DOF2_SaveFile();
  154. GiromBVip[TargetID][gLevel] = 1;
  155.  
  156. return 1;
  157. }
  158.  
  159.  
  160. CMD:delete(playerid, params[])
  161. {
  162. static TargetID, GiromBFiles[100], pName[21], xstr[128];
  163.  
  164. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, " [ERROR] You are not allowed to do this.");
  165.  
  166.  
  167. if(sscanf(params, "i", TargetID))
  168. return SendClientMessage(playerid, -1, "USE: /delete [ID]");
  169.  
  170. if(!IsPlayerConnected(TargetID))
  171. return SendClientMessage(playerid, -1, "{FF0000}[ERRO]: This player is offline.");
  172.  
  173. GetPlayerName(TargetID, pName, sizeof(pName));
  174.  
  175. format(GiromBFiles, sizeof(GiromBFiles), "GVips/%s.ini", pName);
  176.  
  177. if(!DOF2_FileExists(GiromBFiles))
  178. return SendClientMessage(playerid, -1, "[ERRO] This player is not vip.");
  179.  
  180. GiromBVip[TargetID][gLevel] = 0;
  181.  
  182. DOF2_RemoveFile(GiromBFiles);
  183.  
  184. GetPlayerName(playerid, pName, sizeof(pName));
  185. format(xstr, sizeof(xstr), "[!] You removed the player vip %s.", pName);
  186. SendClientMessage(playerid, -1, xstr);
  187.  
  188. GetPlayerName(TargetID, pName, sizeof(pName));
  189. format(xstr, sizeof(xstr), "[!] admin %s has removed your VIP", pName);
  190. SendClientMessage(TargetID, -1, xstr);
  191.  
  192. return 1;
  193. }
  194.  
  195.  
  196. CMD:vips(playerid)
  197. {
  198. new String[500],
  199. gVipName[24];
  200.  
  201. ShowPlayerDialog(playerid, 373, DIALOG_STYLE_MSGBOX, "VIPS CONECTED", " ", "CLOSE","");
  202. for(new i,a = GetMaxPlayers();i < a;i++)
  203. {
  204. if(IsPlayerConnected(i))
  205. {
  206. if(PlayerVip(i))
  207. {
  208. GetPlayerName(i, gVipName, 24);
  209. format(String, sizeof(String), "%s%s (%i)\n", String, gVipName,i );
  210. ShowPlayerDialog(playerid, 373, DIALOG_STYLE_MSGBOX, "VIPS CONECTED", String, "CLOSE", "");
  211. }
  212. }
  213. }
  214. return 1;
  215. }
  216.  
  217.  
  218.  
  219. CMD:cvip(playerid, params[])
  220. {
  221.  
  222. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] You are not allowed to do this..");
  223.  
  224. static Nome[24], SendVipMessage[160];
  225.  
  226. GetPlayerName(playerid, Nome, 24);
  227.  
  228. format(SendVipMessage, 160, "[{FF66FF}VIP{FFFFFF}] |%s|: %s", Nome, params);
  229.  
  230. for(new i = 0; i < MAX_PLAYERS; i++){
  231.  
  232. if(IsPlayerConnected(i)){
  233.  
  234. if(PlayerVip(i)){
  235.  
  236. SendClientMessage(i, -1, SendVipMessage);
  237. }
  238. }
  239. }
  240. return 1;
  241. }
  242.  
  243. CMD:kitvip(playerid)
  244. {
  245. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, "[ERROR] You are not allowed to do this.");
  246.  
  247. GivePlayerWeapon(playerid, 24, 620);
  248. GivePlayerWeapon(playerid, 25, 950);
  249. GivePlayerWeapon(playerid, 29, 1200);
  250. GivePlayerWeapon(playerid, 30, 1500);
  251. GivePlayerWeapon(playerid, 16, 10);
  252. GivePlayerWeapon(playerid, 35, 5);
  253. return 1;
  254. }
  255.  
  256.  
  257. CMD:nitro(playerid)
  258. {
  259. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] You are not allowed to do this.");
  260.  
  261. if(!IsPlayerInAnyVehicle(playerid))
  262. return SendClientMessage(playerid, -1, "[ERROR] To use this item you must be in a vehicle.");
  263. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  264.  
  265. return 1;
  266. }
  267.  
  268. CMD:jetpack(playerid)
  269. {
  270. if(!PlayerVip(playerid)) return SendClientMessage(playerid,-1, " [ERROR] You are not allowed to do this.");
  271.  
  272. SetPlayerSpecialAction(playerid, 2);
  273. SendClientMessage(playerid, -1, "[!] You got your Jetpack.");
  274. return 1;
  275. }
  276.  
  277. CMD:spawn(playerid)
  278. {
  279. SpawnPlayer(playerid);
  280. return 1;
  281. }
  282. CMD:vida(playerid)
  283. {
  284. if(Life[playerid] == true) return SendClientMessage(playerid, -1, "[ERROR]: You can only buy LIFE once every SPAWN");
  285. SetPlayerHealth(playerid, 100.0);
  286. Life[playerid] = true;
  287. return true;
  288. }
  289.  
  290. CMD:armour(playerid)
  291. {
  292. if(Armour[playerid] == true) return SendClientMessage(playerid, -1, "[ERROR]:You can only buy ARMOUR once every SPAWN.");
  293. SetPlayerArmour(playerid, 100.0);
  294. Armour[playerid] = true;
  295. return true;
  296. }
  297.  
  298.  
  299. CMD:help(playerid)
  300. {
  301. ShowPlayerDialog(playerid, vcmds, DIALOG_STYLE_MSGBOX," Vip ° "," /cvip = chat vip\n /life and /armour \n /Spawn -> Spawn \n /jetpack \n /nitro \n /kitvip --> weapons vip \n /Vips -> Vips ON\n\n","ok","");
  302. return 1;
  303. }
  304.  
  305.  
  306. public GiromBaCheck(playerid){
  307.  
  308. if(GiromBVip[playerid][gLevel] >= 1){
  309.  
  310. static NameVip[24], GiromBFiles[100];
  311.  
  312. GetPlayerName(playerid, NameVip, sizeof(NameVip));
  313. format(GiromBFiles, sizeof(GiromBFiles), "GVips/%s.ini", NameVip);
  314.  
  315. GiromBVip[playerid][gDays] = DOF2_GetInt(GiromBFiles, "Days");
  316.  
  317. if(gettime() >= GiromBVip[playerid][gDays]){
  318.  
  319. SendClientMessage(playerid, -1, "[!] Your VIP time is over");
  320. DOF2_RemoveFile(GiromBFiles);
  321. GiromBVip[playerid][gLevel] = 0;
  322. }
  323. }
  324. return 0;
  325. }
  326.  
  327.  
  328. stock PlayerVip(playerid)
  329. {
  330. static getVip[40],NameVip[21];
  331. GetPlayerName(playerid, NameVip, 21);
  332. format(getVip, 40, "GVips/%s.ini", NameVip);
  333. if(DOF2_FileExists(getVip)) return 1;
  334. return 0;
  335. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement