Code:
/*
Map Mod Loader by OhManMyBad
There are 4 places here marked with '///' that need to be customized for each map mod
Leave the rest of the code alone unless you know what you're doing
*/
#include <natives.h>
#include <common.h>
#include <types.h>
#include <consts.h>
void GET_NETWORK_ID_FROM_OBJECT(Object obj, int *id);
void SET_NETWORK_ID_CAN_MIGRATE(int id, boolean enabled);
boolean IS_NETWORK_SESSION(void);
/// credits
#define TITLE "~b~Ocean Overpass"
#define AUTHOR "~b~Created by ~r~InTheSevens"
/// coords for blip display x, y, z
#define BLIPCOORDS 2391.9526, 805.2510, 5.3734
// number of objects in your map mod + 1
Object objects[65];
int nvid;
Blip mapblip;
void print(char* text)
{
CLEAR_PRINTS();
PRINT_STRING_WITH_LITERAL_STRING("string",text,3000,true);
}
void create(int id, uint model, float x, float y, float z, float h, float qx, float qy, float qz, float qw, bool dynamic)
{
if (IS_MODEL_IN_CDIMAGE(model))
{
REQUEST_MODEL(model);
while (!HAS_MODEL_LOADED(model))
WAIT(0);
CREATE_OBJECT(model, x, y, z, &objects[id], true);
SET_OBJECT_HEADING(objects[id], h);
SET_OBJECT_QUATERNION(objects[id], qx, qy, qz, qw);
SET_OBJECT_INVINCIBLE(objects[id], true);
SET_OBJECT_PROOFS(objects[id], false, false, false, false, false);
SET_OBJECT_VISIBLE(objects[id], true);
SET_OBJECT_LIGHTS(objects[id], true);
if (dynamic)
SET_OBJECT_DYNAMIC(objects[id], true);
else
FREEZE_OBJECT_POSITION(objects[id], true);
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
WAIT(50);
if (IS_NETWORK_SESSION())
{
GET_NETWORK_ID_FROM_OBJECT(objects[id], &nvid);
SET_NETWORK_ID_CAN_MIGRATE(nvid, false);
}
}
}
#ifdef BLIPCOORDS
void blip_location(void)
{
ADD_BLIP_FOR_COORD(BLIPCOORDS, &mapblip);
CHANGE_BLIP_ALPHA(mapblip, 255);
CHANGE_BLIP_SPRITE(mapblip, 82);
#ifdef TITLE
CHANGE_BLIP_NAME_FROM_ASCII(mapblip, TITLE);
#endif
CHANGE_BLIP_COLOUR(mapblip, 5);
}
#endif
void main(void){
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
#ifdef BLIPCOORDS
blip_location();
#endif
#ifdef TITLE
print(TITLE); WAIT(2000);
#endif
#ifdef AUTHOR
print(AUTHOR);
#endif
/// objects
//*********************************************************************************
// function format:
// create(objid, modelhash, x, y, z, h, qx, qy, qz, qw, dynamic);
//
// object id is unique for each piece of the map mod, start at 0 and increase
// with each piece. then take the id of your last piece, add + 1 to it and use
// that number for the objects array above - Object objects[#];
//*********************************************************************************
create(0, 1072695029, 2391.9526, 805.2510, 5.3734, 317.0000, 0.0811, -0.0319, -0.3651, 0.9269, 0);
create(1, 1072695029, 2398.1479, 811.8790, 6.9720, 317.0000, 0.0811, -0.0319, -0.3651, 0.9269, 0);
create(2, 1072695029, 2404.3022, 818.4401, 9.2114, 317.0000, 0.1455, -0.0573, -0.3620, 0.9190, 0);
create(3, 1072695029, 2410.2727, 824.8523, 12.0608, 317.0000, 0.1455, -0.0573, -0.3620, 0.9190, 0);
create(4, 1072695029, 2416.1743, 831.1440, 15.3513, 317.0000, 0.1934, -0.0762, -0.3585, 0.9101, 0);
create(5, 1072695029, 2421.9077, 837.3398, 19.1047, 317.0000, 0.1934, -0.0762, -0.3585, 0.9101, 0);
create(6, 1072695029, 2427.7051, 843.5262, 22.8833, 317.0000, 0.1934, -0.0762, -0.3585, 0.9101, 0);
create(7, 1072695029, 2433.4561, 849.6713, 26.6302, 317.0000, 0.1934, -0.0762, -0.3585, 0.9101, 0);
create(8, 1072695029, 2439.4126, 856.0414, 28.4746, 317.0000, 0.0000, 0.0000, -0.3665, 0.9304, 0);
create(9, 1072695029, 2445.6619, 862.7448, 28.4807, 317.0000, 0.0000, 0.0000, -0.3665, 0.9304, 0);
create(10, 1072695029, 2451.9458, 869.4778, 28.4868, 317.0000, 0.0000, 0.0000, -0.3665, 0.9304, 0);
create(11, 1072695029, 2458.2668, 876.2508, 28.4929, 317.0000, 0.0000, 0.0000, -0.3665, 0.9304, 0);
create(12, 1072695029, 2464.6030, 883.0201, 28.4990, 317.0000, 0.0000, 0.0000, -0.3665, 0.9304, 0);
create(13, 1072695029, 2470.9211, 889.7879, 28.5051, 317.0000, 0.0000, 0.0000, -0.3665, 0.9304, 0);
create(14, 1072695029, 2476.9187, 895.4541, 28.5112, 310.0000, 0.0000, 0.0000, -0.4226, 0.9063, 0);
create(15, 1072695029, 2483.5803, 900.3771, 28.5173, 303.0000, 0.0000, 0.0000, -0.4772, 0.8788, 0);
create(16, 1072695029, 2490.7393, 904.4095, 28.5234, 296.0000, 0.0000, 0.0000, -0.5299, 0.8480, 0);
create(17, 1072695029, 2498.2385, 907.4989, 28.5295, 289.0000, 0.0000, 0.0000, -0.5807, 0.8141, 0);
create(18, 1072695029, 2505.8677, 909.4373, 28.5356, 280.0000, 0.0000, 0.0000, -0.6428, 0.7660, 0);
create(19, 1072695029, 2514.1042, 910.4673, 28.5417, 274.0000, 0.0000, 0.0000, -0.6820, 0.7314, 0);
create(20, 1072695029, 2523.3474, 911.1036, 28.5478, 274.0000, 0.0000, 0.0000, -0.6820, 0.7314, 0);
create(21, 1072695029, 2532.5813, 911.7404, 28.5538, 274.0000, 0.0000, 0.0000, -0.6820, 0.7314, 0);
create(22, 1072695029, 2541.7864, 912.3690, 28.8691, 274.0000, 0.0255, -0.0238, -0.6816, 0.7309, 0);
create(23, 1072695029, 2550.8782, 912.9993, 29.9852, 274.0000, 0.0637, -0.0594, -0.6794, 0.7286, 0);
create(24, 1072695029, 2559.7954, 913.6303, 32.2155, 274.0000, 0.1144, -0.1067, -0.6736, 0.7223, 0);
create(25, 1072695029, 2567.8784, 914.2189, 35.3891, 274.0000, 0.1583, -0.1476, -0.6653, 0.7140, 0);
create(26, 1072695029, 2700.9116, 929.8918, 44.9369, 87.0000, -0.1322, -0.1254, 0.6768, 0.7132, 0);
create(27, 1072695029, 2709.4485, 929.4392, 48.2172, 87.0000, -0.1322, -0.1254, 0.6768, 0.7132, 0);
create(28, 1072695029, 2835.2007, 797.0812, 38.7589, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(29, 1072695029, 2832.0427, 788.4802, 40.1490, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(30, 1072695029, 2828.9243, 779.9376, 41.5843, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(31, 1072695029, 2825.8328, 771.4518, 43.0171, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(32, 1072695029, 2822.7168, 762.9290, 44.4557, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(33, 1072695029, 2819.5806, 754.3478, 45.9001, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(34, 1072695029, 2816.4836, 745.8586, 47.3237, 340.0000, -0.0773, 0.0136, -0.1731, 0.9818, 0);
create(35, 1072695029, 2813.3669, 737.2749, 48.0300, 340.0000, 0.0000, 0.0000, -0.1736, 0.9848, 0);
create(36, 1072695029, 2810.2354, 728.7033, 48.0100, 340.0000, 0.0000, 0.0000, -0.1736, 0.9848, 0);
create(37, 1072695029, 2807.0754, 720.0460, 47.9900, 340.0000, 0.0000, 0.0000, -0.1736, 0.9848, 0);
create(38, 1072695029, 2803.9243, 711.4150, 47.9700, 340.0000, 0.0000, 0.0000, -0.1736, 0.9848, 0);
create(39, 1072695029, 2800.8008, 702.8385, 47.9500, 340.0000, 0.0000, 0.0000, -0.1736, 0.9848, 0);
create(40, 1072695029, 2797.6589, 694.2480, 47.9300, 340.0000, 0.0000, 0.0000, -0.1736, 0.9848, 0);
create(41, 1072695029, 2794.3196, 686.7788, 47.9100, 332.0000, 0.0000, 0.0000, -0.2419, 0.9703, 0);
create(42, 1072695029, 2790.0173, 679.6134, 47.8900, 326.0000, 0.0000, 0.0000, -0.2924, 0.9563, 0);
create(43, 1072695029, 2785.0256, 673.1146, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(44, 1072695029, 2778.9861, 666.1973, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(45, 1072695029, 2772.9822, 659.3122, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(46, 1072695029, 2766.9451, 652.3766, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(47, 1072695029, 2760.9314, 645.4774, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(48, 1072695029, 2754.8940, 638.5508, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(49, 1072695029, 2748.9102, 631.6725, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(50, 1072695029, 2742.8647, 624.7221, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(51, 1072695029, 2736.8098, 617.7662, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(52, 1072695029, 2730.7471, 610.8073, 47.8700, 319.0000, 0.0000, 0.0000, -0.3502, 0.9367, 0);
create(53, 1072695029, 2692.3354, 930.3537, 41.6500, 87.0000, -0.1322, -0.1254, 0.6768, 0.7132, 0);
create(54, 1072695029, 2724.7014, 603.8196, 48.5168, 319.0000, -0.0653, 0.0244, -0.3494, 0.9344, 0);
create(55, 1072695029, 2718.7600, 596.9889, 50.2682, 319.0000, -0.1142, 0.0427, -0.3476, 0.9297, 0);
create(56, 1072695029, 2713.0925, 590.4604, 53.2487, 319.0000, -0.1947, 0.0728, -0.3426, 0.9162, 0);
create(57, 1335460286, 2605.6841, 920.5284, 21.5079, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(58, 1335460286, 2647.0391, 925.5220, 21.5079, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(59, 1335460286, 2675.8782, 930.7001, 21.5079, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(60, 1335460286, 2843.0693, 820.9229, 19.7074, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(61, 1335460286, 2830.9636, 855.0534, 19.7074, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(62, 1335460286, 2822.1069, 892.0380, 19.7074, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(63, 1335460286, 2801.0835, 921.2432, 19.7074, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
create(64, 1335460286, 2762.8909, 926.5839, 19.7074, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0);
while(true)
WAIT(0);
}