Advertisement
Guest User

NVIP - VIP SYSTEM BY NAVROOPSINGH

a guest
Dec 31st, 2012
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.43 KB | None | 0 0
  1. //VIP System 1.0
  2. //VIP System made by Navroopsingh!
  3. //Please do now remove the comments!
  4. //==============================================================================
  5.  
  6. #include <a_samp>
  7. #include <zcmd>
  8. #include <sscanf>
  9. #include <YSI/y_ini>
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. //=========================DO NOT REMOVE CREDITS================================
  14. #define AUTHOR "Navroopsingh"
  15. #define VERSION "1.0"
  16. //============PlayerInfo enumerator=============================================
  17. enum pInfo
  18. {
  19. pVIP
  20. };
  21. //==============================forwards========================================
  22. forward EnablevBonus(playerid);
  23. forward EnablevHeal(playerid);
  24. forward loadvip_Account(playerid, name[], value[]);
  25. //==============================================================================
  26.  
  27.  
  28. #define MAX_VIPL 3 // Max VIP level.. can be editted
  29. #define DIALOGCMDS 250 //VMENU dialogid
  30. //===========Colors=============================================================
  31. #define RED 0xFF0000FF
  32. #define PURPLE 0xC2A2DAAA
  33. #define GREEN 0x15FF00AA
  34. #define LIGHTGREEN 0x78FF6CAA
  35. #define BLUE 0x0015FFAA
  36. //========Extra colors==========================================================
  37. #define cred "{E10000}"
  38. #define corange "{FF7E19}"
  39. #define cyellow "{FF9E00}"
  40. #define cblue "{0087FF}"
  41. #define cwhite "{FFFFFF}"
  42. #define cgreen "{00FF28}"
  43. #define cgrey "{969696}"
  44. //==============================================================================
  45. //=============================Variables========================================
  46. new Enablevheal[MAX_PLAYERS]; //-----Disable/Enable vheal command to avoid abuse
  47. new Enablevbonus[MAX_PLAYERS]; //---Disable/Enable vbonus command to avoid abuse
  48. new HasSpawnedCar[MAX_PLAYERS]; //---Will be used to remove the vehicles spawned
  49. //==============================Timers==========================================
  50. enum tInfo
  51. {
  52. vHeal,
  53. vBonus
  54. };
  55. new timer[MAX_PLAYERS][tInfo]; //Time variable----------------------------------
  56. //---------removing warning loose indentation-----------------------------------
  57. #pragma tabsize 0
  58. //------------------------------------------------------------------------------
  59. //============PlayerInfo var===========
  60. new PlayerInfo[MAX_PLAYERS][pInfo];
  61. //=====================================
  62. //=============================STOCKS===========================================
  63. stock PlayerName(playerid)
  64. {
  65. new name[MAX_PLAYER_NAME];
  66. GetPlayerName(playerid, name, sizeof(name));
  67. return name;
  68. }
  69. //===================Account====================================================
  70. stock getACC(playerid)
  71. {
  72. new file[200];
  73. format(file, sizeof(file),"NVIP/%s.ini",PlayerName(playerid));
  74. return file;
  75. }
  76. //============Vip Ranks Can be editted==========================================
  77. stock Rank(playerid)
  78. {
  79. new str[156];
  80. if(PlayerInfo[playerid][pVIP] == 0) str = ("Player");
  81. else if(PlayerInfo[playerid][pVIP] == 1) str = ("Trail VIP");
  82. else if(PlayerInfo[playerid][pVIP] == 2) str = ("Donater 2");
  83. else if(PlayerInfo[playerid][pVIP] == 3) str = ("Owner");
  84. return str;
  85. }
  86. stock MakeACC(playerid)
  87. {
  88. if(!fexist(getACC(playerid)))
  89. {
  90. new string[125];
  91. format(string, sizeof(string),"%s",Rank(playerid));
  92. new INI:acc = INI_Open(getACC(playerid));
  93. INI_SetTag(acc,"Account");
  94. INI_WriteInt(acc,"Level",0);
  95. INI_WriteString(acc,"Rank",string);
  96. INI_Close(acc);
  97. PlayerInfo[playerid][pVIP] = 0;
  98. }
  99. return 1;
  100. }
  101. //===========Saving the VIP level===============================================
  102. stock SaveLevel(playerid)
  103. {
  104. new INI:file = INI_Open(getACC(playerid));
  105. INI_SetTag(file,"Account");
  106. INI_WriteInt(file,"Level",PlayerInfo[playerid][pVIP]);
  107. INI_WriteString(file,"Rank",Rank(playerid));
  108. INI_Close(file);
  109. SendClientMessage(playerid, LIGHTGREEN,"VIP Level saved in accounts!");
  110. return 1;
  111. }
  112. //=======================Opening the file=======================================
  113. public loadvip_Account(playerid, name[], value[])
  114. {
  115. INI_Int("Level", PlayerInfo[playerid][pVIP]);
  116. return 1;
  117. }
  118.  
  119. public OnFilterScriptInit()
  120. {
  121. print("\n--------------------------------------");
  122. print(" NVIP System by Navroopsingh Loaded");
  123. print("--------------------------------------\n");
  124. return 1;
  125. }
  126.  
  127. public OnFilterScriptExit()
  128. {
  129. print("\n--------------------------------------");
  130. print(" NVIP System by Navroopsingh Unloaded");
  131. print("--------------------------------------\n");
  132. return 1;
  133.  
  134.  
  135. return 1;
  136. }
  137. //==============================================================================
  138. public OnPlayerConnect(playerid)
  139. {
  140. PlayerInfo[playerid][pVIP] = 0; //Setting the VIP level 0 on player connect-
  141. Enablevheal[playerid] = 1; //Enabling the /vheal command on player connect--
  142. Enablevbonus[playerid] = 1; //Enabling the /vbonus command on player connect
  143. HasSpawnedCar[playerid] = 0;//-Setting the value to 0
  144. //-------------Checking and creating the player account in database---------
  145. if(fexist(getACC(playerid)))
  146. {
  147. INI_ParseFile(getACC(playerid),"loadvip_%s", .bExtra = true, .extra = playerid);
  148. new string[256];
  149. format(string, sizeof(string),"Welcome %s Your VIP level has been successfully loaded [VIP Level: %d][VIP Rank: %s]",PlayerName(playerid),PlayerInfo[playerid][pVIP],Rank(playerid));
  150. print("\n----------------------------------------------------------");
  151. printf("_____[%s] Very Important Player Connected_____", PlayerName(playerid));
  152. print("------------------------------------------------------------\n");
  153. SendClientMessage(playerid, GREEN,string);
  154. }
  155. else
  156. {
  157. MakeACC(playerid); //Creating the account if the account doesn't exists
  158. }
  159. return 1;
  160. }
  161. //Saving PLayer Stats on his disconnect=========================================
  162. public OnPlayerDisconnect(playerid, reason)
  163. {
  164. SaveLevel(playerid);
  165. return 1;
  166. }
  167. //========================================CMDS==================================
  168. CMD:vcommands(playerid, params[])
  169. {
  170. if(PlayerInfo[playerid][pVIP] >= 1)
  171. {
  172. new lstring[2566];
  173. strcat(lstring,""RED"VIP Level 1:\n\n"BLUE"/vbike - to spawn nrg\n/vcar - to spawn vip Turismo\n/vheli - to spawn maverick\n/vheal - to heal yourself\n\n\n");
  174. strcat(lstring,""RED"VIP Level 2:\n"BLUE"/vweaps - to get vip weapons\n/vboat - to spawn vip boat\n/vmenu - to access vip menu\n/vplane - to spawn a hydra for yourself\n/vpbonus - to heal and give 1 ammo of RPG to nearest players\n/vnos to activate nitros\naccess to level 1 vip commands\n\n\n");
  175. strcat(lstring,""RED"VIP Level 3:\n"BLUE"access to all vip commands\n/vfix - to fix your vehicle\n/vtime - to set your time\n/vskin - to set your skin\n/vjetpack - to spawn jetpack for yourself\n/varmour - to armour yourself\n");
  176. ShowPlayerDialog(playerid, 222,DIALOG_STYLE_MSGBOX,"VIP Commands",lstring,"Close","");
  177. }
  178. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  179. return 1;
  180. }
  181. //==========================VIP Level 1 Commands================================
  182. //==============================================================================
  183. CMD:vbike(playerid, params[])
  184. {
  185. if(PlayerInfo[playerid][pVIP] >= 1)
  186. {
  187. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  188. new Float:X, Float:Y, Float:Z;
  189. GetPlayerPos(playerid, X, Y, Z);
  190. PutPlayerInVehicle(playerid, CreateVehicle(522, X, Y, Z, 0.0,0, 1, 60), 0);
  191. SendClientMessage(playerid, BLUE,"Enjoy your new vip bike!");
  192. HasSpawnedCar[playerid] = 1;
  193. }
  194. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  195. return 1;
  196. }
  197. //==============================================================================
  198. CMD:vheli(playerid, params[])
  199. {
  200. if(PlayerInfo[playerid][pVIP] >= 1)
  201. {
  202. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  203. new Float:X, Float:Y, Float:Z;
  204. GetPlayerPos(playerid, X, Y, Z);
  205. PutPlayerInVehicle(playerid, CreateVehicle(487, X, Y, Z, 0.0,0, 1, 60), 0);
  206. SendClientMessage(playerid, BLUE,"Enjoy your new vip helicopter!");
  207. HasSpawnedCar[playerid] = 1;
  208. }
  209. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  210. return 1;
  211. }
  212. //==============================================================================
  213. CMD:vheal(playerid, params[])
  214. {
  215. if(PlayerInfo[playerid][pVIP] >= 1)
  216. {
  217. if(Enablevheal[playerid] == 1)
  218. {
  219. SetPlayerHealth(playerid, 100.0);
  220. GameTextForPlayer(playerid,"~g~Healed",1500, 3);
  221. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  222. Enablevheal[playerid] = 0;
  223. timer[playerid][vHeal] = SetTimer("EnablevHeal", 120*1000,false);
  224. } else return SendClientMessage(playerid, RED,"[ERROR]: You can only use this command in each two minutes");
  225. } else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  226. return 1;
  227. }
  228. //==============================================================================
  229. CMD:vcar(playerid, params[])
  230. {
  231. if(PlayerInfo[playerid][pVIP] >= 1)
  232. {
  233. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  234. new Float:X, Float:Y, Float:Z;
  235. GetPlayerPos(playerid, X, Y, Z);
  236. PutPlayerInVehicle(playerid, CreateVehicle(451, X, Y, Z, 0.0,0, 1, 60), 0);
  237. SendClientMessage(playerid, BLUE,"Enjoy your vip car");
  238. HasSpawnedCar[playerid] = 1;
  239. }
  240. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command");
  241. return 1;
  242. }
  243. //==========Extra command=======================================================
  244. CMD:vips(playerid, params[]) {
  245. new count = 0;
  246. new string[256];
  247. new name[MAX_PLAYER_NAME];
  248. SendClientMessage(playerid, GREEN," ");
  249. SendClientMessage(playerid, GREEN,"Currently online very important players (vips)");
  250. for(new i = 0; i < MAX_PLAYERS; i ++) {
  251. if(IsPlayerConnected(i)) {
  252. GetPlayerName(i, name, sizeof(name));
  253. if(PlayerInfo[i][pVIP] >= 1) {
  254. format(string, sizeof(string),"Donator Level - %d: %s ", PlayerInfo[playerid][pVIP],name);
  255. SendClientMessage(playerid, PURPLE, string);
  256. count++;
  257. }
  258. }
  259. }
  260. if(count == 0) {
  261. SendClientMessage(playerid, GREEN,"No vips online right now");
  262. }
  263. return 1;
  264. }
  265. //==========================RCON ADMIN COMMAND==================================
  266. CMD:makevip(playerid, params[])
  267. {
  268. if(IsPlayerAdmin(playerid))
  269. {
  270. new string[125], level, player1;
  271. if(sscanf(params,"dd",player1, level)) return SendClientMessage(playerid, RED,"[USAGE]: /setvip ( playerid ) ( level )");
  272. if(!IsPlayerConnected(playerid) && player1 != INVALID_PLAYER_ID)
  273. {
  274. SendClientMessage(playerid, RED,"[ERROR]: Player is not connected");
  275. }
  276. if(level > MAX_VIPL)
  277. {
  278. SendClientMessage(playerid, RED,"[ERROR]: Incorrect level");
  279. }
  280. else
  281. {
  282. format(string, sizeof(string),""cblue"Administrator "cgreen"'%s' "cblue"has set your vip level to "cgreen"'%d'", PlayerName(playerid),level);
  283. SendClientMessage(player1, PURPLE, string);
  284. PlayerPlaySound(player1,1057,0.0,0.0,0.0);
  285. PlayerInfo[player1][pVIP] = level;
  286. }
  287. }
  288. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be RCON admin to use this command");
  289. return 1;
  290. }
  291. //==============================================================================
  292. //============================FUNCTIONS=========================================
  293. public EnablevBonus(playerid)
  294. {
  295. if(Enablevbonus[playerid] == 0)
  296. {
  297. Enablevbonus[playerid] = 1;
  298. KillTimer(timer[playerid][vBonus]);
  299. }
  300. return 1;
  301. }
  302. public EnablevHeal(playerid)
  303. {
  304. if(Enablevheal[playerid] == 0)
  305. {
  306. Enablevheal[playerid] = 1;
  307. KillTimer(timer[playerid][vHeal]);
  308. }
  309. return 1;
  310. }
  311. //==============================================================================
  312. //==============VIP Level 2 Commands============================================
  313. CMD:vplane(playerid, params[])
  314. {
  315. if(PlayerInfo[playerid][pVIP] >= 2)
  316. {
  317. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  318. new Float:X, Float:Y, Float:Z;
  319. GetPlayerPos(playerid, X, Y, Z);
  320. PutPlayerInVehicle(playerid, CreateVehicle(520, X, Y, Z, 0.0,0, 1, 60), 0);
  321. SendClientMessage(playerid, BLUE,"Enjoy your vip plane");
  322. HasSpawnedCar[playerid] = 1;
  323. }
  324. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 2 to use this command");
  325. return 1;
  326. }
  327. //=======================================VBONUS=================================
  328. CMD:vpbonus(playerid, params[])
  329. {
  330. if(PlayerInfo[playerid][pVIP] >= 2)
  331. {
  332. if(Enablevbonus[playerid] == 1)
  333. {
  334. for(new i = 0; i < MAX_PLAYERS; i++)
  335. {
  336. if(IsPlayerConnected(i))
  337. {
  338. new Float:x, Float:y, Float:z, Float:health, Float:armour;
  339. GetPlayerHealth(i, health);
  340. GetPlayerArmour(i, armour);
  341. GetPlayerPos(playerid, x, y, z);
  342. if(IsPlayerInRangeOfPoint(i, 20.0, x, y, z))
  343. {
  344. GivePlayerWeapon(i, 35,10);
  345. SetPlayerHealth(i, health + 100);
  346. SetPlayerArmour(i, armour + 100);
  347. Enablevbonus[playerid] = 0;
  348. timer[playerid][vBonus] = SetTimer("EnablevBonus", 120*1000, false);
  349. SendClientMessage(i, GREEN,"[INFO]: VIP near you has used bonus command so you got +10 RPG and some health and armour!");
  350. }
  351. }
  352. }
  353. } else return SendClientMessage(playerid, RED,"[ERROR]: You can only use this command each two minutes");
  354. } else return SendClientMessage(playerid, RED,"[ERROR]: You are not vip level 2");
  355. return 1;
  356. }
  357. //========================================VNOS==================================
  358. CMD:vnos(playerid, params[])
  359. {
  360. if(PlayerInfo[playerid][pVIP] >= 2)
  361. {
  362. if(IsPlayerInAnyVehicle(playerid))
  363. {
  364. switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
  365. {
  366. case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
  367. return SendClientMessage(playerid,RED,"ERROR: You can not tune this vehicle!");
  368. }
  369. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  370. return PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
  371. }
  372. else return SendClientMessage(playerid,RED,"ERROR: You must be in a vehicle.");
  373. }
  374. else return SendClientMessage(playerid,RED,"ERROR: You are not a high enough level to use this command");
  375. }
  376. //==============================================================================
  377. //=======================NEW VIP Level 2 Commands===============================
  378. CMD:vweaps(playerid, params[])
  379. {
  380. if(PlayerInfo[playerid][pVIP] >= 2)
  381. {
  382. GivePlayerWeapon(playerid,1,1);
  383. GivePlayerWeapon(playerid,4,1);
  384. GivePlayerWeapon(playerid,16,10000);
  385. GivePlayerWeapon(playerid,24,10000);
  386. GivePlayerWeapon(playerid,26,10000);
  387. GivePlayerWeapon(playerid,29,10000);
  388. GivePlayerWeapon(playerid,31,10000);
  389. GivePlayerWeapon(playerid,34,10000);
  390. GivePlayerWeapon(playerid,38,10000);
  391. GivePlayerWeapon(playerid,42,10000);
  392. GivePlayerWeapon(playerid,46,10000);
  393. SendClientMessage(playerid, GREEN,"[INFO][]: You have spawned all the vip weapons!");
  394. }
  395. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be VIP level 2 to use this command!");
  396. return 1;
  397. }
  398. CMD:vboat(playerid, params[])
  399. {
  400. if(PlayerInfo[playerid][pVIP] >= 2)
  401. {
  402. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  403. new Float:X, Float:Y, Float:Z;
  404. GetPlayerPos(playerid, X, Y, Z);
  405. PutPlayerInVehicle(playerid, CreateVehicle(452, X, Y, Z, 0.0,0, 1, 60), 0);
  406. SendClientMessage(playerid, BLUE,"Enjoy your vip boat");
  407. HasSpawnedCar[playerid] = 1;
  408. }
  409. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 2 to use this command");
  410. return 1;
  411. }
  412. CMD:vsay(playerid, params[])
  413. {
  414. if(PlayerInfo[playerid][pVIP] >= 1)
  415. {
  416. new text;
  417. if(sscanf(params,"s[125]",text)) return SendClientMessage(playerid, RED,"[USAGE]: /vsay [text");
  418. new string[256], pName[MAX_PLAYER_NAME];
  419. GetPlayerName(playerid, pName,sizeof(pName));
  420. format(string, sizeof(string),"*%s %s: %s",Rank(playerid),pName, text);
  421. SendClientMessageToAll(GetPlayerColor(playerid), string);
  422. }
  423. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be VIP to use this command!");
  424. return 1;
  425. }
  426. //====================VIP LEVEL 3 Commands======================================
  427. CMD:vskin(playerid, params[])
  428. {
  429. if(PlayerInfo[playerid][pVIP] >= 3)
  430. {
  431. new skinid, string[128];
  432. if(sscanf(params, "d", skinid))
  433. {
  434. SendClientMessage(playerid, RED, "USAGE: /skin [skinID].");
  435. }
  436. else
  437. {
  438. if(skinid > 299 || skinid < 0)
  439. {
  440. SendClientMessage(playerid, RED, "[ERROR]: Invalid skin ID.");
  441. }
  442. else
  443. {
  444. SetPlayerSkin(playerid, skinid);
  445. format(string, sizeof(string), "[]VIP INFO[]: You have changed your skin to %d.", skinid);
  446. SendClientMessage(playerid, GREEN, string);
  447. }
  448. }
  449. }
  450. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command");
  451. return 1;
  452. }
  453. CMD:vfix(playerid, params[])
  454. {
  455. if(PlayerInfo[playerid][pVIP] >= 3)
  456. {
  457. if(IsPlayerInAnyVehicle(playerid))
  458. {
  459. new veh;
  460. veh = GetPlayerVehicleID(playerid);
  461. RepairVehicle(veh);
  462. return SendClientMessage(playerid, GREEN,"[]VIP[]: Your vehicle has been repaired");
  463. }
  464. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be in vehicle to use this command");
  465. }
  466. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command");
  467. }
  468. CMD:vjetpack(playerid, params[])
  469. {
  470. if(PlayerInfo[playerid][pVIP] >= 3)
  471. {
  472. SetPlayerSpecialAction(playerid, 2);
  473. }
  474. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command");
  475. return 1;
  476. }
  477. CMD:vtime(playerid, params[])
  478. {
  479. if(PlayerInfo[playerid][pVIP] >= 3)
  480. {
  481. new time;
  482. if(sscanf(params,"d",time)) return SendClientMessage(playerid, RED,"[USAGE]: /vtime [time]");
  483. SetPlayerTime(playerid, time, 0);
  484. SendClientMessage(playerid, BLUE,"[]VIP[] You have changed your time");
  485. }
  486. else return SendClientMessage(playerid, RED,"[ERROR]: You are not vip level 3");
  487. return 1;
  488. }
  489. CMD:varmour(playerid, params[])
  490. {
  491. if(PlayerInfo[playerid][pVIP] >= 3)
  492. {
  493. if(Enablevheal[playerid] == 1)
  494. {
  495. Enablevheal[playerid] = 0;
  496. timer[playerid][vHeal] = SetTimer("EnablevHeal", 120*1000,false); //Used same timer as vheal.. would not be messy ..
  497. GameTextForPlayer(playerid,"~g~Armoured",1500, 3);
  498. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  499. return SetPlayerArmour(playerid, 100.0);
  500.  
  501. } else return SendClientMessage(playerid, RED,"[ERROR]: You can only use this command in each two minutes");
  502. } else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command!");
  503. }
  504. CMD:vmenu(playerid, params[])
  505. {
  506. if(PlayerInfo[playerid][pVIP] >= 2)
  507. {
  508. new lstring[325];
  509. format(lstring, sizeof(lstring),""cgreen"Bike\n"cblue"Car\n"corange"Plane\n"cred"Maverick\n"cred"Heal me\n"cgreen"Armour me\n"cred"Vehicle Fix\n"corange"Spawn JetPack");
  510. ShowPlayerDialog(playerid, DIALOGCMDS,DIALOG_STYLE_LIST,""corange"NVIP Menu",lstring,"Select","Close");
  511. }
  512. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 2 to use this command");
  513. return 1;
  514. }
  515. //=================DIALOG TIME ^^===============================================
  516. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  517. {
  518. new Float:X, Float:Y, Float:Z;
  519. GetPlayerPos(playerid, X, Y, Z);
  520. if(dialogid == DIALOGCMDS)
  521. {
  522. switch(listitem)
  523. {
  524. case 0:
  525. {
  526. if(PlayerInfo[playerid][pVIP] >= 1)
  527. {
  528. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  529. PutPlayerInVehicle(playerid, CreateVehicle(522, X, Y, Z, 0.0,0, 1, 60), 0);
  530. SendClientMessage(playerid, BLUE,"Enjoy your new vip bike!");
  531. HasSpawnedCar[playerid] = 1;
  532. }
  533. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  534. }
  535. case 1:
  536. {
  537. if(PlayerInfo[playerid][pVIP] >= 1)
  538. {
  539. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  540. PutPlayerInVehicle(playerid, CreateVehicle(415, X, Y, Z, 0.0,0, 1, 60), 0);
  541. SendClientMessage(playerid, BLUE,"Enjoy your vip car");
  542. HasSpawnedCar[playerid] = 1;
  543. }
  544. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command");
  545. }
  546. case 2:
  547. {
  548. if(PlayerInfo[playerid][pVIP] >= 2)
  549. {
  550. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  551. PutPlayerInVehicle(playerid, CreateVehicle(513, X, Y, Z, 0.0,0, 1, 60), 0);
  552. SendClientMessage(playerid, BLUE,"Enjoy your vip plane");
  553. HasSpawnedCar[playerid] = 1;
  554. }
  555. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 2 to use this command");
  556. }
  557. case 3:
  558. {
  559. if(PlayerInfo[playerid][pVIP] >= 1)
  560. {
  561. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED,"[ERROR]: You already have a vehicle!");
  562. PutPlayerInVehicle(playerid, CreateVehicle(487, X, Y, Z, 0.0,0, 1, 60), 0);
  563. SendClientMessage(playerid, BLUE,"Enjoy your new vip helicopter!");
  564. }
  565. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  566. }
  567. case 4:
  568. {
  569. if(PlayerInfo[playerid][pVIP] >= 1)
  570. {
  571. if(Enablevheal[playerid] == 1)
  572. {
  573. SetPlayerHealth(playerid, 100.0);
  574. GameTextForPlayer(playerid,"~g~Healed",1500, 3);
  575. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  576. Enablevheal[playerid] = 0;
  577. timer[playerid][vHeal] = SetTimer("EnablevHeal", 120*1000,false);
  578. } else return SendClientMessage(playerid, RED,"[ERROR]: You can only use this command in each two minutes");
  579. } else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 1 to use this command!");
  580. }
  581. case 5:
  582. {
  583. if(PlayerInfo[playerid][pVIP] >= 3)
  584. {
  585. if(Enablevheal[playerid] == 1)
  586. {
  587. Enablevheal[playerid] = 0;
  588. timer[playerid][vHeal] = SetTimer("EnablevHeal", 120*1000,false); //Used same timer as vheal.. would not be messy ..
  589. GameTextForPlayer(playerid,"~g~Armoured",1500, 3);
  590. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  591. return SetPlayerArmour(playerid, 100.0);
  592. } else return SendClientMessage(playerid, RED,"[ERROR]: You can only use this command in each two minutes");
  593. } else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command!");
  594. }
  595. case 6:
  596. {
  597. if(PlayerInfo[playerid][pVIP] >= 3)
  598. {
  599. if(IsPlayerInAnyVehicle(playerid))
  600. {
  601. new veh;
  602. veh = GetPlayerVehicleID(playerid);
  603. RepairVehicle(veh);
  604. return SendClientMessage(playerid, GREEN,"[]VIP[]: Your vehicle has been repaired");
  605. }
  606. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be in vehicle to use this command");
  607. }
  608. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command");
  609. }
  610. case 7:
  611. {
  612. if(PlayerInfo[playerid][pVIP] >= 3)
  613. {
  614. SetPlayerSpecialAction(playerid, 2);
  615. }
  616. else return SendClientMessage(playerid, RED,"[ERROR]: You need to be vip level 3 to use this command");
  617. }
  618. }
  619. }
  620. return 0;
  621. }
  622. //========================OnPlayerExitVehicle===================================
  623. public OnPlayerExitVehicle(playerid, vehicleid)
  624. {
  625. if(HasSpawnedCar[playerid] == 1)
  626. {
  627. DestroyVehicle(vehicleid);
  628. HasSpawnedCar[playerid] = 0;
  629. SendClientMessage(playerid, RED,"[] INFO []: Your vehicle has been destroyed to avoid vehicle spam in JN server");
  630. }
  631. return 1;
  632. }
  633. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement