EOussama

EO_VIP 2.0 include

Mar 3rd, 2018
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.06 KB | None | 0 0
  1. /*=======================================================================================================================================================
  2. ==========================================================================================================================================================
  3.                                                             oooooooooooo   .oooooo.
  4.                                                             `888'     `8  d8P'  `Y8b
  5.                                                              888         888      888
  6.                                                              888oooo8    888      888
  7.                                                              888    "    888      888
  8.                                                              888       o `88b    d88'
  9.                                                             o888ooooood8  `Y8bood8P'
  10.                                                                VIP SYSTEM Include
  11.                                                             by Oussama .aka. Compton
  12.                                                 NOTE: Please note that the credits are to be kept.
  13. > Natives
  14. ------------------[Player]------------------
  15. native setVIPLevel(playerid, vlevel);
  16. native getVIPLevel(playerid);
  17. native bool:isPlayerVIP(playerid);
  18. native getVIPName(playerid);
  19. native getPlayerAccID(playerid);
  20. native bool:isPlayerVIPTagActive(playerid);
  21. native bool:isVIPInLoungue(playerid);
  22. native TogglePlayerVIPTag(playerid, bool:param);
  23. native SendClientMessageToVIPs(const message[], color, exception = INVALID_PLAYER_ID, minLvl = EOVIP_VIPLEVEL_1, maxLvl = EOVIP_VIPLEVEL_4);
  24. native ResetVIPData(playerid);
  25. native SaveVIPData(playerid, MySQL:handle);
  26. -------------------[Base]-------------------
  27. native CreateVIPBase();
  28. native ToggleVIPGates(bool:action);
  29. native bool:isVIPGateOpened();
  30. ----------------[Vehicles]------------------
  31. native CreateVIPVehicles();
  32. native bool:isVIPVehicle(vehicleid);
  33. -----------------[Other]--------------------
  34. native PlaySoundForAll(soundid, Float:posX, Float:posY, Float:posZ);
  35. native StopSoundForAll();
  36. ============================================================================================================================================================
  37. ==========================================================================================================================================================*/
  38.  
  39. //**Definitions------------------------------------------------------------------------------------------------------------------------------
  40. #define EOVIP_VIPLEVEL_0            0
  41. #define EOVIP_VIPLEVEL_1            1
  42. #define EOVIP_VIPLEVEL_2            2
  43. #define EOVIP_VIPLEVEL_3            3
  44. #define EOVIP_VIPLEVEL_4            4
  45.  
  46. #define EOVIP_VIPNAME_0             "None"
  47. #define EOVIP_VIPNAME_1             "Silver"
  48. #define EOVIP_VIPNAME_2             "Gold"
  49. #define EOVIP_VIPNAME_3             "Platinum"
  50. #define EOVIP_VIPNAME_4             "Diamond"
  51.  
  52. #define EOVIP_CCOLOR_FEE_2          1000        // The fee for changing the vehicle's color for VIP level 2.
  53. #define EOVIP_CCOLOR_FEE_3          500         // The fee for changing the vehicle's color for VIP level 3.
  54. #define EOVIP_CCOLOR_FEE_4          250         // The fee for changing the vehicle's color for VIP level 4.
  55.  
  56. #define EOVIP_CNOS_FEE_2            1000        // The fee for adding nitros to vehicles for VIP level 2.
  57. #define EOVIP_CNOS_FEE_3            500         // The fee for adding nitros to vehicles for VIP level 3.
  58. #define EOVIP_CNOS_FEE_4            250         // The fee for adding nitros to vehicles for VIP level 4.
  59.    
  60. #define EOVIP_CEFIX_FEE_3           500         // The fee for fixing the vehicle's engine for VIP level 3.
  61. #define EOVIP_CEFIX_FEE_4           250         // The fee for fixing the vehicle's engine for VIP level 4.
  62.  
  63. #define EOVIP_CBFIX_FEE             450         // The fee for fixing vehicles' bodies.
  64.  
  65. //**Variables--------------------------------------------------------------------------------------------------------------------------------
  66. new gVIPVehicles[38];
  67.  
  68. //**Enums------------------------------------------------------------------------------------------------------------------------------------
  69. enum E_VIP_DATA
  70. {
  71.     e_VIPID,
  72.     e_VIPLevel,
  73.     e_VIPGunPackCoolDown,
  74.     e_VIPBaseTeleportCoolDown,
  75.     e_VIPGPMelee,
  76.     e_VIPGPPistol,
  77.     e_VIPGPShotgun,
  78.     e_VIPGPSubMachine,
  79.     e_VIPGPAssault,
  80.     e_VIPGPRifle,
  81.     e_VIPToysIndex[10],
  82.     e_VIPSelectedBone,
  83.     bool:e_VIPToysSlots[10],
  84.     bool:e_IsVIPInLounge,
  85.     bool:e_VIPBaseSpawn,
  86.     bool:e_VIPTag,
  87.     bool:e_VIPGunPackPreset,
  88.     bool:e_VIPFirstSpawn,
  89.     Text3D:e_VIPTagID
  90. };
  91.  
  92. enum E_VIP_GATE
  93. {
  94.     e_Gate1,
  95.     e_Gate2,
  96.     bool:e_IsGateOpened,
  97.     bool:e_IsPublic
  98. };
  99.  
  100. new
  101.     VIPInfo[MAX_PLAYERS][E_VIP_DATA],
  102.     VIPGate[E_VIP_GATE],
  103.     Iterator:VIP<MAX_PLAYERS>
  104. ;
  105.  
  106. //**Functions--------------------------------------------------------------------------------------------------------------------------------
  107. setVIPLevel(playerid, vLevel)
  108. {
  109.     if(vLevel >= EOVIP_VIPLEVEL_0 && vLevel <= EOVIP_VIPLEVEL_4)
  110.     {
  111.         if(vLevel && !Iter_Contains(VIP, playerid))
  112.             Iter_Add(VIP, playerid);
  113.         else
  114.             Iter_Remove(VIP, playerid);
  115.  
  116.         VIPInfo[playerid][e_VIPLevel] = vLevel;
  117.     }
  118. }
  119.  
  120. getVIPLevel(playerid) return VIPInfo[playerid][e_VIPLevel];
  121.  
  122.  
  123. getVIPName(playerid)
  124. {
  125.     new vName[9];
  126.  
  127.     switch(VIPInfo[playerid][e_VIPLevel])
  128.     {
  129.         case EOVIP_VIPLEVEL_0: { strcpy(vName, EOVIP_VIPNAME_0, 9); }
  130.         case EOVIP_VIPLEVEL_1: { strcpy(vName, EOVIP_VIPNAME_1, 9); }
  131.         case EOVIP_VIPLEVEL_2: { strcpy(vName, EOVIP_VIPNAME_2, 9); }
  132.         case EOVIP_VIPLEVEL_3: { strcpy(vName, EOVIP_VIPNAME_3, 9); }
  133.         case EOVIP_VIPLEVEL_4: { strcpy(vName, EOVIP_VIPNAME_4, 9); }
  134.     }
  135.  
  136.     return vName;
  137. }
  138.  
  139. bool:isPlayerVIP(playerid) return VIPInfo[playerid][e_VIPLevel] ? true : false;
  140.  
  141. getPlayerAccID(playerid) return VIPInfo[playerid][e_VIPID];
  142.  
  143. bool:isPlayerVIPTagActive(playerid) return VIPInfo[playerid][e_VIPTag];
  144.  
  145. TogglePlayerVIPTag(playerid, bool:param)
  146. {
  147.     new strTag[22];
  148.  
  149.     if(param)
  150.     {
  151.         format(strTag, sizeof(strTag), "VIP "VIPCOL_WHITE"Level %i", getVIPLevel(playerid));
  152.         VIPInfo[playerid][e_VIPTagID] = CreateDynamic3DTextLabel(strTag, VIPCOLOR_ORANGE, 0.0, 0.0, 0.0, 10, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 10);
  153.         SendClientMessage(playerid, VIPCOLOR_ORANGE, "[EO_VIP]: "VIPCOL_WHITE"You have turned the VIP tag ON");
  154.     }
  155.  
  156.     else
  157.     {
  158.         DestroyDynamic3DTextLabel(VIPInfo[playerid][e_VIPTagID]);
  159.         SendClientMessage(playerid, VIPCOLOR_ORANGE, "[EO_VIP]: "VIPCOL_WHITE"You have turned the VIP tag OFF");
  160.     }
  161.  
  162.     VIPInfo[playerid][e_VIPTag] = param;
  163. }
  164.  
  165. bool:isVIPInLoungue(playerid) return VIPInfo[playerid][e_IsVIPInLounge];
  166.  
  167. ResetVIPData(playerid)
  168. {
  169.     new clearedData[E_VIP_DATA];
  170.     VIPInfo[playerid] = clearedData;
  171. }
  172.  
  173. SaveVIPData(playerid, MySQL:handle)
  174. {
  175.     new _query[350];
  176.  
  177.     mysql_format(handle, _query, sizeof(_query), "UPDATE `VIPs` SET \
  178.         `VIPLevel` = %d, \
  179.         `SpawnInBase` = %d, \
  180.         `WeaponPreset` = %d, \
  181.         `WeaponMeleeSlot` = %d, \
  182.         `WeaponPistolSlot` = %d, \
  183.         `WeaponShotgunSlot` = %d, \
  184.         `WeaponSubMachineSlot` = %d, \
  185.         `WeaponAssaultSlot` = %d, \
  186.         `WeaponRifleSlot` = %d WHERE `Username` = '%e'",
  187.         getVIPLevel(playerid),
  188.         VIPInfo[playerid][e_VIPBaseSpawn],
  189.         VIPInfo[playerid][e_VIPGunPackPreset],
  190.         VIPInfo[playerid][e_VIPGPMelee],
  191.         VIPInfo[playerid][e_VIPGPPistol],
  192.         VIPInfo[playerid][e_VIPGPShotgun],
  193.         VIPInfo[playerid][e_VIPGPSubMachine],
  194.         VIPInfo[playerid][e_VIPGPAssault],
  195.         VIPInfo[playerid][e_VIPGPRifle],
  196.         GetPlayerNameEx(playerid));
  197.  
  198.     mysql_tquery(handle, _query);
  199. }
  200.  
  201. bool:isVIPVehicle(vehicleid)
  202. {
  203.     for(new i, j = sizeof(gVIPVehicles); i < j; i++)
  204.     {
  205.         if(vehicleid == gVIPVehicles[i])
  206.             return true;
  207.     }
  208.  
  209.     return false;
  210. }
  211.  
  212. ToggleVIPGates(bool:action)
  213. {
  214.     switch(action)
  215.     {
  216.         case true:
  217.         {
  218.             MoveDynamicObject(VIPGate[e_Gate1], 3002.3396, -677.6714, 1.9951, 3.0);
  219.             MoveDynamicObject(VIPGate[e_Gate2], 3002.3396, -697.8354, 1.9951, 3.0);
  220.             PlaySoundForAll(1100, 3002.3396, -677.6714, 1.9951);
  221.             VIPGate[e_IsGateOpened] = true;
  222.             defer StopSoundTimer();
  223.         }
  224.  
  225.         case false:
  226.         {
  227.             MoveDynamicObject(VIPGate[e_Gate1], 3002.3396, -683.2094, 1.9951, 3.0);
  228.             MoveDynamicObject(VIPGate[e_Gate2], 3002.3396, -692.0134, 1.9951, 3.0);
  229.             PlaySoundForAll(1100, 3002.3396, -683.2094, 1.9951);
  230.             VIPGate[e_IsGateOpened] = false;
  231.             defer StopSoundTimer();
  232.         }
  233.     }
  234.  
  235.     defer VIPGateAutoCloseTimer();
  236. }
  237.  
  238. bool:isVIPGateOpened() return VIPGate[e_IsGateOpened];
  239.  
  240. SendClientMessageToVIPs(const message[], color, exception = INVALID_PLAYER_ID, minLvl = EOVIP_VIPLEVEL_1, maxLvl = EOVIP_VIPLEVEL_4)
  241. {
  242.     foreach(new i : VIP)
  243.     {
  244.         if(VIPInfo[i][e_VIPLevel] >= minLvl && VIPInfo[i][e_VIPLevel] <= maxLvl && exception != i)
  245.             SendClientMessage(i, color, message);
  246.     }
  247. }
  248.  
  249. CreateVIPVehicles()
  250. {
  251.     gVIPVehicles[0] = CreateVehicle(411, 3023.3174, -663.6208, 2.4356, 0.0000, 6, 6, 100);
  252.     gVIPVehicles[1] = CreateVehicle(411, 3030.1333, -663.6208, 2.4356, 0.0000, 6, 6, 100);
  253.     gVIPVehicles[2] = CreateVehicle(411, 3009.9695, -663.6208, 2.4356, 0.0000, 6, 6, 100);
  254.     gVIPVehicles[3] = CreateVehicle(522, 3069.4780, -714.9214, 2.2332, 0.0000, 6, 6, 100);
  255.     gVIPVehicles[4] = CreateVehicle(522, 3069.4780, -711.7974, 2.2332, 0.0000, 6, 6, 100);
  256.     gVIPVehicles[5] = CreateVehicle(522, 3069.4780, -708.3894, 2.2332, 0.0000, 6, 6, 100);
  257.     gVIPVehicles[6] = CreateVehicle(522, 3075.7261, -707.9634, 2.2332, 0.0000, 6, 6, 100);
  258.     gVIPVehicles[7] = CreateVehicle(522, 3073.8801, -707.9634, 2.2332, 0.0000, 6, 6, 100);
  259.     gVIPVehicles[8] = CreateVehicle(522, 3073.8801, -711.3714, 2.2332, 0.0000, 6, 6, 100);
  260.     gVIPVehicles[9] = CreateVehicle(522, 3075.7261, -711.3714, 2.2332, 0.0000, 6, 6, 100);
  261.     gVIPVehicles[10] = CreateVehicle(451, 3030.6123, -656.5804, 2.3751, 180.0000, 6, 6, 100);
  262.     gVIPVehicles[11] = CreateVehicle(451, 3037.0022, -656.5804, 2.3751, 180.0000, 6, 6, 100);
  263.     gVIPVehicles[12] = CreateVehicle(451, 3024.0803, -656.5804, 2.3751, 180.0000, 6, 6, 100);
  264.     gVIPVehicles[13] = CreateVehicle(487, 3065.8286, -654.2310, 15.1676, 90.0000, 6, 6, 100);
  265.     gVIPVehicles[14] = CreateVehicle(487, 3065.8286, -667.4370, 15.1676, -90.0000, 6, 6, 100);
  266.     gVIPVehicles[15] = CreateVehicle(470, 3009.4387, -655.6624, 2.5133, 180.0000, 6, 6, 100);
  267.     gVIPVehicles[16] = CreateVehicle(470, 3016.6807, -655.6624, 2.5133, 180.0000, 6, 6, 100);
  268.     gVIPVehicles[17] = CreateVehicle(444, 3071.3596, -651.0118, 2.9290, 180.0000, 6, 6, 100);
  269.     gVIPVehicles[18] = CreateVehicle(444, 3066.1057, -651.0118, 2.9290, 180.0000, 6, 6, 100);
  270.     gVIPVehicles[19] = CreateVehicle(444, 3061.2776, -651.0118, 2.9290, 180.0000, 6, 6, 100);
  271.     gVIPVehicles[20] = CreateVehicle(444, 3061.2776, -669.8978, 2.9290, 0.0000, 6, 6, 100);
  272.     gVIPVehicles[21] = CreateVehicle(444, 3066.5315, -669.8978, 2.9290, 0.0000, 6, 6, 100);
  273.     gVIPVehicles[22] = CreateVehicle(463, 3075.6326, -704.8986, 2.2331, 0.0000, 6, 6, 100);
  274.     gVIPVehicles[23] = CreateVehicle(463, 3073.7866, -704.8986, 2.2331, 0.0000, 6, 6, 100);
  275.     gVIPVehicles[24] = CreateVehicle(539, 3064.4543, -714.8845, 2.2331, 0.0000, 6, 6, 100);
  276.     gVIPVehicles[25] = CreateVehicle(539, 3059.6262, -714.8845, 2.2331, 0.0000, 6, 6, 100);
  277.     gVIPVehicles[26] = CreateVehicle(539, 3059.6262, -710.1985, 2.2331, 0.0000, 6, 6, 100);
  278.     gVIPVehicles[27] = CreateVehicle(539, 3059.6262, -705.7965, 2.2331, 0.0000, 6, 6, 100);
  279.     gVIPVehicles[28] = CreateVehicle(539, 3064.3123, -705.7965, 2.2331, 0.0000, 6, 6, 100);
  280.     gVIPVehicles[29] = CreateVehicle(539, 3064.3123, -710.1985, 2.2331, 0.0000, 6, 6, 100);
  281.     gVIPVehicles[30] = CreateVehicle(556, 3077.7942, -679.0674, 2.6504, 0.0000, 6, 6, 100);
  282.     gVIPVehicles[31] = CreateVehicle(556, 3072.3982, -679.0674, 2.6504, 0.0000, 6, 6, 100);
  283.     gVIPVehicles[32] = CreateVehicle(556, 3066.2922, -679.0674, 2.6504, 0.0000, 6, 6, 100);
  284.     gVIPVehicles[33] = CreateVehicle(481, 3027.9504, -692.3883, 2.2612, 0.0000, 6, 6, 100);
  285.     gVIPVehicles[34] = CreateVehicle(481, 3028.8025, -692.3883, 2.2612, 0.0000, 6, 6, 100);
  286.     gVIPVehicles[35] = CreateVehicle(481, 3029.6545, -693.8083, 2.2612, 0.0000, 6, 6, 100);
  287.     gVIPVehicles[36] = CreateVehicle(481, 3030.7905, -693.8083, 2.2612, 0.0000, 6, 6, 100);
  288.     gVIPVehicles[37] = CreateVehicle(481, 3031.9265, -693.8083, 2.2612, 0.0000, 6, 6, 100);
  289.  
  290.     for(new i = 0; i < sizeof(gVIPVehicles); i++)
  291.     {
  292.         Attach3DTextLabelToVehicle(Create3DTextLabel("VIP "VIPCOL_WHITE"Vehicle", VIPCOLOR_YELLOW, 0.0, 0.0, -10.0, 15.0, 0, 1), gVIPVehicles[i], 0.0, 0.0, 1.5);
  293.         AddVehicleComponent(gVIPVehicles[i], 1010);
  294.     }
  295. }
  296.  
  297. CreateVIPBase()
  298. {
  299.     //Objects
  300.     CreateDynamicObject(8661, 3022.12695, -672.72382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  301.     CreateDynamicObject(8661, 3022.12695, -653.22382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  302.     CreateDynamicObject(8661, 3061.62695, -653.22382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  303.     CreateDynamicObject(8661, 3061.62695, -672.72382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  304.     CreateDynamicObject(8661, 3061.62695, -692.22382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  305.     CreateDynamicObject(8661, 3022.12695, -692.22382, 0.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  306.     CreateDynamicObject(8661, 3061.62695, -711.72382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  307.     CreateDynamicObject(8661, 3022.12695, -692.22382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  308.     CreateDynamicObject(8661, 3022.12695, -711.72382, 1.80860,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  309.     CreateDynamicObject(8210, 3053.42676, -644.44202, 4.68320,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  310.     CreateDynamicObject(8210, 3028.50269, -644.44202, 4.68320,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  311.     CreateDynamicObject(8210, 3080.58472, -672.34198, 4.68320,   0.00000, 0.00000, 89.00000, -1, -1, -1, 500, 500);
  312.     CreateDynamicObject(8210, 3080.58472, -694.17200, 4.68320,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  313.     CreateDynamicObject(8210, 3053.35278, -721.40399, 4.68320,   0.00000, 0.00000, 180.00000, -1, -1, -1, 500, 500);
  314.     CreateDynamicObject(8210, 3029.06470, -721.40399, 4.68320,   0.00000, 0.00000, 180.00000, -1, -1, -1, 500, 500);
  315.     CreateDynamicObject(3749, 3003.83130, -683.48969, 7.68770,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  316.     CreateDynamicObject(987, 3003.03687, -656.29919, 1.77550,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  317.     CreateDynamicObject(987, 3003.03687, -673.96320, 1.77550,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  318.     CreateDynamicObject(987, 3003.03687, -665.13123, 1.77550,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  319.     CreateDynamicObject(987, 3003.03687, -704.50720, 1.77550,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  320.     CreateDynamicObject(987, 3003.03687, -721.43518, 1.77550,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  321.     CreateDynamicObject(987, 3003.03687, -713.33917, 1.77550,   0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  322.     CreateDynamicObject(18788, 2983.97705, -683.33478, 0.81030,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  323.     CreateDynamicObject(18788, 2960.26514, -683.33478, 0.81030,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  324.     CreateDynamicObject(16287, 3072.45190, -710.08112, 1.79360,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  325.     CreateDynamicObject(16287, 3061.95190, -710.08112, 1.79360,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  326.     CreateDynamicObject(16287, 3050.95190, -710.08112, 1.79360,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  327.     CreateDynamicObject(10831, 3066.83032, -660.64362, 6.29510,   0.00000, 0.00000, -90.00000, -1, -1, -1, 500, 500);
  328.     CreateDynamicObject(18850, 3065.63550, -660.40881, 1.78560,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  329.     CreateDynamicObject(13749, 3061.92041, -681.63129, 7.07810,   0.00000, 0.00000, -37.00000, -1, -1, -1, 500, 500);
  330.     CreateDynamicObject(3605, 3024.24756, -706.26788, 7.87870,   0.00000, 0.00000, 180.00000, -1, -1, -1, 500, 500);
  331.     CreateDynamicObject(8838, 3020.13696, -662.13177, 3.29460,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  332.     CreateDynamicObject(8838, 3020.13696, -656.63177, 3.29460,   0.00000, 0.00000, 180.00000, -1, -1, -1, 500, 500);
  333.     CreateDynamicObject(52, 3025.04810, -693.57910, 2.65190,   0.00000, 0.00000, 0.00000, -1, -1, -1, 500, 500);
  334.    
  335.     //3D Text Labels
  336.     CreateDynamic3DTextLabel("VIP {FFFF00}Base\nPress {FF00FF}N {FFFFFF}to open the gate", VIPCOLOR_YELLOW, 3001.5039, -683.3127, 2.0232, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
  337.     CreateDynamic3DTextLabel("VIP {FFFFFF}Lounge\nPress {FF00FF}N {FFFFFF}to enter", VIPCOLOR_YELLOW, 3024.9241, -692.5798, 3.3770, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
  338.  
  339.     //Base Gate
  340.     VIPGate[e_Gate1] = CreateDynamicObject(969, 3002.25830, -683.18237, 1.85340, 0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  341.     VIPGate[e_Gate2] = CreateDynamicObject(969, 3002.25830, -691.98639, 1.85340, 0.00000, 0.00000, 90.00000, -1, -1, -1, 500, 500);
  342.     ToggleVIPGates(false);
  343. }
  344.  
  345. PlaySoundForAll(soundid, Float:posX, Float:posY, Float:posZ)
  346. {
  347.     foreach(new i : Player)
  348.         PlayerPlaySound(i, soundid, posX, posY, posZ);
  349. }
  350.  
  351. StopSoundForAll()
  352. {
  353.     foreach(new i : Player)
  354.         PlayerPlaySound(i, 0, 3002.3396, -683.2094, 1.9951);
  355. }
  356.  
  357. //**Timers--------------------------------------------------------------------------------------------------------------------------------
  358. timer VIPGateAutoCloseTimer[6000]()
  359. {
  360.     MoveDynamicObject(VIPGate[e_Gate1], 3002.3396, -683.2094, 1.9951, 3.0);
  361.     MoveDynamicObject(VIPGate[e_Gate2], 3002.3396, -692.0134, 1.9951, 3.0);
  362.     PlaySoundForAll(1100, 3002.3396, -683.2094, 1.9951);
  363.     VIPGate[e_IsGateOpened] = false;
  364.     defer StopSoundTimer();
  365. }
  366.  
  367. timer StopSoundTimer[2000]()
  368. {
  369.     StopSoundForAll();
  370. }
Advertisement
Add Comment
Please, Sign In to add comment