Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #pragma tabsize 0
- // Based on Avenger678's Private Parking. Map and scripts by Charlie.
- new Parkin;
- new Parkout;
- new infopickup;
- forward GateClose();
- forward OnPlayerPickUpPickup(playerid, pickupid);
- #define COLOR_YELLOW 0xFFCC33FF
- #define Filterscript
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Parking lot by Charlie ~ Loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Parking lot by Charlie ~ Unloaded");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- Parkin = CreateObject(986, 1101.5893554688, -1739.1286621094, 9.3185873031616, 0, 0, 270.67565917969);
- Parkout = CreateObject(986, 1101.5650634766, -1744.4025878906, 9.3185873031616, 0, 0, 270.67565917969);
- AddStaticVehicle(430,5284.4639,-2040.4980,-0.2431,324.8803,2,2); //
- AddStaticVehicle(430,5267.8457,-2041.3950,0.3464,325.3297,2,2); //
- AddStaticVehicle(430,5260.8735,-2025.8702,0.4445,322.3928,2,2); //
- AddStaticVehicle(454,5401.6606,-2034.3774,-0.1165,348.6204,0,1); //
- AddStaticVehicle(453,5415.3672,-2038.8029,-0.8996,350.0270,1,0); //
- AddStaticVehicle(484,5389.6475,-2030.0148,0.7670,347.1714,1,0); //
- AddStaticVehicle(454,5378.5278,-2030.2928,0.7680,348.9799,1,0); //
- CreateObject(984, 1101.4180908203, -1752.7836914063, 12.980166435242, 0, 0, 0);
- CreateObject(984, 1101.3834228516, -1765.4821777344, 12.980166435242, 0, 0, 0);
- CreateObject(983, 1101.1169433594, -1774.4772949219, 13.02885055542, 0, 0, 354.04504394531);
- CreateObject(984, 1059.2642822266, -1742.458984375, 13.259499549866, 0, 0, 0);
- CreateObject(984, 1059.4967041016, -1755.2888183594, 13.073745727539, 0, 0, 0);
- CreateObject(984, 1059.515625, -1768.1898193359, 13.016991615295, 0, 0, 0);
- CreateObject(983, 1059.4903564453, -1773.6623535156, 13.039874076843, 0, 0, 0);
- CreateObject(984, 1065.8560791016, -1777.0593261719, 13.151827812195, 0, 0, 270.67565917969);
- CreateObject(984, 1078.548828125, -1777.0032958984, 12.978029251099, 0, 0, 270.67565917969);
- CreateObject(984, 1091.3845214844, -1776.888671875, 12.976320266724, 0, 0, 270.40515136719);
- CreateObject(984, 1094.5240478516, -1776.8763427734, 12.976341247559, 0, 0, 270.67565917969);
- CreateObject(984, 1065.6726074219, -1736.0697021484, 13.116521835327, 0, 0, 270.67565917969);
- CreateObject(984, 1078.4537353516, -1735.8502197266, 13.089923858643, 0, 0, 270.67565917969);
- CreateObject(984, 1091.3116455078, -1735.7734375, 13.126383781433, 0, 0, 270.67565917969);
- CreateObject(983, 1099.1799316406, -1735.71875, 13.256020545959, 0, 0, 270.67565917969);
- CreateObject(3660, 1111.7370605469, -1740.5815429688, 15.065198898315, 0, 0, 0);
- CreateObject(8406, 1122.6119384766, -1742.8967285156, 17.965801239014, 0, 0, 89.730285644531);
- CreateObject(3881, 1106.8354492188, -1733.1091308594, 14.625, 0, 0, 89.324493408203);
- CreateObject(8843, 1092.6254882813, -1738.3706054688, 12.761115074158, 0, 0, 91.309509277344);
- CreateObject(8843, 1074.7938232422, -1744.7119140625, 12.691846847534, 0, 0, 132.99450683594);
- CreateObject(8843, 1070.1348876953, -1763.0447998047, 12.691846847534, 0, 0, 192.53930664063);
- CreateObject(8843, 1079.8914794922, -1775.7092285156, 12.691846847534, 0, 0, 269.94995117188);
- CreateObject(8843, 1089.0885009766, -1767.4569091797, 12.691846847534, 0, 0, 359.26940917969);
- CreateObject(8843, 1095.2307128906, -1751.5197753906, 12.691846847534, 0, 0, 323.5341796875);
- CreateObject(2773, 1075.4031982422, -1772.59, 12.866847038269, 0, 0, 258.76574707031);
- CreateObject(2773, 1078.3104248047, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
- CreateObject(2773, 1080.966796875, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
- CreateObject(2773, 1083.4792480469, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
- CreateObject(2773, 1085.9772949219, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
- AddStaticPickup(1318,1,1098.82, -1743.93, 13.44); //exit
- infopickup = CreatePickup(1239,1,1107.41, -1738.94, 13.48); //entrance + ,,i" pickup
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp(cmdtext, "/parkin", true)==0)
- {
- if(PlayerToPoint(5, playerid, 1107.41, -1738.94, 13.48)) // ,,i" pickup
- {
- GivePlayerMoney(playerid,-3000);
- MoveObject(Parkin, 1101.5893554688, -1739.1286621094, 0.3185873031616,100.5); // opens both gates
- MoveObject(Parkout, 1101.5650634766, -1744.4025878906, 0.3185873031616,100.5); // opens both gates
- SetTimer("GateClose", 5000, 0);
- SendClientMessage(playerid, COLOR_YELLOW,"Hello there! Alright, come in(-$3,000).");
- }
- return 1;
- }
- if (strcmp(cmdtext, "/parkout", true)==0)
- {
- if(PlayerToPoint(5, playerid, 1098.82, -1743.93, 13.44)) // arrow pickup
- {
- MoveObject(Parkin,1101.5893554688, -1739.1286621094, 0.3185873031616,3.5); // opens both gates
- MoveObject(Parkout,1101.5893554688, -1739.1286621094, 0.3185873031616,3.5); // opens both gates
- SetTimer("GateClose", 5000, 0);
- SendClientMessage(playerid, COLOR_YELLOW,"Goodbye, come back later!");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/parkinghelp", true) ==0)
- {
- if(IsPlayerConnected(playerid))
- {
- {
- SendClientMessage(playerid,COLOR_YELLOW,"*** Location *** It's located near Verona Beach at a place called Conference Center.");
- SendClientMessage(playerid,COLOR_YELLOW,"*** Parking - Commands *** /parkin | /parkout");
- SendClientMessage(playerid,COLOR_YELLOW,"*** Parking - $$ *** It only costs $3,000 to enter.");
- SendClientMessage(playerid,COLOR_YELLOW,"*** Parking - Arrows *** Follow the arrows, it shows where to drive, so people won't cause accidents.");
- SendClientMessage(playerid,COLOR_YELLOW,"*** Information *** Map and Script by Charlie (( SA-MP forum name: DRCharlie )). ");
- }
- }
- return 1;
- }
- return 0;
- }
- public GateClose()
- {
- MoveObject(Parkin,1101.5893554688, -1739.1286621094, 9.3185873031616,5.5);//opens both gates
- MoveObject(Parkout,1101.5650634766, -1744.4025878906, 9.3185873031616,5.5);//opens both gates
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if (pickupid == infopickup)
- {
- GameTextForPlayer(playerid," ~r~ /parkinghelp ~b~/parkin ~y~/parkout",5000,5);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, COLOR_YELLOW,"This sever uses (DR)Charlie's parking lot(/parkinghelp).");
- }
- PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment