Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <streamer>
- #include <dini>
- #include <sscanf2>
- #include <ZCMD>
- #define MAX_PLAYER_OBJECTS 500
- #define PLAYERS 24
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_BLUE 0x33AAFFFF
- #define COLOR_GREEN 0x33AA33FF
- #define COLOR_GREEN2 0x9EC73DFF
- #define COLOR_YELLOW 0xFFFF94FF
- #define COLOR_PMYELLOW 0xDABB3EFF
- #define COLOR_BYELLOW 0xFFFF00FF
- #define COLOR_PM 0x00AA00FF
- #define COLOR_TIP 0x00808000
- #define COLOR_RED 0xFF0000FF
- #define COLOR_CYAN 0x00FFFFFF
- #define COLOR_LIGHTRED 0xFF6347FF
- #define COLOR_PURPLE 0xC2A2DAFF
- #define COLOR_ORANGE 0xFF9900FF
- #define COLOR_GREY 0xAFAFAFFF
- #define COLOR_DBLUE 0x2641FEFF
- #define COLOR_ADMIN 0x2587CEFF
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- enum ObjectLibrary
- {
- ObjectName[64],
- ObjectID
- }
- new msg[128];
- new objects[MAX_PLAYER_OBJECTS];
- new objectmodel[MAX_PLAYER_OBJECTS];
- new objectmatinfo[MAX_PLAYER_OBJECTS][3][64];
- new Attached[MAX_PLAYER_OBJECTS];
- new bigmatinfo[256];
- new name[MAX_PLAYER_NAME];
- new PlayerText:objinfo[PLAYERS][34];
- new PlayerText:ObjTextdraw[PLAYERS];
- // Syntax:
- // {"Object Name", ObjectID},
- new ObjectNames[][ObjectLibrary] = {
- {"Purple Dildo",321},
- {"White Dildo",322},
- {"Vibrator",323},
- {"Small Vibrator",324},
- {"Flowers",325},
- {"Cane",326},
- {"Cellphone",330},
- {"Brass Knuckles",331},
- {"Golf Club",333},
- {"Night Stick",334},
- {"Knife",335},
- {"Baseball Bat",336},
- {"Shovel",337},
- {"Pool Cue",338},
- {"Katana",339},
- {"Chainsaw",341},
- {"Frag Grenade",342},
- {"Molotov Cocktail",344},
- {"Tear Gas",343},
- {"Pistol",346},
- {"Silenced Pistol",347},
- {"Desert Eagle",348},
- {"Shotgun",349},
- {"Sawn Off Shotgun",350},
- {"Combat Shotgun",351},
- {"SMG UZI",352},
- {"SMG MP5",353},
- {"AK47 Assault Rifle",355},
- {"M4 Assault Rifle",356},
- {"Coutnry Rifle",357},
- {"Sniper Rifle",358},
- {"Rocket Launcher",359},
- {"Heat Seeker Rocket Launcher",360},
- {"Flamethrower",361},
- {"Minigun",362},
- {"Satchel Charges",363},
- {"Detonator",364},
- {"Pepper Spray Can",365},
- {"Fire Extinguisher",366},
- {"Camera",367},
- {"Night Vision Goggles",368},
- {"Infrared Goggles",369},
- {"Parachute",371},
- {"SMG Tec-9",372},
- {"Armour",373},
- {"Curved palm tree",648},
- {"Small Tree",700},
- {"Small Thick Bush",701},
- {"Small Thin Bush",702},
- {"Big Tree with lots of Bushes Surrounding",703},
- {"Big Tree",704},
- {"Big Tree with some Bushes Surrounding",705},
- {"Big Tree with some Bushes Surrounding",708},
- {"MASSIVE Tree with some bushes",709},
- {"Palm Tree",710},
- {"Short Palm Tree",711},
- {"Short&Thick Coconut Tree",712},
- {"Medium Tree",713},
- {"Gigantic Tree",714},
- {"Huge Tree",715},
- {"Palm Tree on a Stand",716},
- {"Small Tree on a Stand",717},
- {"Big Palm Tree on a Stand",718},
- {"Huge Tree",720},
- {"Gigantic Tree",722},
- {"Big Tree",723},
- {"Biggest Tree",724},
- {"Huge Tree",725},
- {"Little plant",948},
- {"Barrier Base",966},
- {"Barrier House",967},
- {"Barrier",968},
- {"Medium Metal Gate",969},
- {"Little Metal Fence",970},
- {"Tall Metal Gate",971},
- {"Big Construction Wall",972},
- {"Metal Road Barrier",973},
- {"White Metal Fence",974},
- {"Small Metal Gate",975},
- {"Small Metal Gate",976},
- {"Orange and White Road Barrier",978},
- {"Orange and White Road Barrier",979},
- {"Big Metal Gate",980},
- {"Lighted road barrier",981},
- {"Very Long Small Metal Fence",982},
- {"Small Metal Fence",983},
- {"Long Small Metal Fence",984},
- {"Electrified Metal Gate",985},
- {"Electrified Metal Gate",986},
- {"Electrified Metal Fence",987},
- {"Airport Metal Gate",988},
- {"Airport Metal Gate",989},
- {"Long White Metal Fence",990},
- {"White Metal Fence",991},
- {"White Metal Fence",992},
- {"Long White Metal Fence",993},
- {"Walkway metal barrier",994},
- {"Briefcase",1210},
- {"Fire Hydrant",1211},
- {"Money Pack",1212},
- {"Small Octagonal Cap",1213},
- {"Octagonal Concrete Post",1214},
- {"Octagonal concrete post with light",1215},
- {"Metal Barrel",1216},
- {"Toxic Waste Barrel",1217},
- {"Wood Pallet",1219},
- {"Cardboard Box",1220},
- {"Barrel with coal",1222},
- {"Single Light Post",1223},
- {"Gray Crate",1224},
- {"Explosive Barrel",1225},
- {"Curved single highway lamppost",1226},
- {"Green Trash Bin",1227},
- {"Stripped Work horse",1228},
- {"Bus Stop Sign",1229},
- {"No Parking Sign",1233},
- {"Road warning barrel",1237},
- {"Traffic Cone",1238},
- {"Info Icon",1239},
- {"Heart Icon",1240},
- {"Adrenaline Pill",1241},
- {"Armor Icon",1241},
- {"Gas Pump",1244},
- {"Wooden Ramp",1245},
- {"Bribe Icon",1247},
- {"GTA 3 Icon",1248},
- {"Mail Box",1249},
- {"C4 Bomb",1252},
- {"Skull Icon",1254},
- {"Bus Stop",1257},
- {"Huge Billboard",1259},
- {"Big Billboard",1260},
- {"Wooden Crate",1271},
- {"Blue House Icon",1272},
- {"Green House Icon",1273},
- {"Money Icon",1274},
- {"T-Shirt Icon",1275},
- {"TIKI Figure",1276},
- {"Disk Icon",1277},
- {"Tall Stadium Light",1278},
- {"Wrapped Drug",1279},
- {"Breakable Wooden Bench",1280},
- {"Picnic Table with red umbrella",1281},
- {"Newspaper Box",1287},
- {"Group of 5 cardboard boxes",1299},
- {"Punching bag",1985},
- {"Outdoor concrete trashcan",1300},
- {"Soda Machine",1302},
- {"Parachute with Leg Straws",1310},
- {"Two Skulls Icon",1313},
- {"Two red Guys Icon",1314},
- {"Traffic Light",1315},
- {"Food Stand",1340},
- {"Wooden bench with bushes",1364},
- {"Flammable drum",1370},
- {"Breakable White wooden fence",1408},
- {"Breakable Wooden fence",1418},
- {"Breakable Black metal fence",1419},
- {"Breakable Boxes",1421},
- {"Construction roadblock",1422},
- {"Red and blue roadblock",1423},
- {"Old Metal roadblock",1424},
- {"Detour sign",1425},
- {"Bridge walkway",1426},
- {"Road fold-out block with light",1427},
- {"Leaning ladder",1428},
- {"Ghetto wood TV",1429},
- {"Round white table with 3 red chairs",1432},
- {"Bar table",1433},
- {"Single road barricade",1434},
- {"Single road barricade",1435},
- {"Bridge walkway",1436},
- {"Big leaning ladder",1437},
- {"Breakable pile of boxes",1438},
- {"Open dumpster",1439},
- {"Breakable pile of boxes",1440},
- {"Porn books and video sale sign",1443},
- {"Breakable Green picket fence",1446},
- {"Breakable metal fence",1447},
- {"Out House",1452},
- {"Squeezed hay-roll",1453},
- {"Hay Roll",1454},
- {"Hay Cart",1458},
- {"Road Barrier",1459},
- {"Wood stack",1463},
- {"Breakable Chain Fence",1468},
- {"Breakable Wooden steps",1472},
- {"Breakable Wooden Roof",1479},
- {"BBQ Grill",1481},
- {"Bottle of Beer",1484},
- {"Plants of weed",1485},
- {"Big Beer",1486},
- {"Big Beer",1487},
- {"Wall Beer",1488},
- {"Wooden Door",1491},
- {"Green Door",1492},
- {"Red Screen Door",1493},
- {"Blue old door",1494},
- {"Metal bolted door",1495},
- {"CJ Door",1496},
- {"Big Bolted metal door",1497},
- {"Metal door",1499},
- {"Barber Door",1500},
- {"Old Screen",1501},
- {"Classic wood door",1502},
- {"Red 6sqr Door",1504},
- {"Wide metal double doors",1508},
- {"Whiskey Bottle",1512},
- {"Candy Bar Rack",1513},
- {"Cash Register",1514},
- {"Poker Machine",1515},
- {"Small Card Table",1516},
- {"TV",1518},
- {"Store Door",1522},
- {"Swinging Door",1523},
- {"Shop Door",1532},
- {"Shop Door",1533},
- {"Chunk of warehouse windows",1534},
- {"Safe house door",1535},
- {"Freeway overhand sign",1539},
- {"Sack of money",1550},
- {"Wooden Box",1558},
- {"White jet seat",1562},
- {"Restaurant door",1566},
- {"Little Metal stand",1571},
- {"Shopping Cart",1572},
- {"White sack of cocaine",1575},
- {"Brown sack of cocaine",1576},
- {"Yellow sack of cocaine",1577},
- {"Green sack of cocaine",1578},
- {"Blue sack of cocaine",1579},
- {"Red sack of cocaine",1580},
- {"Security Card",1581},
- {"Pizza Box",1582},
- {"Luigi Target",1583},
- {"Misty Target",1584},
- {"Asuka Target",1585},
- {"Ammunation Target",1586},
- {"Tire Spikes",1593},
- {"Table with 4 chairs",1594},
- {"Big Satellite Dish",1595},
- {"Beach Ball",1598},
- {"Dolphin",1607},
- {"Shark",1608},
- {"Turtle",1609},
- {"Sub Marine",1612},
- {"Security camera",1616},
- {"Glass Windows",1649},
- {"White Windows",1651},
- {"Gas Pump",1676},
- {"Red Radar",1682},
- {"Construction container",1684},
- {"Ramp",1655},
- {"Office Chair",1663},
- {"Black Couch",1703},
- {"Black metal chair",1714},
- {"Ugly metal chair",1722},
- {"Wooden Chair",1739},
- {"Jail bed",1771},
- {"Soda Machine",1775},
- {"Yellow single couch",1764},
- {"Yellow couch",1765},
- {"Couch",1766},
- {"Video Player",1788},
- {"Bed",1798},
- {"Office chair",1806},
- {"Old metal chair",1810},
- {"Small cafe table",1817},
- {"Cafe Table",1822},
- {"Cafe table",1827},
- {"Tiger carpet",1828},
- {"Widescreen TV",1876},
- {"Wheel of fortune",1895},
- {"White small ball",1974},
- {"Roulette table",1978},
- {"Double office desk",1998},
- {"Single white office desk",1999},
- {"File cabinet",2000},
- {"Office plant",2001},
- {"Water dispenser",2002},
- {"Dark wooden office cabinet",2204},
- {"Blck wooden desk",2206},
- {"Single office desk",2008},
- {"Game console",2028},
- {"Sandbag",2060},
- {"Bullets",2061},
- {"Barrel",2062},
- {"Stand",2063},
- {"WWII Cannon",2064},
- {"File Cabinet",2067},
- {"Camouflage Roof",2068},
- {"Dinning table",2086},
- {"Bed",2090},
- {"Rocking Table",2096},
- {"Disc reproducer",2100},
- {"Music reproducer",2103},
- {"Foot lamp",2069},
- {"Closet and stands with TV",2091},
- {"Home theater",2104},
- {"Foot lamp",2108},
- {"Low dinning table",2110},
- {"Wooden dinning table",2112},
- {"Basket ball",2114},
- {"Wooden table",2112},
- {"Cafe Table",2118},
- {"Wooden chair",2120},
- {"Red stool",2125},
- {"Wooden kitchen cooker",2135},
- {"Wooden kitchen sink",2136},
- {"Wooden kitchen table",2137},
- {"Tall wooden kitchen closet",2140},
- {"Office unit with books",2164},
- {"Wooden table with PC",2165},
- {"Double wooden table with PC",2166},
- {"Office unit",2167},
- {"Blue office Desk",2172},
- {"Wooden desk",2173},
- {"Office wooden desk",2180},
- {"Boss office desk",2184},
- {"Blackjack table",2188},
- {"Computer (PC) Screen",2190},
- {"Blue library",2191},
- {"Blue office desk",2193},
- {"Police Archives",2197},
- {"Wooden cabinet with PCs",2199},
- {"Archives",2200},
- {"Photocopier",2202},
- {"Round wooden desk",2208},
- {"Donuts",2222},
- {"Black Speaker",2229},
- {"Wooden speaker",2230},
- {"Wooden speaker",2231},
- {"Black metal speaker",2232},
- {"Flowers",2249},
- {"Car picture",2254},
- {"Porn picture",2255},
- {"Palms picture",2256},
- {"Big abstract picture",2257},
- {"City picture",2258},
- {"Bowling picture",2259},
- {"Brown big couch",2290},
- {"Brown single couch",2291},
- {"Brown foot couch",2293},
- {"Beanbag",2295},
- {"Full TV table",2296},
- {"Wooden table with TV",2297},
- {"Wooden cabinet",2306},
- {"Tall wooden cabinet",2307},
- {"Slot machine",2325},
- {"Safe",2332},
- {"Ammo box",2358},
- {"Clothes rail",2372},
- {"Blue clothes",2382},
- {"Blue clothes",2396},
- {"Surf board",2406},
- {"Fryer",2415},
- {"Microwave",2421},
- {"Store desk",2424},
- {"Bread frier",2426},
- {"Fryer",2451},
- {"Sink",2523},
- {"Bathtub",2526},
- {"Toilet",2528},
- {"Wharehouse shelf",2567},
- {"Wooden closet with table",2573},
- {"Wooden closet with table",2576},
- {"Hanging Meat",2589},
- {"Hook",2590},
- {"Wall TV",2596},
- {"Porn (Until 2588)",2581},
- {"Police desks",2604},
- {"Police desk with PC",2605},
- {"Security Monitors",2606},
- {"Police desk with papers",2607},
- {"Wooden Library with PC",2608},
- {"USA Flags",2614},
- {"Police board",2616},
- {"Treadmill",2627},
- {"Excersise Bike",2630},
- {"Excersise red carpet",2631},
- {"Poker machine",2640},
- {"Soda",2647},
- {"Burger shoot bag",2663},
- {"White sweater",2689},
- {"Orange shoes box",2694},
- {"Orange sweater",2704},
- {"Black stool",2723},
- {"Betting machine",2754},
- {"Red separator bar",2773},
- {"Black Chair",2776},
- {"Several slot machines",2785},
- {"Video game",2778},
- {"Video game",2779},
- {"Smoke Machine",2780},
- {"ATM",2781},
- {"Candle",2868},
- {"Green Capsule",2976},
- {"Minigun base",2888},
- {"Cellphone",2886},
- {"Ramp",2890},
- {"Cash Register",2941},
- {"Meat (Until 2806)",2803},
- {"Papers (Until 2827)",2824},
- {"Photos of people",2828},
- {"Long spike strip",2892},
- {"Short spike strip",2899},
- {"Pink and red flowers",2895},
- {"Coffin",2896},
- {"Green carpet",2898},
- {"GPS",2966},
- {"GYM Stuff",2913},
- {"GYM Stuff",2915},
- {"GYM Stuff",2916},
- {"Green Flag",2914},
- {"Mine",2918},
- {"Gate Barrier",2920},
- {"Small red crane",2956},
- {"Fire alarm",2961},
- {"Pool Table",2964},
- {"Dark green flag",2993},
- {"Rolled up blue map",3017},
- {"Weed (Smoked)",3027},
- {"Radio transmitter",3030},
- {"Chinese Lanterns",3038},
- {"Smoking Cigar",3044},
- {"Heli Magnet",3053},
- {"Garage Door",3055},
- {"Horse shoe",3056},
- {"Goggles",3070},
- {"Blackboard",3077},
- {"Ammo Capsule",3082},
- {"Line Closed sign",3091},
- {"Dead tied up cop",3096},
- {"Repair icon",3096},
- {"Parachute target",3096},
- {"Trailer",3169},
- {"Trailer",3171},
- {"Trailer",3172},
- {"Small trailer house",3242},
- {"Breakable wooden panel",3260},
- {"Will be shoot sign",3265},
- {"SAM Missile Launcher",3267},
- {"Breakable Wooden Fence",3276},
- {"Area 51 Tower",3279},
- {"Plane hangar",3268},
- {"Trailer house",3283},
- {"Oil tank",3287},
- {"Wooden stairs",3361},
- {"Breakable hay stack",3374},
- {"Operation table",3383},
- {"Storage computer",3384},
- {"Light blue light",3385},
- {"Processing computer",3387},
- {"Operation desk",3391},
- {"Table with radar",3393},
- {"Metal Stairs",3399},
- {"Torch",3461},
- {"Small pipe",3502},
- {"Portatile bathroom",3504},
- {"Small Blue House",3556},
- {"Small Purple House",3557},
- {"Train trailer",3564},
- {"Containers",3574},
- {"Yellow barrier",3578},
- {"Small House",3590},
- {"Wasted vehicle",3594},
- {"Mansion",3608},
- {"Big House",3609},
- {"Villa",3607},
- {"Villa",3619},
- {"Very big containers wall",3621},
- {"Medium warehouse",3624},
- {"Little construction house",3626},
- {"Cages wall",3630},
- {"Container with garbage",3722},
- {"Shelfs",3761},
- {"Roadblock",4516},
- {"Big roadblock",4524},
- {"Small Roadblock",4527},
- {"Walkway bridge",4882},
- {"Staircase",6976},
- {"Small set of containers",7025},
- {"Metal Stairs",7096},
- {"L Shaped containers",7102},
- {"Big set of containers",7186},
- {"AT-400 hangar",8240},
- {"Single plane hangar",8253},
- {"Medium set of containers",8337},
- {"Pirate Ship",8493},
- {"Metal Stairs",8572},
- {"Taller Metal Stairs",8613},
- {"Straight concrete road",11111},
- {"Big cow",11470},
- {"Toreno's ranch",11490},
- {"Toreno's ranch stairs",11491},
- {"Vehicle garage",11492},
- {"Big amount of big containers",12860},
- {"Toxic waste well",12986},
- {"White garage door",13028},
- {"Big Monkey",13667},
- {"Big Loop",13666},
- {"Room with a ramp",14422},
- {"Wooden Bench",14401},
- {"Flowers bush",14402},
- {"Big stairs",14407},
- {"4 Dragons Bar",14560},
- {"Caligula's bar",14582},
- {"Pile of boxes",14600},
- {"Boxing ring",14780},
- {"Lockers",14782},
- {"Karate ring",14787},
- {"Boxing ring",14791},
- {"Bed",14866},
- {"Lots of office archives",14895},
- {"Small Cow",16442},
- {"Medium plane hangar",16771},
- {"Helipad marks",16375},
- {"Small vehicle Garage",16409},
- {"White small wall",16500},
- {"White big wall",16501},
- {"Big ship containers",17019},
- {"White Barn",17298},
- {"White garage gate",17951},
- {"Big Rocks",18226},
- {"Wooden cabin",18259},
- {"Wooden cabin",18267},
- {"[0.3c] Fishing rod",18632},
- {"[0.3c] Wrench",18633},
- {"[0.3c] Crowbar",18634},
- {"[0.3c] Hammer",18635},
- {"[0.3c] Police Cap",18636},
- {"[0.3c] Police Shield",18637},
- {"[0.3c] Flashlight",18641},
- {"[0.3c] Taser",18642},
- {"[0.3c] Red Laser",18643},
- {"[0.3c] Screwdriver",18644},
- {"[0.3c] Motorcycle Helmet",18645},
- {"[0.3c] Police siren",18646},
- {"[0.3c] Red Neon",18647},
- {"[0.3c] Blue Neon",18648},
- {"[0.3c] Green Neon",18649},
- {"[0.3c] Yellow Neon",18650},
- {"[0.3c] Pink Neon",18651},
- {"[0.3c] White Neon",18652},
- {"[0.3c] Red Disco Light",18653},
- {"[0.3c] Green Disco Light",18654},
- {"[0.3c] Blue Disco Light",18655},
- {"[0.3c] Barrel explosion",18678},
- {"[0.3c] Crate explosion",18679},
- {"[0.3c] Door explosion",18680},
- {"[0.3c] Fuel explosion",18681},
- {"[0.3c] Large explosion",18682},
- {"[0.3c] Mediun explosion",18683},
- {"[0.3c] Molotov explosion",18684},
- {"[0.3c] Small explosion",18685},
- {"[0.3c] Tiny explosion",18686},
- {"[0.3c] Fire",18688},
- {"[0.3c] Bike fire",18689},
- {"[0.3c] Car fire",18690},
- {"[0.3c] Large fire",18691},
- {"[0.3c] Medium fire",18692},
- {"[0.3c] Flamethrower fire",18694},
- {"[0.3c] Nitro particles",18702},
- {"[0.3c] Island Base",18751},
- {"[0.3c] Volcano",18752},
- {"[0.3c] 125x125 Base",18753},
- {"[0.3c] 250x250 Base",18754},
- {"[0.3c] DM Cage",18759},
- {"[0.3c] DM Cage",18760},
- {"[0.3c] Race finish line",18761},
- {"[0.3c] 1x1x5 Concrete",18762},
- {"[0.3c] 3x3x5 Concrete",18763},
- {"[0.3c] 5x5x5 Concrete",18764},
- {"[0.3c] 10x10x5 Concrete",18765},
- {"[0.3c] 10x1x5 Concrete",18766},
- {"[0.3c] Concrete stair",18767},
- {"[0.3c] Skydive platform",18768},
- {"[0.3c] Spiral stair",18771},
- {"[0.3c] Tunnel section",18772},
- {"[0.3c] Tunnel join section (until 18776)",18773},
- {"[0.3c] Tunnel Spiral",18777},
- {"[0.3c] Ramp",18778},
- {"[0.3c] Ramp",18779},
- {"[0.3c] Ramp",18780},
- {"[0.3c] Big mesh ramp",18781},
- {"[0.3c] Cookie ramp",18782},
- {"[0.3c] Fun ramp",18783},
- {"[0.3c] Fun ramp",18784},
- {"[0.3c] Fun ramp",18785},
- {"[0.3c] Fun ramp",18786},
- {"[0.3c] Fun ramp",18787},
- {"[0.3c] 40m Road",18788},
- {"[0.3c] 150m Road",18789},
- {"[0.3c] 180 Degree Road",18790},
- {"[0.3c] 45 Degree Road",18791},
- {"[0.3c] Helix road",18800},
- {"[0.3c] Road Loop",18801},
- {"[0.3c] Bridge 150m", 18803},
- {"[0.3c] Tube 50m",18808},
- {"[0.3c] Glass 50m tube",18809},
- {"[0.3c] Bulge 50m tube",18810},
- {"[0.3c] Bulge & glass 50m tube",18811},
- {"[0.3c] Spiral tube",18828},
- {"[0.3c] Halfpipe",18836},
- {"[0.3c] Glass Sphere",18843},
- {"[0.3c] Water Sphere",18884},
- {"[0.3c] Texture Sphere",18845},
- {"[0.3c] Helipad",18850},
- {"[0.3c] Snow",18863},
- {"[0.3c] Cellphones (Until 18874)",18865},
- {"[0.3c] Speed Camera",18880},
- {"[0.3c] Rake",18890},
- {"[0.3c] Bandanas (Until 18910)",18891},
- {"[0.3c] Masks (Until 18920)",18911},
- {"[0.3c] Berets (Until 18925)",18921},
- {"[0.3c] Hats (Until 18935)",18926},
- {"[0.3c] Helmets (Until 18938)",18936},
- {"[0.3c] Bike Helmet",18976},
- {"[0.3c] Bike Helmet",18979},
- {"[0.3c] Ramp",19005},
- {"[0.3c] Glasses (Until 19035)",19006},
- {"[0.3c] Gift box",19054},
- {"[0.3c] Gift box",19055},
- {"[0.3c] Gift box",19056},
- {"[0.3c] Christmass tree",19076},
- {"[0.3c] Parrot",19078},
- {"[0.3c] Laser Pointers (Until 19084)",19080},
- {"[0.3c] Small disco dance Floor",19128},
- {"[0.3c] Big disco dance Floor",19129},
- {"[0.3c] Disco mirror ball",19159},
- {"[0.3d] Yellow taxi sign", 19308},
- {"[0.3d] Black taxi sign", 19309},
- {"[0.3d] White taxi sign", 19310},
- {"[0.3d] Black and yellow taxi sign", 19311},
- {"[0.3d] Bull Horns", 19314},
- {"[0.3d] Deer", 19315},
- {"[0.3d] Black bass guitar", 19317},
- {"[0.3d] White flyin guitar", 19318},
- {"[0.3d] Black warlock guitar", 19319},
- {"[0.3d] Pumpkin", 19320},
- {"[0.3d] Container", 19321},
- {"[0.3d] Yellow fireman hat", 19330},
- {"[0.3d] Black fireman hat", 19331},
- {"[0.3d] Red hot air balloon", 19332},
- {"[0.3d] Blue hot air balloon", 19333},
- {"[0.3d] White hot air balloon", 19334},
- {"[0.3d] Blue and yellow hot air balloon", 19335},
- {"[0.3d] Red, white and purple hot air balloon", 19336},
- {"[0.3d] Yellow, green and purple hot air balloon", 19337},
- {"[0.3d] Red and green hot air balloon", 19338},
- {"[0.3d] Coffin", 19339},
- {"[0.3d] White, red & green stripes easter egg", 19341},
- {"[0.3d] Purple & yellow easter egg", 19342},
- {"[0.3d] Lightblue, orange & green striped easter egg", 19343},
- {"[0.3d] Little yellow easter egg", 19344},
- {"[0.3d] Little striped easter egg", 19345},
- {"[0.3d] Hot Dog", 19346},
- {"[0.3e] Yellow police badge", 19347},
- {"[0.3e] Black Cane", 19348},
- {"[0.3e] Monocle", 19349},
- {"[0.3e] Moustache", 19350},
- {"[0.3e] Moustache", 19351},
- {"[0.3e] Top Hat", 19352},
- {"[INTERIOR FURNITURE] Medium - red and white", 19353},
- {"[INTERIOR FURNITURE] Medium - black striped", 19354},
- {"[INTERIOR FURNITURE] Medium - white concrete", 19355},
- {"[INTERIOR FURNITURE] Medium - brown wooden", 19356},
- {"[INTERIOR FURNITURE] Medium - white concrete", 19357},
- {"[INTERIOR FURNITURE] Medium - grey concrete", 19358},
- {"[INTERIOR FURNITURE] Medium - white wooden", 19359},
- {"[INTERIOR FURNITURE] Medium - red and brown wooden", 19360},
- {"[INTERIOR FURNITURE] Medium - wooden", 19361},
- {"[INTERIOR FURNITURE] Medium - white grain", 19362},
- {"[INTERIOR FURNITURE] Medium - brown concrete", 19363},
- {"[INTERIOR FURNITURE] Medium - white bricks", 19364},
- {"[INTERIOR FURNITURE] Medium - white concrete", 19365},
- {"[INTERIOR FURNITURE] Medium - wooden", 19366},
- {"[INTERIOR FURNITURE] Medium - grey-brown concrete", 19367},
- {"[INTERIOR FURNITURE] Medium - pinky-brown concrete", 19368},
- {"[INTERIOR FURNITURE] Medium - white-brown concrete", 19369},
- {"[INTERIOR FURNITURE] Medium - light wooden", 19370},
- {"[INTERIOR FURNITURE] Medium - white concrete", 19371},
- {"[INTERIOR FURNITURE] Medium - pinky grain", 19372},
- {"[INTERIOR FURNITURE] Medium - dark grain", 19373},
- {"[INTERIOR FURNITURE] Big - dark wooden", 19375},
- {"[INTERIOR FURNITURE] Big - wooden", 19376},
- {"[INTERIOR FURNITURE] Big - light grain", 19377},
- {"[INTERIOR FURNITURE] Big - striped wooden", 19378},
- {"[INTERIOR FURNITURE] Big - light wooden", 19379},
- {"[INTERIOR FURNITURE] Big - white concrete", 19380},
- {"[INTERIOR FURNITURE] Big - dark concrete", 19381},
- {"[INTERIOR DOORWAY] Red and white", 19383},
- {"[INTERIOR DOORWAY] Black striped", 19384},
- {"[INTERIOR DOORWAY] White concrete", 19385},
- {"[INTERIOR DOORWAY] Brown wooden", 19386},
- {"[INTERIOR DOORWAY] White concrete", 19387},
- {"[INTERIOR DOORWAY] Grey concrete", 19388},
- {"[INTERIOR DOORWAY] White wooden", 19389},
- {"[INTERIOR DOORWAY] Red and brown wooden", 19390},
- {"[INTERIOR DOORWAY] White grain", 19391},
- {"[INTERIOR DOORWAY] Brown concrete", 19392},
- {"[INTERIOR DOORWAY] White bricks", 19393},
- {"[INTERIOR DOORWAY] White concrete", 19394},
- {"[INTERIOR DOORWAY] Wooden concrete", 19395},
- {"[INTERIOR DOORWAY] Grey-brown concrete", 19396},
- {"[INTERIOR DOORWAY] Pinky-brown concrete", 19397},
- {"[INTERIOR DOORWAY] White-brown concrete", 19398},
- {"[INTERIOR WINDOWS] Red and white", 19399},
- {"[INTERIOR WINDOWS] Black striped", 19400},
- {"[INTERIOR WINDOWS] White concrete", 19401},
- {"[INTERIOR WINDOWS] Brown wooden", 19402},
- {"[INTERIOR WINDOWS] White concrete", 19403},
- {"[INTERIOR WINDOWS] Red and brown", 19404},
- {"[INTERIOR WINDOWS] White grain", 19405},
- {"[INTERIOR WINDOWS] Brown wooden", 19406},
- {"[INTERIOR WINDOWS] Brown and orange concrete", 19407},
- {"[INTERIOR WINDOWS] White grain", 19408},
- {"[INTERIOR WINDOWS] Brown concrete", 19409},
- {"[INTERIOR WINDOWS] White bricks", 19410},
- {"[INTERIOR WINDOWS] White concrete", 19411},
- {"[INTERIOR WINDOWS] Wooden", 19412},
- {"[INTERIOR WINDOWS] Grey-brown concrete", 19413},
- {"[INTERIOR WINDOWS] Pinky-brown concrete", 19414},
- {"[INTERIOR WINDOWS] White-brown concrete", 19415},
- {"[INTERIOR WINDOWS] Light wooden", 19416},
- {"[INTERIOR WINDOWS] White concrete", 19417},
- {"[0.3e] Handcuffs", 19418},
- {"[0.3e] Police siren (On)", 19419},
- {"[0.3e] Police siren (Off)", 19420},
- {"[0.3e] White headphones", 19421},
- {"[0.3e] Black headphones", 19422},
- {"[0.3e] Pink headphones", 19423},
- {"[0.3e] Blue headphones", 19424},
- {"[0.3e] Speed bump", 19425},
- {"[INTERIOR FURNITURE] Small - red and white", 19426},
- {"[INTERIOR FURNITURE] Small - black striped", 19427},
- {"[INTERIOR FURNITURE] Small - white concrete", 19428},
- {"[INTERIOR FURNITURE] Small - brown wooden", 19429},
- {"[INTERIOR FURNITURE] Small - white concrete", 19430},
- {"[INTERIOR FURNITURE] Small - grey concrete", 19431},
- {"[INTERIOR FURNITURE] Small - white wooden", 19432},
- {"[INTERIOR FURNITURE] Small - red and brown wooden", 19433},
- {"[INTERIOR FURNITURE] Small - wooden", 19434},
- {"[INTERIOR FURNITURE] Small - white grain", 19435},
- {"[INTERIOR FURNITURE] Small - brown concrete", 19436},
- {"[INTERIOR FURNITURE] Small - white bricks", 19437},
- {"[INTERIOR FURNITURE] Small - white concrete", 19438},
- {"[INTERIOR FURNITURE] Small - wooden", 19439},
- {"[INTERIOR FURNITURE] Small - grey-brown concrete", 19440},
- {"[INTERIOR FURNITURE] Small - pinky-brown concrete", 19441},
- {"[INTERIOR FURNITURE] Small - white-brown concrete", 19442},
- {"[INTERIOR FURNITURE] Small - light wooden", 19443},
- {"[INTERIOR FURNITURE] Small - white concrete", 19444},
- {"[INTERIOR FURNITURE] Width - red and white", 19445},
- {"[INTERIOR FURNITURE] Width - black striped", 19446},
- {"[INTERIOR FURNITURE] Width - white concrete", 19447},
- {"[INTERIOR FURNITURE] Width - brown wooden", 19448},
- {"[INTERIOR FURNITURE] Width - white concrete", 19449},
- {"[INTERIOR FURNITURE] Width - grey concrete", 19450},
- {"[INTERIOR FURNITURE] Width - white wooden", 19451},
- {"[INTERIOR FURNITURE] Width - red and brown wooden", 19452},
- {"[INTERIOR FURNITURE] Width - wooden", 19453},
- {"[INTERIOR FURNITURE] Width - white grain", 19454},
- {"[INTERIOR FURNITURE] Width - brown concrete", 19455},
- {"[INTERIOR FURNITURE] Width - white bricks", 19456},
- {"[INTERIOR FURNITURE] Width - white concrete", 19457},
- {"[INTERIOR FURNITURE] Width - wooden", 19458},
- {"[INTERIOR FURNITURE] Width - grey-brown concrete", 19459},
- {"[INTERIOR FURNITURE] Width - pinky-brown concrete", 19460},
- {"[INTERIOR FURNITURE] Width - white-brown concrete", 19461},
- {"[INTERIOR FURNITURE] Width - light wooden", 19462},
- {"[INTERIOR FURNITURE] Width - white concrete", 19463},
- {"[0.3e] Vehicle Barrier", 19467},
- {"[0.3e] Bucket", 19468},
- {"[0.3e] Scarf", 19469},
- {"[0.3e] Small for sale sign", 19470},
- {"[0.3e] Medium for sale sign", 19471},
- {"[0.3e] Gas Mask", 19472},
- {"[0.3e] Weed bush", 19473},
- {"[0.3e] Poker table", 19474},
- {"[0.3e] Grey SWAT helmet", 19514},
- {"[0.3e] Grey SWAT armour", 19515}
- };
- public OnPlayerConnect(playerid)
- {
- SetPVarInt(playerid, "SelectedObject",-1);
- SetPVarString(playerid, "SettingTxt", "Click_to_set");
- SetPVarString(playerid, "SettingTxd", "Click_to_set");
- SetPVarInt(playerid, "SettingIdx", 0);
- SetPVarInt(playerid, "SettingModel", 11111);
- ObjTextdraw[playerid] = PlayerText:INVALID_TEXT_DRAW;
- for(new i = 0; i < sizeof(objinfo[]); i ++)
- objinfo[playerid][i] = PlayerText:INVALID_TEXT_DRAW;
- return 1;
- }
- public OnFilterScriptInit()
- {
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- objects[i] = -1;
- for(new i = 0; i < PLAYERS; i ++)
- if(IsPlayerConnected(i))
- OnPlayerConnect(i);
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1)
- {
- if(Attached[i] == 0 || Attached[i] == 1)
- DestroyDynamicObject(objects[i]);
- else if(Attached[i] == 2)
- {
- for(new a = 0; a < PLAYERS; a ++)
- {
- if(!IsPlayerConnected(a)) continue;
- RemovePlayerAttachedObject(a,objects[i]-99999);
- }
- }
- objects[i] = -1;
- Attached[i] = -1;
- }
- }
- for(new i = 0; i < PLAYERS; i ++)
- {
- if(!IsPlayerConnected(i))
- continue;
- cmd_oinfo(i, "-1");
- OnObjectEditMode(i, false);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1697 && response)
- {
- new setting = GetPVarInt(playerid, "TextSlot");
- new Float:Float[6], slot = GetPVarInt(playerid, "SelectedObject");
- GetDynamicObjectPos(objects[slot],Float[0],Float[1],Float[2]);
- GetDynamicObjectRot(objects[slot],Float[3],Float[4],Float[5]);
- new math[1];
- if(inputtext[0] == '*' || inputtext[0] == '-' || inputtext[0] == '/' || inputtext[0] == '+')
- {
- math[0] = inputtext[0];
- strdel(inputtext,0,1);
- }
- if(setting == 1)
- {
- if(math[0] == '*')
- Float[0] *= floatstr(inputtext);
- else if(math[0] == '/')
- Float[0] /= floatstr(inputtext);
- else if(math[0] == '+')
- Float[0] += floatstr(inputtext);
- else if(math[0] == '-')
- Float[0] -= floatstr(inputtext);
- else
- Float[0] = floatstr(inputtext);
- SetDynamicObjectPos(objects[slot],Float[0],Float[1],Float[2]);
- }
- else if(setting == 2)
- {
- if(math[0] == '*')
- Float[1] *= floatstr(inputtext);
- else if(math[0] == '/')
- Float[1] /= floatstr(inputtext);
- else if(math[0] == '+')
- Float[1] += floatstr(inputtext);
- else if(math[0] == '-')
- Float[1] -= floatstr(inputtext);
- else
- Float[1] = floatstr(inputtext);
- SetDynamicObjectPos(objects[slot],Float[0],Float[1],Float[2]);
- }
- else if(setting == 3)
- {
- if(math[0] == '*')
- Float[2] *= floatstr(inputtext);
- else if(math[0] == '/')
- Float[2] /= floatstr(inputtext);
- else if(math[0] == '+')
- Float[2] += floatstr(inputtext);
- else if(math[0] == '-')
- Float[2] -= floatstr(inputtext);
- else
- Float[2] = floatstr(inputtext);
- SetDynamicObjectPos(objects[slot],Float[0],Float[1],Float[2]);
- }
- if(setting == 4)
- {
- if(math[0] == '*')
- Float[3] *= floatstr(inputtext);
- else if(math[0] == '/')
- Float[3] /= floatstr(inputtext);
- else if(math[0] == '+')
- Float[3] += floatstr(inputtext);
- else if(math[0] == '-')
- Float[3] -= floatstr(inputtext);
- else
- Float[3] = floatstr(inputtext);
- SetDynamicObjectRot(objects[slot],Float[3],Float[4],Float[5]);
- }
- else if(setting == 5)
- {
- if(math[0] == '*')
- Float[4] *= floatstr(inputtext);
- else if(math[0] == '/')
- Float[4] /= floatstr(inputtext);
- else if(math[0] == '+')
- Float[4] += floatstr(inputtext);
- else if(math[0] == '-')
- Float[4] -= floatstr(inputtext);
- else
- Float[4] = floatstr(inputtext);
- SetDynamicObjectRot(objects[slot],Float[3],Float[4],Float[5]);
- }
- else if(setting == 6)
- {
- if(math[0] == '*')
- Float[5] *= floatstr(inputtext);
- else if(math[0] == '/')
- Float[5] /= floatstr(inputtext);
- else if(math[0] == '+')
- Float[5] += floatstr(inputtext);
- else if(math[0] == '-')
- Float[5] -= floatstr(inputtext);
- else
- Float[5] = floatstr(inputtext);
- SetDynamicObjectRot(objects[slot],Float[3],Float[4],Float[5]);
- }
- UpdateObjectInfoTextdraws(playerid, objects[slot], slot);
- }
- if(dialogid == 1698 && response)
- {
- //if(!IsNumeric(inputtext))
- //return Error(playerid, "Only numeric models.");
- new slot = GetPVarInt(playerid, "SelectedObject");
- format(msg, sizeof(msg),"%d",strval(inputtext));
- cmd_oswap(playerid, msg);
- UpdateObjectInfoTextdraws(playerid, objects[slot], slot);
- }
- if(dialogid == 1699 && response)
- {
- new slot = GetPVarInt(playerid, "SelectedObject");
- new model,txd[24],txtna[24],hex;
- if (sscanf(inputtext, "issh", model,txd,txtna,hex))
- if(strcmp(inputtext,"None",true))
- return ShowPlayerDialog(playerid, 1799, DIALOG_STYLE_INPUT,"NEW VALUES - {FF0000}WRONG SYNTAX","{FFFFFF}Type on the box below the new value for {FFFF00}MAT\n{BBBBBB}Syntax: model txd txt color\nType in \"None\" to clear field.","Ok","Cancel");
- new setting = GetPVarInt(playerid, "TextSlot");
- if(setting == 7)
- { // mat 0
- if(strcmp(inputtext,"None",true) == 0)
- {
- SetDynamicObjectMaterial(objects[slot],0,objectmodel[slot],"None","None",0);
- objectmatinfo[slot][0] = "None";
- }
- else
- {
- SetDynamicObjectMaterial(objects[slot],0,model,txd,txtna,hex);
- format(objectmatinfo[slot][0], 64,"%d %s %s %x",model,txd,txtna,hex);
- }
- }
- else if(setting == 8)
- { // mat 1
- if(strcmp(inputtext,"None",true) == 0)
- {
- SetDynamicObjectMaterial(objects[slot],1,objectmodel[slot],"None","None",0);
- objectmatinfo[slot][1] = "None";
- }
- else
- {
- SetDynamicObjectMaterial(objects[slot],1,model,txd,txtna,hex);
- format(objectmatinfo[slot][1], 64,"%d %s %s %x",model,txd,txtna,hex);
- }
- }
- else if(setting == 9)
- { // mat 2
- if(strcmp(inputtext,"None",true) == 0)
- {
- SetDynamicObjectMaterial(objects[slot],2,objectmodel[slot],"None","None",0);
- objectmatinfo[slot][2] = "None";
- }
- else
- {
- SetDynamicObjectMaterial(objects[slot],2,model,txd,txtna,hex);
- format(objectmatinfo[slot][2], 64,"%d %s %s %x",model,txd,txtna,hex);
- }
- }
- UpdateObjectInfoTextdraws(playerid, objects[slot], slot);
- }
- if(dialogid == 1701 && response)
- {
- new slot = GetPVarInt(playerid, "SelectedObject");
- new setting = GetPVarInt(playerid, "TextSlot");
- if(setting == 10)
- {
- //if(!IsNumeric(inputtext))
- //return Error(playerid, "Must be numeric.");
- SetPVarInt(playerid, "SettingIdx",strval(inputtext));
- }
- else if(setting == 11)
- {
- //if(!IsNumeric(inputtext))
- //return Error(playerid, "Must be numeric.");
- SetPVarInt(playerid, "SettingModel",strval(inputtext));
- }
- else if(setting == 12)
- SetPVarString(playerid, "SettingTxd", inputtext);
- else if(setting == 13)
- SetPVarString(playerid, "SettingTxt", inputtext);
- UpdateObjectInfoTextdraws(playerid, objects[slot], slot);
- }
- if(dialogid == 1702 && response)
- {
- //if(!IsNumeric(inputtext))
- //return ShowPlayerDialog(playerid, 1802, DIALOG_STYLE_INPUT,"NEW OBJECT - {FF0000}INVALID MODEL","Type on the box below the {FFFF00}model {FFFFFF}for the {FFFF00}new object\n{BBBBBB}Syntax: <model>","Ok","Cancel");
- format(msg, 12, "%d", strval(inputtext));
- cmd_ocreate(playerid, msg);
- }
- return 0;
- }
- public OnPlayerCommandReceived(playerid, cmdtext[])
- {
- if(!IsPlayerAdmin(playerid)) return 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- OnObjectEditMode(playerid,false);
- return 1;
- }
- stock Float:GetAngleToPoint(Float:fDestX, Float:fDestY, Float:fPointX, Float:fPointY)
- return atan2((fDestY - fPointY), (fDestX - fPointX)) + 180.0;
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- if(PRESSED(KEY_YES))
- {
- if(GetPVarInt(playerid, "SelectedObject") != -1)
- {
- cmd_ocopy(playerid, "");
- }
- }
- if(PRESSED(KEY_NO))
- {
- if(GetPVarInt(playerid, "SelectedObject") != -1)
- {
- cmd_odestroy(playerid, "");
- }
- }
- if(PRESSED(KEY_CTRL_BACK))
- {
- new mapname[64];
- if(GetPVarString(playerid,"LastSavedMap", mapname, 64))
- SaveMap(playerid, mapname);
- }
- if(PRESSED(KEY_ACTION) && GetPVarInt(playerid,"oinfo"))
- {
- if(timestamp() - GetPVarInt(playerid,"LastAction") == 0)
- SelectTextDraw(playerid, 0xBBBBBBBB);
- SetPVarInt(playerid,"LastAction",timestamp());
- }
- return 0;
- }
- stock Float:floatrand(Float:min, Float:max) //By Alex "Y_Less" Cole
- {
- new imin = floatround(min);
- return floatdiv(float(random((floatround(max)-imin)*100)+(imin*100)),100.0);
- }
- // -------------------- Objects ------------------------
- CMD:loadmap(playerid, params[])
- {
- new mapname[64],slotname[5];
- if (sscanf(params, "s[64]", mapname))
- {
- Usage(playerid, "/loadmap <mapname>");
- Warning(playerid, "All the current created objects will be deleted when you load a map!");
- return 1;
- }
- new map[64];
- format(map, sizeof(map),"maps/%s.ini",mapname);
- if(!dini_Exists(map))
- return Error(playerid, "Map doesn't exists!");
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(IsValidDynamicObject(objects[i]))
- {
- DestroyDynamicObject(objects[i]);
- }
- }
- new amount = dini_Int(map,"Objects");
- new model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz;
- SetPVarInt(playerid,"Objects",amount);
- for(new i = 0; i < amount; i ++)
- {
- format(slotname, sizeof(slotname),"%d",i);
- sscanf(dini_Get(map,slotname),"p<,>iffffffs[256]",model,x,y,z,rx,ry,rz,bigmatinfo);
- objects[i] = CreateDynamicObject(model,x,y,z,rx,ry,rz);
- objectmodel[i] = model;
- SetMaterials(i);
- }
- UpdateNearPlayers(playerid);
- Info(playerid, "Map has been loaded");
- return 1;
- }
- stock SetMaterials(slot)
- {
- sscanf(bigmatinfo,"p<|>s[64]s[64]s[64]",objectmatinfo[slot][0]
- ,objectmatinfo[slot][1],objectmatinfo[slot][2]);
- if(strcmp(objectmatinfo[slot][0],"None",true))
- ApplyDynamicObjectMaterial(objects[slot],slot,0);
- if(strcmp(objectmatinfo[slot][1],"None",true))
- ApplyDynamicObjectMaterial(objects[slot],slot,1);
- if(strcmp(objectmatinfo[slot][2],"None",true))
- ApplyDynamicObjectMaterial(objects[slot],slot,2);
- return 1;
- }
- stock ApplyDynamicObjectMaterial(object,slot,index)
- {
- new integer,strings[2][16],hex;
- if(index == 0)
- sscanf(objectmatinfo[slot][0],"is[16]s[16]h",integer,strings[0],strings[1],hex);
- else if(index == 1)
- sscanf(objectmatinfo[slot][1],"is[16]s[16]h",integer,strings[0],strings[1],hex);
- else if(index == 2)
- sscanf(objectmatinfo[slot][2],"is[16]s[16]h",integer,strings[0],strings[1],hex);
- SetDynamicObjectMaterial(object,index,integer,strings[0],strings[1],hex);
- return 1;
- }
- CMD:deletemap(playerid, params[])
- {
- new mapname[24];
- if (sscanf(params, "s[24]", mapname))
- {
- Usage(playerid, "/deletemap <mapname>");
- Warning(playerid, "You cannot un-do this!");
- return 1;
- }
- new map[64];
- format(map, sizeof(map),"maps/%s.ini",mapname);
- if(!dini_Exists(map))
- return Error(playerid, "Map doesn't exists!");
- fremove(map);
- Info(playerid,"Map has been destroyed!");
- return 1;
- }
- CMD:exportmap(playerid, params[])
- {
- new mapname[64],function[24];
- if (sscanf(params, "s[24]s[64]",function, mapname))
- return Usage(playerid, "/exportmap <function> <mapname>");
- ExportMap(playerid, mapname, function);
- return 1;
- }
- CMD:savemap(playerid, params[])
- {
- new mapname[64];
- if (sscanf(params, "s[64]", mapname))
- return Usage(playerid, "/savemap <mapname>");
- if(strfind("temp",mapname,true) != -1)
- return Error(playerid, "Your map may not contain the 'Temp' word in it's name.");
- SaveMap(playerid, mapname);
- return 1;
- }
- CMD:resetrx(playerid, params[])
- {
- if (strlen(params)) return Usage(playerid,"/resetrx");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- SetDynamicObjectRot(objects[editting],0.0,RY,RZ);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- UpdateObjectTextdraw(playerid, "(resetted RX)");
- return 1;
- }
- CMD:resetrz(playerid, params[])
- {
- if (strlen(params)) return Usage(playerid,"/resetrz");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- SetDynamicObjectRot(objects[editting],RX,RY,0.0);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- UpdateObjectTextdraw(playerid, "(resetted RZ)");
- return 1;
- }
- CMD:resetry(playerid, params[])
- {
- if (strlen(params)) return Usage(playerid,"/resetry");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- SetDynamicObjectRot(objects[editting],RX,0.0,RZ);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- UpdateObjectTextdraw(playerid, "(resetted RY)");
- return 1;
- }
- CMD:rx(playerid, params[])
- {
- new Float:amount;
- if (sscanf(params, "F(5.0)", amount))
- return Usage(playerid, "/rx <coordinates>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- SetDynamicObjectRot(objects[editting],RX+amount,RY,RZ);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(RX %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:rxall(playerid,params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/rxall <coordinates>");
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- GetDynamicObjectRot(objects[i],X,Y,Z);
- SetDynamicObjectRot(objects[i],X+amount,Y,Z);
- }
- format(msg, sizeof(msg),"(RX %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:rz(playerid, params[])
- {
- new Float:amount;
- if (sscanf(params, "F(5.0)", amount))
- return Usage(playerid, "/rz <coordinates>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- SetDynamicObjectRot(objects[editting],RX,RY,RZ+amount);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(RZ %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:rzall(playerid,params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/rzall <coordinates>");
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- GetDynamicObjectRot(objects[i],X,Y,Z);
- SetDynamicObjectRot(objects[i],X,Y,Z+amount);
- }
- format(msg, sizeof(msg),"(RZ %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:ry(playerid, params[])
- {
- new Float:amount;
- if (sscanf(params, "F(5.0)", amount))
- return Usage(playerid, "/ry <coordinates>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- SetDynamicObjectRot(objects[editting],RX,RY+amount,RZ);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(RY %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:ryall(playerid,params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/ryall <coordinates>");
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- GetDynamicObjectRot(objects[i],X,Y,Z);
- SetDynamicObjectRot(objects[i],X,Y+amount,Z);
- }
- format(msg, sizeof(msg),"(RY %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:oy(playerid, params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/oy <coordinates>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- new Float:X,Float:Y,Float:Z;
- GetDynamicObjectPos(objects[editting],X,Y,Z);
- SetDynamicObjectPos(objects[editting],X,Y+amount,Z);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(Y %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:oyall(playerid,params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/oyall <coordinates>");
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- GetDynamicObjectPos(objects[i],X,Y,Z);
- SetDynamicObjectPos(objects[i],X,Y+amount,Z);
- }
- format(msg, sizeof(msg),"(Y %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:oz(playerid, params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/oz <coordinates>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- new Float:X,Float:Y,Float:Z;
- GetDynamicObjectPos(objects[editting],X,Y,Z);
- SetDynamicObjectPos(objects[editting],X,Y,Z+amount);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(Z %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:ozall(playerid,params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/ozall <coordinates>");
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- GetDynamicObjectPos(objects[i],X,Y,Z);
- SetDynamicObjectPos(objects[i],X,Y,Z+amount);
- }
- format(msg, sizeof(msg),"(Z %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:ox(playerid, params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/ox <coordinates>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- new Float:X,Float:Y,Float:Z;
- GetDynamicObjectPos(objects[editting],X,Y,Z);
- SetDynamicObjectPos(objects[editting],X+amount,Y,Z);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(X %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:oxall(playerid,params[])
- {
- new Float:amount;
- if (sscanf(params, "F(1.0)", amount))
- return Usage(playerid, "/oxall <coordinates>");
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- GetDynamicObjectPos(objects[i],X,Y,Z);
- SetDynamicObjectPos(objects[i],X+amount,Y,Z);
- }
- format(msg, sizeof(msg),"(X %s)",ProcessFloat(amount));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- stock ProcessFloat(Float:floatp)
- {
- new procss[12];
- if(floatp >= 0.0)
- format(procss, sizeof(procss),"+%.1f",floatp);
- else
- format(procss, sizeof(procss),"%.1f",floatp);
- return procss;
- }
- CMD:oattachveh(playerid,params[])
- {
- if(!IsPlayerInAnyVehicle(playerid))
- return Error(playerid, "you must be in a vehicle!");
- new vehicle = GetPlayerVehicleID(playerid);
- new Float:ox,Float:oy,Float:oz,Float:rx,Float:ry,Float:rz;
- if (sscanf(params, "F(0.0)F(0.0)F(0.0)F(0.0)F(0.0)F(0.0)", ox,oy,oz,rx,ry,rz))
- return Usage(playerid, "/attachveh <OffsetX> <OffsetY> <OffsetZ>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- AttachDynamicObjectToVehicle(objects[editting],vehicle,ox,oy,oz,rx,ry,rz);
- format(msg, sizeof(msg),"Object id %d has been attached on slot %d. Use /odestroy if you wish to remove it.",editting,editting);
- Info(playerid, msg);
- return 1;
- }
- CMD:otextmatset(playerid,params[])
- {
- new index, size, font[24], fontsize, bold, fontcolor, backcolor, alignment;
- if (sscanf(params, "iI(60)S(Arial)[12]I(24)I(1)H(0xFFFFFFFF)H(0x00000000)I(0)",index,size,font,fontsize,bold,fontcolor,backcolor,alignment))
- return Usage(playerid, "/otextmatset <index> <size(60)> <font(Arial)> <font size(24)> <bold(1)> <fontcolor (ARGB)> <backcolour (ARGB)>");
- format(msg, sizeof(msg),"%d %d %s %d %d %x %x %d",index,size,font,fontsize,bold,fontcolor,backcolor,alignment);
- SetPVarString(playerid, "otextmat", msg);
- return 1;
- }
- CMD:otextmat(playerid, params[])
- {
- new txt[144];
- if (sscanf(params, "s[144]", txt))
- return Usage(playerid, "/otextmat <txt>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- new variables[7],font[12];
- GetPVarString(playerid, "otextmat", msg, sizeof(msg));
- sscanf(msg, "iis[12]iihhi",variables[0],variables[1],font,variables[2],variables[3],variables[4],variables[5],variables[6]);
- SetDynamicObjectMaterialText(objects[editting],variables[0],txt,variables[1],font,variables[2],variables[3],variables[4],variables[5],variables[6]);
- return 1;
- }
- CMD:oclearmat(playerid, params[])
- {
- new index;
- if (sscanf(params, "i", index))
- return Usage(playerid, "/oclearmat <index>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetDynamicObjectMaterial(objects[editting],index,objectmodel[editting],"None","None",0);
- objectmatinfo[editting][index] = "None";
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- return 1;
- }
- CMD:omat(playerid, params[])
- {
- new model,index,txd[24],txtna[24],hex;
- if (sscanf(params, "iiS(none)[24]S(none)[24]H(0)", index,model,txd,txtna,hex))
- return Usage(playerid, "/omat <index> <model> [txd name] [texture name] [color (AGRB)]");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetDynamicObjectMaterial(objects[editting],index,model,txd,txtna,hex);
- format(objectmatinfo[editting][index], 64,"%d %s %s %x",model,txd,txtna,hex);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- return 1;
- }
- CMD:oswap(playerid, params[])
- {
- new model;
- if (sscanf(params, "i", model))
- return Usage(playerid, "/oswap <model>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- new Float:X,Float:Y,Float:Z,Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectPos(objects[editting],X,Y,Z);
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- format(msg, sizeof(msg),"Object on slot %d Swapped from model %d to model %d.",editting,objectmodel[editting],model);
- Info(playerid, msg);
- DestroyDynamicObject(objects[editting]);
- objects[editting] = CreateDynamicObject(model,X,Y,Z,RX,RY,RZ);
- objectmodel[editting] = model;
- ApplyDynamicObjectMaterial(objects[editting],editting,0);
- ApplyDynamicObjectMaterial(objects[editting],editting,1);
- ApplyDynamicObjectMaterial(objects[editting],editting,2);
- UpdateNearPlayers(playerid);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- return 1;
- }
- CMD:oinfo(playerid, params[])
- {
- new slot;
- if (sscanf(params, "i", slot))
- slot = 999;
- if(slot == -1)
- {
- SetPVarInt(playerid, "SelectedObject", -1);
- if(GetPVarInt(playerid,"Created"))
- {
- DeletePVar(playerid,"oinfo");
- CancelSelectTextDraw(playerid);
- DeletePVar(playerid,"Created");
- DestroyObjectInfoTextdraws(playerid);
- }
- return 1;
- }
- else
- SetPVarInt(playerid, "SelectedObject", slot);
- if(slot != 999 && !IsValidDynamicObject(objects[slot]))
- return Error(playerid, "There's nothing on this slot!");
- if(!GetPVarInt(playerid,"Created"))
- CreateObjectInfoTextdraws(playerid);
- if(!GetPVarInt(playerid,"oinfo"))
- Tip(playerid, "If your textdraw selection pointer dissapears, press the key ~k~~PED_ANSWER_PHONE~ twice within a second and it will re-appear.");
- SetPVarInt(playerid,"oinfo",1);
- SelectTextDraw(playerid, 0xBBBBBBBB);
- ShowObjectInfoTextdraws(playerid);
- if(slot == 999)
- {
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- slot = i;
- break;
- }
- }
- if(slot == 999)
- {
- UpdateObjectInfoTextdraws(playerid, objects[0], slot);
- }
- else
- {
- SetPVarInt(playerid, "SelectedObject", slot);
- UpdateObjectInfoTextdraws(playerid, objects[slot], slot);
- }
- }
- else
- UpdateObjectInfoTextdraws(playerid, objects[slot], slot);
- if(GetPVarInt(playerid,"SettingIdx") == 0)
- PlayerTextDrawHide(playerid, objinfo[playerid][31]);
- return 1;
- }
- CMD:oget(playerid, params[])
- {
- new slot;
- if (sscanf(params, "i", slot))
- return Usage(playerid, "/oget <slot>");
- if(!IsValidDynamicObject(objects[slot]))
- return Error(playerid, "There's nothing on this slot!");
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid,X,Y,Z);
- GetXYInFrontOfPlayer(playerid, X,Y,5.0);
- SetDynamicObjectPos(objects[slot],X,Y,Z);
- UpdateObjectInfoTextdraws(playerid,objects[slot],slot);
- Info(playerid,"Successfully teleported.");
- return 1;
- }
- CMD:ogoto(playerid, params[])
- {
- new slot;
- if (sscanf(params, "i", slot))
- return Usage(playerid, "/ogoto <slot>");
- if(!IsValidDynamicObject(objects[slot]))
- return Error(playerid, "There's nothing on this slot!");
- new Float:X,Float:Y,Float:Z;
- GetDynamicObjectPos(objects[slot],X,Y,Z);
- SetPlayerPos(playerid, X,Y,Z+2);
- return 1;
- }
- CMD:ostop(playerid,params[])
- {
- if (strlen(params)) return Usage(playerid,"/ostop");
- new slot = GetPVarInt(playerid, "SelectedObject");
- if(slot == -1) return Error(playerid, "You don't have any object selected. Use /osel first.");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- StopDynamicObject(objects[slot]);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[slot]);
- UpdateObjectTextdraw(playerid, "(stopped)");
- format(msg, sizeof(msg),"Object on slot %d has been stopped if it was moving.",slot);
- Info(playerid,msg);
- return 1;
- }
- CMD:ostopall(playerid,params[])
- {
- if (strlen(params)) return Usage(playerid,"/ostopall");
- new editting = GetPVarInt(playerid, "SelectedObject");
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- if(i == editting)
- {
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- }
- StopDynamicObject(objects[i]);
- if(i == editting)
- {
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[i]);
- UpdateObjectTextdraw(playerid, "(stopped)");
- }
- }
- }
- return 1;
- }
- CMD:omovetop(playerid, params[])
- {
- new Float:speed, targetid;
- if (sscanf(params, "uf", targetid,speed))
- return Usage(playerid, "/omovetop <player> <speed>");
- if(!IsPlayerConnected(targetid)) return Error(playerid, "That player is not connected.");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You don't have any object selected. Use /osel first.");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:Float[9];
- GetPlayerPos(targetid,Float[0],Float[1],Float[2]);
- GetDynamicObjectPos(objects[editting],Float[3],Float[4],Float[5]);
- GetDynamicObjectRot(objects[editting],Float[6],Float[7],Float[8]);
- SetDynamicObjectRot(objects[editting],Float[6],Float[7],GetAngleToPoint(Float[3],Float[4],Float[0],Float[1]));
- MoveDynamicObject(objects[editting],Float[0],Float[1],Float[2],speed);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectTextdraw(playerid, "(moved to player)");
- return 1;
- }
- CMD:omovealltop(playerid, params[])
- {
- new Float:speed, targetid;
- if (sscanf(params, "uf", targetid,speed))
- return Usage(playerid, "/omovealltop <player> <speed>");
- if(!IsPlayerConnected(targetid)) return Error(playerid, "Error: that player is not connected.");
- new Float:Float[9];
- GetPlayerPos(targetid,Float[0],Float[1],Float[2]);
- new editting = GetPVarInt(playerid, "SelectedObject");
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- GetDynamicObjectPos(objects[i],Float[3],Float[4],Float[5]);
- GetDynamicObjectRot(objects[i],Float[6],Float[7],Float[8]);
- if(i == editting)
- {
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- }
- SetDynamicObjectRot(objects[i],Float[6],Float[7],GetAngleToPoint(Float[3],Float[4],Float[0],Float[1]));
- MoveDynamicObject(objects[i],Float[0],Float[1],Float[2],speed);
- if(i == editting)
- {
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[i]);
- UpdateObjectTextdraw(playerid, "(moved)");
- }
- }
- }
- return 1;
- }
- CMD:omoveto(playerid, params[])
- {
- new Float:X,Float:Y,Float:Z,Float:speed;
- if (sscanf(params, "ffff",X,Y,Z,speed))
- return Usage(playerid, "/omoveto <x> <y> <z> <speed>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- MoveDynamicObject(objects[editting],X,Y,Z,speed);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- UpdateObjectTextdraw(playerid, "(moved)");
- return 1;
- }
- CMD:omoveallto(playerid,params[])
- {
- new Float:X,Float:Y,Float:Z,Float:speed;
- if (sscanf(params, "ffff",X,Y,Z,speed))
- return Usage(playerid, "/omoveallto <x> <y> <z> <speed>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- if(i == editting)
- {
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- }
- MoveDynamicObject(objects[i],X,Y,Z,speed);
- if(i == editting)
- {
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[i]);
- UpdateObjectTextdraw(playerid, "(moved)");
- }
- }
- }
- return 1;
- }
- CMD:omoveall(playerid,params[])
- {
- new Float:Float_1,Float:Float_2,Float:Float_3,Float:Float_4;
- if (sscanf(params, "ffff",Float_1,Float_2,Float_3,Float_4))
- return Usage(playerid, "/omoveall <x> <y> <z> <speed>");
- new Float:X,Float:Y,Float:Z;
- new editting = GetPVarInt(playerid, "SelectedObject");
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- GetDynamicObjectPos(objects[i],X,Y,Z);
- if(i == editting)
- {
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- }
- MoveDynamicObject(objects[i],X+Float_1,Y+Float_2,Z+Float_3,Float_4);
- if(i == editting)
- {
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[i]);
- UpdateObjectTextdraw(playerid, "(moved)");
- }
- }
- }
- return 1;
- }
- CMD:omove(playerid, params[])
- {
- new Float:coords[4];
- if (sscanf(params, "ffff", coords[0],coords[1],coords[2],coords[3]))
- return Usage(playerid, "/omove <x> <y> <z> <speed>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:X,Float:Y,Float:Z;
- GetDynamicObjectPos(objects[editting],X,Y,Z);
- MoveDynamicObject(objects[editting],X+coords[0],Y+coords[1],Z+coords[2],coords[3]);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(X %s;Y %s;Z %s)",ProcessFloat(coords[0]),ProcessFloat(coords[1]),ProcessFloat(coords[2]));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- CMD:osave(playerid, params[])
- {
- if(!isnull(params)) return Usage(playerid, "/osave");
- new slot = GetPVarInt(playerid, "SelectedObject");
- if(slot == -1)
- return Error(playerid, "You don't have anything selected.");
- format(msg, sizeof(msg),"You're no longer editting the object on slot %d.",slot);
- Info(playerid, msg);
- /*if(slot != -1 && !GetPVarInt(playerid,"oinfo"))
- {
- SelectObject(playerid);
- OnObjectEditMode(playerid, true);
- }*/
- CancelEdit(playerid);
- DestroyObjectTextdraw(playerid);
- SetPVarInt(playerid, "SelectedObject",-1);
- UpdateObjectInfoTextdraws(playerid,objects[slot],slot);
- return 1;
- }
- CMD:oedit(playerid, params[])
- {
- new slot;
- if (sscanf(params, "i", slot))
- {
- if(GetPVarInt(playerid, "SelectedObject") != -1)
- slot = GetPVarInt(playerid, "SelectedObject");
- else
- {
- Info(playerid, "You're now on object selection mode. Use {FF6600}~k~~PED_SPRINT~ {FFFFFF}to look around.");
- OnObjectEditMode(playerid,true);
- UpdateObjectTextdraw(playerid);
- return SelectObject(playerid);
- }
- }
- if(!IsValidDynamicObject(objects[slot]))
- return Error(playerid, "There's no (editable) object on the slot you chosed!");
- if(GetPVarInt(playerid, "oinfo"))
- CancelSelectTextDraw(playerid);
- SetPVarInt(playerid, "SelectedObject",slot);
- format(msg, sizeof(msg),"You're now editting object slot %d, use /ox, /oy, /oz, /rx, /ry or /rz to move the object.",slot);
- Info(playerid, msg);
- EditDynamicObject(playerid, objects[slot]);
- OnObjectEditMode(playerid,true);
- CreateObjectTextdraw(playerid);
- UpdateObjectTextdraw(playerid);
- ShowObjectTextdraw(playerid);
- Info(playerid, "Use /osave or press the save button to stop editting this object. Use {FF6600}~k~~PED_SPRINT~ {FFFFFF}to look around.");
- return 1;
- }
- CMD:osel(playerid, params[])
- {
- new slot;
- if (sscanf(params, "i", slot))
- return Error(playerid,"Correct usage: /osel <slot>");
- if(!IsValidDynamicObject(objects[slot])) return Error(playerid, "There's no object on the slot you chosed!");
- SetPVarInt(playerid, "SelectedObject",slot);
- format(msg, sizeof(msg),"Object slot %d has been selected. You can use /oedit and /oinfo to move the object.",slot);
- Info(playerid, msg);
- Info(playerid, "Use /osave to unselect this object.");
- UpdateObjectInfoTextdraws(playerid,objects[slot],slot);
- CreateObjectTextdraw(playerid);
- UpdateObjectTextdraw(playerid);
- ShowObjectTextdraw(playerid);
- return 1;
- }
- CMD:ocopy(playerid,params[])
- {
- if(!isnull(params)) return Usage(playerid, "/ocopy");
- new slot = -1;
- new selected = GetPVarInt(playerid, "SelectedObject");
- if(selected == -1) return Error(playerid, "You don't have any object selected. Use /osel first.");
- if(!IsValidDynamicObject(objects[selected]))
- return Error(playerid,"There's nothing on the slot you selected!");
- SetPVarInt(playerid,"Modifying",1);
- cmd_osave(playerid, "");
- new Float:X,Float:Y,Float:Z,Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectPos(objects[selected],X,Y,Z);
- GetDynamicObjectRot(objects[selected],RX,RY,RZ);
- for(new h = 0; h < MAX_PLAYER_OBJECTS; h++)
- {
- if(objects[h] == -1 && !IsValidDynamicObject(objects[h]))
- {
- slot = h;
- break;
- }
- }
- if(slot == -1) return Error(playerid, "You have no more slots avaialble, maximun is 500!");
- objects[slot] = CreateDynamicObject(objectmodel[selected],X,Y,Z,RX,RY,RZ);
- objectmodel[slot] = objectmodel[selected];
- objectmatinfo[slot][0] = objectmatinfo[selected][0];
- objectmatinfo[slot][1] = objectmatinfo[selected][1];
- objectmatinfo[slot][2] = objectmatinfo[selected][2];
- ApplyDynamicObjectMaterial(objects[slot],slot,0);
- ApplyDynamicObjectMaterial(objects[slot],slot,1);
- ApplyDynamicObjectMaterial(objects[slot],slot,2);
- UpdateNearPlayers(playerid);
- format(msg, sizeof(msg),"Object id %d (%d) copied on slot %d. Type /ohelp for object help.",selected,objectmodel[selected],slot);
- Info(playerid,msg);
- format(msg, sizeof(msg),"%d",slot);
- if(!GetPVarInt(playerid,"oinfo"))
- cmd_osel(playerid,msg);
- else
- cmd_oinfo(playerid,msg);
- cmd_oedit(playerid, "");
- return 1;
- }
- CMD:ofind(playerid, params[])
- {
- new model;
- if(sscanf(params,"i",model))
- return Usage(playerid,"/ofind <model id>");
- new plobjects = GetPVarInt(playerid, "Objects"), objectsfound = 0;
- if(plobjects == 0) return Error(playerid, "You don't have any object created at this moment.");
- OtherMsg(playerid, "Objects you created that have that model:");
- for(new i = 0; i < plobjects; i ++)
- {
- if(objectmodel[i] == model)
- {
- format(msg, sizeof(msg),"Slot %d - Object ID: %d",i,objectmodel[i]);
- OtherMsg(playerid, msg);
- objectsfound ++;
- }
- }
- if(objectsfound == 0)
- {
- OtherMsg(playerid, "No objects found.");
- }
- else
- {
- format(msg, sizeof(msg),"%d objects were found.",objectsfound);
- OtherMsg(playerid,msg);
- }
- return 1;
- }
- CMD:myobjects(playerid, params[])
- {
- if(!isnull(params)) return Usage(playerid, "/myobjects");
- new plobjects = GetPVarInt(playerid, "Objects");
- if(plobjects != 0)
- {
- format(msg, sizeof(msg),"You have a total of %d objects created right now.",plobjects);
- Info(playerid,msg);
- }
- else
- {
- Info(playerid, "You don't have any object created right now.");
- }
- return 1;
- }
- CMD:ocreate(playerid,params[])
- {
- new idx,slot = -5;
- if (sscanf(params, "i", idx))
- return Usage(playerid, "/ocreate <id>");
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- GetXYInFrontOfPlayer(playerid, X, Y, 2.0);
- for(new h = 0; h < MAX_PLAYER_OBJECTS; h++)
- {
- if(objects[h] == -1 && !IsValidDynamicObject(objects[h]))
- {
- slot = h;
- break;
- }
- }
- if(slot == -5) return Error(playerid, "You have no more slots avaialble, maximun is 500!");
- objects[slot] = CreateDynamicObject(idx,X,Y,Z,0,0,0);
- objectmodel[slot] = idx;
- objectmatinfo[slot][0] = "None";
- objectmatinfo[slot][1] = "None";
- objectmatinfo[slot][2] = "None";
- SetPVarInt(playerid,"Objects",GetPVarInt(playerid,"Objects") + 1);
- UpdateNearPlayers(playerid);
- format(msg, sizeof(msg),"Object id %d created on slot %d. Type /ohelp for object help.",idx,slot);
- Info(playerid,msg);
- format(msg, sizeof(msg),"%d",slot);
- if(!GetPVarInt(playerid,"oinfo"))
- cmd_oedit(playerid,msg);
- else
- cmd_oinfo(playerid,msg);
- if(GetPVarInt(playerid,"NoObject"))
- DeletePVar(playerid, "NoObject");
- return 1;
- }
- CMD:obj(playerid, params[])
- {
- new model[24], numericmodel,totalobjects = 0;
- if(sscanf(params, "s[24]", model))
- {
- Usage(playerid, "/obj <name or ID>");
- format(msg, sizeof(msg),"There are %d objects in our database right now.",sizeof(ObjectNames));
- Info(playerid, msg);
- return 1;
- }
- format(msg, sizeof(msg),"Results for '%s' are:",model);
- OtherMsg(playerid,msg);
- for(new i = 0; i < sizeof(ObjectNames); i ++)
- {
- if (strfind(ObjectNames[i][ObjectName], model, true) != -1)
- {
- numericmodel = ObjectNames[i][ObjectID];
- format(msg, sizeof(msg),"Object Name: %s - Object model id: %d",ObjectNames[i][ObjectName],numericmodel);
- OtherMsg(playerid, msg);
- totalobjects ++;
- }
- }
- if(totalobjects == 0)
- {
- OtherMsg(playerid, "None.");
- }
- else
- {
- format(msg, sizeof(msg),"%d objects were found.",totalobjects);
- OtherMsg(playerid,msg);
- }
- return 1;
- }
- CMD:odestroyall(playerid,params[])
- {
- if(!isnull(params)) return Usage(playerid, "/odestroyall");
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- DestroyDynamicObject(objects[i]);
- objects[i] = -1;
- }
- SetPVarInt(playerid,"SelectedObject",-1);
- SetPVarInt(playerid,"Objects",0);
- DestroyObjectTextdraw(playerid);
- if(IsPlayerEdittingObject(playerid))
- CancelEdit(playerid);
- OnObjectEditMode(playerid, false);
- Info(playerid,"Every object that belonged to you was deleted.");
- if(GetPVarInt(playerid,"oinfo"))
- cmd_oinfo(playerid, "-1");
- return 1;
- }
- CMD:odestroy(playerid,params[])
- {
- if(!isnull(params)) return Usage(playerid, "/odestroy");
- new slot = GetPVarInt(playerid, "SelectedObject");
- if(slot == -1) return Error(playerid, "You don't have any object selected. Use /osel first.");
- DestroyDynamicObject(objects[slot]);
- objects[slot] = -1;
- oinfoPREV(playerid);
- if(!GetPVarInt(playerid,"oinfo"))
- SetPVarInt(playerid,"SelectedObject",-1);
- SetPVarInt(playerid,"Objects",GetPVarInt(playerid,"Objects") - 1);
- if(IsPlayerEdittingObject(playerid))
- CancelEdit(playerid);
- OnObjectEditMode(playerid, false);
- DestroyObjectTextdraw(playerid);
- format(msg, sizeof(msg),"Object on slot %d has been deleted.",slot);
- Info(playerid,msg);
- return 1;
- }
- CMD:ohelp(playerid, params[])
- {
- if(!isnull(params)) return Usage(playerid, "/ohelp");
- RenderMessage(playerid,COLOR_CYAN,"Map Commands:");
- RenderMessage(playerid,COLOR_WHITE,"{FFFF00}Managment: {FFFFFF}/odestroy(all) /ocreate /ogoto /myobjects /obj /osel /osave /oedit /oinfo /oswap /ocopy");
- RenderMessage(playerid,COLOR_WHITE,"{FFFF00}Movement: {FFFFFF}/oy(all) /ox(all) /oz(all) /rx(all) /ry(all) /rz(all) /resetrx /resetry /resetrz /omove(all) /omove(all)top /omove(all)to");
- RenderMessage(playerid,COLOR_WHITE,"{FFFF00}Save/load: {FFFFFF}/exportmap /savemap /deletemap /loadmap");
- RenderMessage(playerid,COLOR_WHITE,"{FFFF00}Other: {FFFFFF}/omat /otextmat /otextmatset /oclearmat");
- if(Chance(33))
- Tip(playerid, "Did you know you can press {FF6600}~k~~CONVERSATION_YES~ {FFFFFF}to copy the object you're editing?");
- if(Chance(33))
- Tip(playerid, "You can use {FF6600}~k~~CONVERSATION_NO~ {FFFFFF}to delete the object you're editing.");
- return 1;
- }
- stock Chance(minchance)
- {
- new chance = random(100);
- if(chance <= minchance) return 1;
- else return 0;
- }
- stock ShowObjectInfoTextdraws(playerid)
- {
- for(new i = 0; i < sizeof(objinfo[]); i ++)
- if(objinfo[playerid][i] != PlayerText:INVALID_TEXT_DRAW)
- PlayerTextDrawShow(playerid, objinfo[playerid][i]);
- return 1;
- }
- stock HideObjectInfoTextdraws(playerid)
- {
- for(new i = 0; i < sizeof(objinfo[]); i ++)
- if(objinfo[playerid][i] != PlayerText:INVALID_TEXT_DRAW)
- PlayerTextDrawHide(playerid, objinfo[playerid][i]);
- return 1;
- }
- stock DestroyObjectInfoTextdraws(playerid)
- {
- for(new i = 0; i < sizeof(objinfo[]); i ++)
- if(objinfo[playerid][i] != PlayerText:INVALID_TEXT_DRAW)
- PlayerTextDrawDestroy(playerid, objinfo[playerid][i]);
- return 1;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- if(playertextid == objinfo[playerid][1])
- { // setting X
- SetPVarInt(playerid, "TextSlot",1);
- ShowPlayerDialog(playerid, 1697, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}X\n{BBBBBB}You can use +,-,/ & * operators before the number to apply a mathematical formula","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][2])
- { // setting Y
- SetPVarInt(playerid, "TextSlot",2);
- ShowPlayerDialog(playerid, 1697, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}Y\n{BBBBBB}You can use +,-,/ & * operators before the number to apply a mathematical formula","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][3])
- { // setting Y
- SetPVarInt(playerid, "TextSlot",3);
- ShowPlayerDialog(playerid, 1697, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}Z\n{BBBBBB}You can use +,-,/ & * operators before the number to apply a mathematical formula","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][6])
- { // setting RX
- SetPVarInt(playerid, "TextSlot",4);
- ShowPlayerDialog(playerid, 1697, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}RX\n{BBBBBB}You can use +,-,/ & * operators before the number to apply a mathematical formula","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][7])
- { // setting RY
- SetPVarInt(playerid, "TextSlot",5);
- ShowPlayerDialog(playerid, 1697, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}RY\n{BBBBBB}You can use +,-,/ & * operators before the number to apply a mathematical formula","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][8])
- { // setting RZ
- SetPVarInt(playerid, "TextSlot",6);
- ShowPlayerDialog(playerid, 1697, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}RZ\n{BBBBBB}You can use +,-,/ & * operators before the number to apply a mathematical formula","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][10])
- { // save
- cmd_osave(playerid, "");
- cmd_oinfo(playerid, "-1");
- }
- else if(playertextid == objinfo[playerid][11])
- { // destroy
- cmd_odestroy(playerid, "");
- //cmd_oinfo(playerid, "-1");
- }
- else if(playertextid == objinfo[playerid][12])
- { // copy
- cmd_ocopy(playerid, "");
- }
- else if(playertextid == objinfo[playerid][14])
- { // goto
- format(msg, sizeof(msg),"%d",GetPVarInt(playerid,"SelectedObject"));
- cmd_ogoto(playerid, msg);
- }
- else if(playertextid == objinfo[playerid][15])
- { // get
- format(msg, sizeof(msg),"%d",GetPVarInt(playerid,"SelectedObject"));
- cmd_oget(playerid, msg);
- }
- else if(playertextid == objinfo[playerid][22])
- { // mat1
- SetPVarInt(playerid, "TextSlot",7);
- ShowPlayerDialog(playerid, 1699, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}MAT 1\n{BBBBBB}Syntax: <model> [txd] [txt] [color]\nType in \"None\" to clear field.","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][23])
- { // mat2
- SetPVarInt(playerid, "TextSlot",8);
- ShowPlayerDialog(playerid, 1699, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}MAT 2\n{BBBBBB}Syntax: <model> [txd] [txt] [color]\nType in \"None\" to clear field.","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][24])
- { // mat3
- SetPVarInt(playerid, "TextSlot",9);
- ShowPlayerDialog(playerid, 1699, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}MAT 3\n{BBBBBB}Syntax: <model> [txd] [txt] [color]\nType in \"None\" to clear field.","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][5])
- { // model
- ShowPlayerDialog(playerid, 1698, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}new model\n{BBBBBB}Syntax: <new model>","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][16])
- { // >
- new slot = GetPVarInt(playerid, "SelectedObject");
- for(new i = slot+1; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- slot = i;
- break;
- }
- }
- format(msg, 3, "%d", slot);
- cmd_oinfo(playerid, msg);
- }
- else if(playertextid == objinfo[playerid][25])
- { // <
- new slot = GetPVarInt(playerid, "SelectedObject");
- for(new i = slot-1; i >= 0; i --)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- slot = i;
- break;
- }
- }
- format(msg, 3, "%d", slot);
- cmd_oinfo(playerid, msg);
- }
- else if(playertextid == objinfo[playerid][26])
- {//oedit
- if(!IsPlayerEdittingObject(playerid))
- {
- PlayerTextDrawSetString(playerid, objinfo[playerid][26], "~b~SAVE");
- format(msg, sizeof(msg),"%d",GetPVarInt(playerid,"SelectedObject"));
- cmd_oedit(playerid, msg);
- }
- else
- {
- PlayerTextDrawSetString(playerid, objinfo[playerid][26], "~b~EDIT");
- format(msg, sizeof(msg),"%d",GetPVarInt(playerid,"SelectedObject"));
- if(IsPlayerEdittingObject(playerid))
- CancelEdit(playerid);
- OnObjectEditMode(playerid, false);
- }
- }
- else if(playertextid == objinfo[playerid][27])
- {//close
- cmd_oinfo(playerid,"-1");
- }
- else if(playertextid == objinfo[playerid][28])
- {//refresh
- format(msg, sizeof(msg),"%d",GetPVarInt(playerid,"SelectedObject"));
- cmd_oinfo(playerid,msg);
- }
- else if(playertextid == objinfo[playerid][17])
- {//index set
- SetPVarInt(playerid, "TextSlot",10);
- ShowPlayerDialog(playerid, 1701, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}new index\n{BBBBBB}Syntax: <index>","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][18])
- {//set model
- SetPVarInt(playerid, "TextSlot",11);
- ShowPlayerDialog(playerid, 1701, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}new model\n{BBBBBB}Syntax: <model>","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][19])
- {//set txd
- SetPVarInt(playerid, "TextSlot",12);
- ShowPlayerDialog(playerid, 1701, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}new TXD\n{BBBBBB}Syntax: <TXD>","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][20])
- {//set txt
- SetPVarInt(playerid, "TextSlot",13);
- ShowPlayerDialog(playerid, 1701, DIALOG_STYLE_INPUT,"SETTING NEW VALUES","{FFFFFF}Type on the box below the new value for {FFFF00}new TXT\n{BBBBBB}Syntax: <TXT>","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][21])
- {//apply
- new txd[24],txt[24];
- GetPVarString(playerid, "SettingTxd",txd,24);
- GetPVarString(playerid, "SettingTxt",txt,24);
- format(msg, sizeof(msg),"%d %d %s %s 0",GetPVarInt(playerid,"SettingIdx"),
- GetPVarInt(playerid,"SettingModel"),txd,txt);
- cmd_omat(playerid, msg);
- }
- else if(playertextid == objinfo[playerid][29])
- {//quick save
- new mapname[24];
- if(!GetPVarString(playerid, "LastSavedMap", mapname, 24))
- return Error(playerid, "There's nothing to quick save.");
- GetPVarString(playerid, "LastSavedMap", mapname, 24);
- SaveMap(playerid, mapname);
- }
- else if(playertextid == objinfo[playerid][30])
- {//new
- SetPVarInt(playerid, "TextSlot",14);
- ShowPlayerDialog(playerid, 1702, DIALOG_STYLE_INPUT,"NEW OBJECT","{FFFFFF}Type on the box below the {FFFF00}model {FFFFFF}for the {FFFF00}new object\n{BBBBBB}Syntax: <model>","Ok","Cancel");
- }
- else if(playertextid == objinfo[playerid][31])
- {//-- index
- SetPVarInt(playerid, "SettingIdx", GetPVarInt(playerid,"SettingIdx") -1);
- if(GetPVarInt(playerid,"SettingIdx") == 0)
- {
- SetPVarInt(playerid, "SettingIdx", 0);
- PlayerTextDrawHide(playerid,objinfo[playerid][31]);
- }
- format(msg, sizeof(msg),"~b~INDEX: ~l~%d",GetPVarInt(playerid,"SettingIdx"));
- PlayerTextDrawSetString(playerid,objinfo[playerid][17],msg);
- }
- else if(playertextid == objinfo[playerid][32])
- {//++ index
- SetPVarInt(playerid, "SettingIdx", GetPVarInt(playerid,"SettingIdx")+1);
- if(GetPVarInt(playerid, "SettingIdx") == 1)
- PlayerTextDrawShow(playerid,objinfo[playerid][31]);
- format(msg, sizeof(msg),"~b~INDEX: ~l~%d",GetPVarInt(playerid,"SettingIdx"));
- PlayerTextDrawSetString(playerid,objinfo[playerid][17],msg);
- }
- else if(playertextid == objinfo[playerid][33])
- {//clear index
- format(msg, sizeof(msg),"%d",GetPVarInt(playerid,"SettingIdx"));
- cmd_oclearmat(playerid, msg);
- UpdateObjectInfoTextdraws(playerid, objects[GetPVarInt(playerid,"SelectedObject")],GetPVarInt(playerid,"SelectedObject"));
- }
- return 0;
- }
- stock UpdateObjectInfoTextdraws(playerid, object, slot)
- {
- if(!GetPVarInt(playerid,"oinfo"))
- return 1;
- new Float:Float[6],littlestr[24];
- if(object != 999 && slot != 999)
- {
- GetDynamicObjectPos(object, Float[0], Float[1], Float[2]);
- GetDynamicObjectRot(object, Float[3], Float[4], Float[5]);
- }
- else
- {
- SetPVarInt(playerid,"NoObject",1);
- for(new i = 0; i < sizeof(Float); i ++)
- Float[i] = 0.0;
- }
- format(littlestr, 24, "~g~X: ~l~%.2f",Float[0]);
- PlayerTextDrawSetString(playerid, objinfo[playerid][1],littlestr);
- format(littlestr, 24, "~g~Y: ~l~%.2f",Float[1]);
- PlayerTextDrawSetString(playerid, objinfo[playerid][2],littlestr);
- format(littlestr, 24, "~g~Z: ~l~%.2f",Float[2]);
- PlayerTextDrawSetString(playerid, objinfo[playerid][3],littlestr);
- format(littlestr, 24, "~b~SLOT: ~l~%d",slot);
- PlayerTextDrawSetString(playerid, objinfo[playerid][4],littlestr);
- if(object != 999 && slot != 999)
- format(littlestr, 24, "~b~MODEL: ~l~%d",objectmodel[slot]);
- else
- littlestr = "NULL";
- PlayerTextDrawSetString(playerid, objinfo[playerid][5],littlestr);
- format(littlestr, 24, "~g~RX: ~l~%.2f",Float[3]);
- PlayerTextDrawSetString(playerid, objinfo[playerid][6],littlestr);
- format(littlestr, 24, "~g~RY: ~l~%.2f",Float[4]);
- PlayerTextDrawSetString(playerid, objinfo[playerid][7],littlestr);
- format(littlestr, 24, "~g~RZ: ~l~%.2f",Float[5]);
- PlayerTextDrawSetString(playerid, objinfo[playerid][8],littlestr);
- if(object != 999 && slot != 999)
- format(msg, 64, "~g~MAT 0: ~l~%s",objectmatinfo[slot][0]);
- else
- msg = "NULL";
- PlayerTextDrawSetString(playerid, objinfo[playerid][22],msg);
- if(object != 999 && slot != 999)
- format(msg, 64, "~g~MAT 1: ~l~%s",objectmatinfo[slot][1]);
- else
- msg = "NULL";
- PlayerTextDrawSetString(playerid, objinfo[playerid][23],msg);
- if(object != 999 && slot != 999)
- format(msg, 64, "~g~MAT 2: ~l~%s",objectmatinfo[slot][2]);
- else
- msg = "NULL";
- PlayerTextDrawSetString(playerid, objinfo[playerid][24],msg);
- format(msg, 64, "~b~INDEX: ~l~%d",GetPVarInt(playerid,"SettingIdx"));
- PlayerTextDrawSetString(playerid, objinfo[playerid][17],msg);
- format(msg, 64, "~b~MODEL: ~l~%d",GetPVarInt(playerid,"SettingModel"));
- PlayerTextDrawSetString(playerid, objinfo[playerid][18],msg);
- new txd[24],txt[24];
- GetPVarString(playerid,"SettingTxd",txd,24);
- GetPVarString(playerid,"SettingTxt",txt,24);
- format(msg, 64, "~b~TXD: ~l~%s",txd);
- PlayerTextDrawSetString(playerid, objinfo[playerid][19],msg);
- format(msg, 64, "~b~TXT: ~l~%s",txt);
- PlayerTextDrawSetString(playerid, objinfo[playerid][20],msg);
- CheckForNextPrev(playerid);
- return 1;
- }
- stock oinfoPREV(playerid)
- {
- if(!GetPVarInt(playerid,"oinfo"))
- return 1;
- new slot = GetPVarInt(playerid, "SelectedObject");
- for(new i = slot-1; i >= 0; i --)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- slot = i;
- break;
- }
- }
- if(slot == GetPVarInt(playerid, "SelectedObject"))
- cmd_oinfo(playerid, "-1");
- else
- {
- format(msg, 5, "%d",slot);
- cmd_oinfo(playerid, msg);
- }
- return 1;
- }
- stock CheckForNextPrev(playerid)
- {
- if(GetPVarInt(playerid,"NoObject"))
- {
- PlayerTextDrawHide(playerid, objinfo[playerid][25]);
- return PlayerTextDrawHide(playerid, objinfo[playerid][16]);
- }
- new slot = GetPVarInt(playerid, "SelectedObject");
- for(new i = slot-1; i >= 0; i --)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- slot = i;
- break;
- }
- }
- if(slot == GetPVarInt(playerid, "SelectedObject"))
- PlayerTextDrawHide(playerid, objinfo[playerid][25]);
- else
- PlayerTextDrawShow(playerid, objinfo[playerid][25]);
- slot = GetPVarInt(playerid, "SelectedObject");
- for(new i = slot+1; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objects[i] != -1 && IsValidDynamicObject(objects[i]))
- {
- slot = i;
- break;
- }
- }
- if(slot == GetPVarInt(playerid, "SelectedObject"))
- PlayerTextDrawHide(playerid, objinfo[playerid][16]);
- else
- PlayerTextDrawShow(playerid, objinfo[playerid][16]);
- return 1;
- }
- stock CreateObjectInfoTextdraws(playerid)
- {
- if(GetPVarInt(playerid,"Created"))
- return 1;
- objinfo[playerid][0] = CreatePlayerTextDraw(playerid, 136.000000, 116.000000, "~b~~h~OBJECT~w~INFORMATION ~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~");
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][0], 0.400000, 2.000000);
- PlayerTextDrawTextSize(playerid, objinfo[playerid][0], 0.000000, 210.000000);
- objinfo[playerid][1] = CreatePlayerTextDraw(playerid, 66.000000, 173.000000, "~g~X: ~l~13337.22");
- PlayerTextDrawTextSize(playerid, objinfo[playerid][1], 10.000000, 59.000000);
- objinfo[playerid][2] = CreatePlayerTextDraw(playerid, 137.000000, 173.000000, "~g~Y: ~l~13337.22");
- PlayerTextDrawTextSize(playerid, objinfo[playerid][2], 10.000000, 58.000000);
- objinfo[playerid][3] = CreatePlayerTextDraw(playerid, 207.000000, 173.000000, "~g~Z: ~l~13337.22");
- PlayerTextDrawTextSize(playerid, objinfo[playerid][3], 10.000000, 59.000000);
- objinfo[playerid][4] = CreatePlayerTextDraw(playerid, 37.000000, 144.000000, "~b~SLOT: ~l~12");
- PlayerTextDrawTextSize(playerid, objinfo[playerid][4], 96.000000, 58.000000);
- objinfo[playerid][5] = CreatePlayerTextDraw(playerid, 108.000000, 144.000000, "~b~MODEL: ~l~16442");
- PlayerTextDrawTextSize(playerid, objinfo[playerid][5], 236.000000, 10.000000);
- objinfo[playerid][6] = CreatePlayerTextDraw(playerid, 66.000000, 193.000000, "~g~RX: ~l~169.69");
- PlayerTextDrawTextSize(playerid, objinfo[playerid][6], 10.000000, 59.000000);
- objinfo[playerid][7] = CreatePlayerTextDraw(playerid, 137.000000, 193.000000, "~g~RY: ~l~169.69");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][7], 10.000000, 59.000000);
- objinfo[playerid][8] = CreatePlayerTextDraw(playerid, 207.000000, 193.000000, "~g~RZ: ~l~169.69");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][8], 10.000000, 59.000000);
- objinfo[playerid][9] = CreatePlayerTextDraw(playerid, 36.000000, 216.000000, "~g~SET OBJECT MATERIAL ~n~~n~~n~");
- PlayerTextDrawFont(playerid, objinfo[playerid][9], 1);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][9], 236.000000, 57.000000);
- objinfo[playerid][10] = CreatePlayerTextDraw(playerid, 46.000000, 318.000000, "~g~SAVE");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][10], 10.000000, 21.000000);
- objinfo[playerid][11] = CreatePlayerTextDraw(playerid, 77.000000, 318.000000, "~g~DELETE");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][11], 10.000000, 26.000000);
- objinfo[playerid][12] = CreatePlayerTextDraw(playerid, 151.000000, 318.000000, "~b~COPY");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][12], 10.000000, 21.000000);
- //objinfo[playerid][13] = CreatePlayerTextDraw(playerid, 161.000000, 318.000000, "_");
- //PlayerTextDrawTextSize(playerid,objinfo[playerid][13], 17.000000, 17.000000);
- objinfo[playerid][14] = CreatePlayerTextDraw(playerid, 198.000000, 318.000000, "~r~~h~GOTO");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][14], 10.000000, 25.000000);
- objinfo[playerid][15] = CreatePlayerTextDraw(playerid, 226.000000, 318.000000, "~r~~h~GET");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][15], 10.000000, 17.000000);
- objinfo[playerid][16] = CreatePlayerTextDraw(playerid, 86.000000, 144.000000, "~>~");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][16], 95.000000, 10.000000);
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][16], 0.200000, 0.799999);
- objinfo[playerid][17] = CreatePlayerTextDraw(playerid, 38.000000, 229.000000, "~b~Index: ~l~1");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][17], 85.000000, 10.000000);
- objinfo[playerid][18] = CreatePlayerTextDraw(playerid, 38.000000, 242.000000, "~b~Model: ~l~click to set");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][18], 130.000000, 10.000000);
- objinfo[playerid][19] = CreatePlayerTextDraw(playerid, 125.000000, 229.000000, "~b~TXD: ~l~click to set");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][19], 234.000000, 10.000000);
- objinfo[playerid][20] = CreatePlayerTextDraw(playerid, 125.000000, 242.000000, "~b~TXT: ~l~click to set");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][20], 234.000000, 10.000000);
- objinfo[playerid][21] = CreatePlayerTextDraw(playerid, 213.000000, 217.000000, "~l~APPLY TO INDEX");
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][21], 0.129999, 0.799998);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][21], 9.000000, 43.000000);
- objinfo[playerid][22] = CreatePlayerTextDraw(playerid, 36.000000, 259.000000, "~g~MAT 1: ~l~None");
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][22], 0.229999, 1.000000);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][22], 236.000000, 10.000000);
- objinfo[playerid][23] = CreatePlayerTextDraw(playerid, 36.000000, 274.000000, "~g~MAT 2: ~l~None");
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][23], 0.229999, 1.000000);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][23], 236.000000, 10.000000);
- objinfo[playerid][24] = CreatePlayerTextDraw(playerid, 36.000000, 289.200012, "~g~MAT 3: ~l~None");
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][24], 0.229999, 1.000000);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][24], 236.000000, 10.000000);
- objinfo[playerid][25] = CreatePlayerTextDraw(playerid, 77.000000, 144.000000, "~<~");
- PlayerTextDrawTextSize(playerid,objinfo[playerid][25], 86.000000, 10.000000);
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][25], 0.200000, 0.799999);
- objinfo[playerid][26] = CreatePlayerTextDraw(playerid, 125.000000, 318.000000, "~b~EDIT");
- PlayerTextDrawAlignment(playerid, objinfo[playerid][26], 2);
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][26], 0.259999, 1.000000);
- PlayerTextDrawTextSize(playerid, objinfo[playerid][26], 10.000000, 19.000000);
- objinfo[playerid][27] = CreatePlayerTextDraw(playerid, 234.000000, 114.000000, "~w~x");
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][27], 0.259999, 0.599999);
- PlayerTextDrawTextSize(playerid, objinfo[playerid][27], 239.000000, 10.000000);
- objinfo[playerid][28] = CreatePlayerTextDraw(playerid, 225.000000, 114.000000, "~w~r");
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][28], 0.259999, 0.599999);
- PlayerTextDrawTextSize(playerid, objinfo[playerid][28], 229.000000, 10.000000);
- objinfo[playerid][29] = CreatePlayerTextDraw(playerid,216.000000, 114.000000, "~w~s");
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][29], 0.259999, 0.599999);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][29], 219.000000, 10.000000);
- objinfo[playerid][30] = CreatePlayerTextDraw(playerid,207.000000, 114.000000, "~w~n");
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][30], 0.259998, 0.599999);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][30], 211.000000, 10.000000);
- objinfo[playerid][31] = CreatePlayerTextDraw(playerid,85.000000, 229.000000, "~<~");
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][31], 0.450000, 0.799999);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][31], 91.000000, 10.000000);
- objinfo[playerid][32] = CreatePlayerTextDraw(playerid,95.000000, 229.000000, "~>~");
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][32], 0.450000, 0.799999);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][32], 101.000000, 10.000000);
- objinfo[playerid][33] = CreatePlayerTextDraw(playerid,163.000000, 217.000000, "~l~CLEAR INDEX");
- PlayerTextDrawLetterSize(playerid,objinfo[playerid][33], 0.129999, 0.799998);
- PlayerTextDrawTextSize(playerid,objinfo[playerid][33], 9.000000, 43.000000);
- for(new i = 0; i < sizeof(objinfo[]); i ++)
- {
- if(i != 0 && i != 4 && i != 9)
- PlayerTextDrawSetSelectable(playerid, objinfo[playerid][i], 1);
- PlayerTextDrawSetOutline(playerid, objinfo[playerid][i], 0);
- PlayerTextDrawSetShadow(playerid, objinfo[playerid][i], 0);
- PlayerTextDrawSetProportional(playerid, objinfo[playerid][i], 1);
- PlayerTextDrawUseBox(playerid, objinfo[playerid][i], 1);
- if(i != 21 && i != 33)
- PlayerTextDrawFont(playerid, objinfo[playerid][i], 1);
- if(i != 0 && i != 16 && i < 21)
- PlayerTextDrawLetterSize(playerid, objinfo[playerid][i], 0.259999, 1.000000);
- if(i != 4 && i != 5 && i != 9 && i != 16 && i != 19 && i != 20 && i != 17 && i != 18 && (i < 22 || i == 33))
- PlayerTextDrawAlignment(playerid, objinfo[playerid][i], 2);
- if(i == 14)
- PlayerTextDrawBackgroundColor(playerid, objinfo[playerid][i], 65535);
- else
- PlayerTextDrawBackgroundColor(playerid, objinfo[playerid][i], 255);
- if(i == 0 || i == 16 || i == 21 || i == 33)
- PlayerTextDrawColor(playerid, objinfo[playerid][i], -1);
- else
- PlayerTextDrawColor(playerid, objinfo[playerid][i], 255);
- if(i == 0)
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], 0x00000088);
- else if(i == 21 || i == 33)
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], 119);
- else if(i == 16 || i == 17 || i == 18 || i == 19 || i == 20 || i == 25 || i >= 27 && i <= 32)
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], 0);
- else if(i == 10 || i == 11)
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], 0x30642755);
- else if(i == 12 || i == 26)
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], 0x4D5690FF);
- else if(i == 14 ||i == 15)
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], 0xFF424755);
- else
- PlayerTextDrawBoxColor(playerid, objinfo[playerid][i], -1);
- }
- SetPVarInt(playerid,"Created",1);
- return 1;
- }
- stock DestroyObjectTextdraw(playerid)
- {
- if(ObjTextdraw[playerid] != PlayerText:INVALID_TEXT_DRAW)
- PlayerTextDrawDestroy(playerid, ObjTextdraw[playerid]), _:ObjTextdraw[playerid] = _:INVALID_TEXT_DRAW;
- return 1;
- }
- stock ShowObjectTextdraw(playerid)
- return PlayerTextDrawShow(playerid, ObjTextdraw[playerid]);
- stock CreateObjectTextdraw(playerid)
- {
- if(ObjTextdraw[playerid] != PlayerText:INVALID_TEXT_DRAW)
- return 1;
- ObjTextdraw[playerid] = CreatePlayerTextDraw(playerid, 2.000000, 434.000000, " ");
- PlayerTextDrawBackgroundColor(playerid, ObjTextdraw[playerid], 255);
- PlayerTextDrawFont(playerid, ObjTextdraw[playerid], 1);
- PlayerTextDrawLetterSize(playerid, ObjTextdraw[playerid], 0.290000, 1.300000);
- PlayerTextDrawColor(playerid, ObjTextdraw[playerid], -1);
- PlayerTextDrawSetOutline(playerid, ObjTextdraw[playerid], 0);
- PlayerTextDrawSetProportional(playerid, ObjTextdraw[playerid], 1);
- PlayerTextDrawSetShadow(playerid, ObjTextdraw[playerid], 1);
- PlayerTextDrawUseBox(playerid, ObjTextdraw[playerid], 1);
- PlayerTextDrawBoxColor(playerid, ObjTextdraw[playerid], 170);
- PlayerTextDrawTextSize(playerid, ObjTextdraw[playerid], 990.000000, 180.000000);
- return 1;
- }
- stock UpdateObjectTextdraw(playerid, const str2[] = "_")
- {
- new bigmsg[256];
- if(GetPVarInt(playerid, "SelectedObject") != -1)
- {
- new slot = GetPVarInt(playerid, "SelectedObject");
- new Float:Float[6];
- GetDynamicObjectPos(objects[slot],Float[0],Float[1],Float[2]);
- GetDynamicObjectRot(objects[slot],Float[3],Float[4],Float[5]);
- format(bigmsg,256," ~y~Slot: ~w~%d ~y~Model: ~w~%d ~p~X: ~w~%.1f ~p~Y: ~w~%.1f ~p~Z: ~w~%.1f ~p~RX: ~w~%.1f ~p~RY: ~w~%.1f ~p~RZ: ~w~%.1f ~r~%s",
- slot,objectmodel[slot],Float[0],Float[1],Float[2],Float[3],Float[4],Float[5],str2);
- }
- else
- bigmsg = " You are on ~y~object selection mode~w~. Click in ~y~any object~w~ to begin with the ~y~object edition system~w~.";
- PlayerTextDrawSetString(playerid, ObjTextdraw[playerid], bigmsg);
- return 1;
- }
- public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
- {
- if(!IsValidDynamicObject(objectid)) return 0;
- if(response == EDIT_RESPONSE_CANCEL)
- {
- if(!GetPVarInt(playerid,"Modifying"))
- {
- Info(playerid, "You canceled the object edition, you're no longer on edition mode.");
- OnObjectEditMode(playerid, false);
- CancelEdit(playerid);
- if(GetPVarInt(playerid,"oinfo"))
- {
- DestroyObjectTextdraw(playerid);
- PlayerTextDrawSetString(playerid, objinfo[playerid][26], "~b~EDIT");
- return SelectTextDraw(playerid, 0xBBBBBBBB);
- }
- //SetPVarInt(playerid, "SelectedObject", -1);
- }
- DeletePVar(playerid,"Modifying");
- }
- else if(response == EDIT_RESPONSE_FINAL)
- {
- if(!GetPVarInt(playerid,"Modifying"))
- {
- MoveDynamicObject(objectid, x,y,z,10000,rx,ry,rz);
- Info(playerid, "You successfully moved the object to it's new position.");
- Info(playerid, "You have been put back in selection mode, use {FF6600}ESC {ffffff}to exit it.");
- UpdateObjectTextdraw(playerid);
- SelectObject(playerid);
- OnObjectEditMode(playerid, false);
- if(GetPVarInt(playerid,"oinfo"))
- {
- CancelEdit(playerid);
- DestroyObjectTextdraw(playerid);
- PlayerTextDrawSetString(playerid, objinfo[playerid][26], "~b~EDIT");
- return SelectTextDraw(playerid, 0xBBBBBBBB);
- }
- }
- //SetPVarInt(playerid, "SelectedObject", -1);
- }
- else
- {
- if(!GetPVarInt(playerid,"Modifying"))
- {
- MoveDynamicObject(objectid, x,y,z,10000,rx,ry,rz);
- UpdateObjectTextdraw(playerid,"(edit mode)");
- UpdateObjectInfoTextdraws(playerid,objectid,GetPVarInt(playerid,"SelectedObject"));
- }
- }
- return 0;
- }
- public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
- {
- new slot = -1;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(objectid == objects[i])
- {
- slot = i;
- break;
- }
- else continue;
- }
- if(slot == -1)
- return Error(playerid, "That's not your object...");
- format(msg, sizeof(msg),"%d",slot);
- cmd_oedit(playerid,msg);
- OnObjectEditMode(playerid,true);
- UpdateObjectTextdraw(playerid);
- return 0;
- }
- stock OnObjectEditMode(playerid, bool:mode)
- {
- if(mode == true)
- {
- if(IsPlayerEdittingObject(playerid))
- {
- UpdateObjectTextdraw(playerid);
- return 0;
- }
- SetPVarInt(playerid,"OnObjectEditMode",1);
- //CreateObjectTextdraw(playerid);
- UpdateObjectTextdraw(playerid);
- //ShowObjectTextdraw(playerid);
- return 1;
- }
- else
- {
- if(!IsPlayerEdittingObject(playerid))
- return 0;
- SetPVarInt(playerid,"OnObjectEditMode",0);
- //DestroyObjectTextdraw(playerid);
- return 1;
- }
- }
- stock IsPlayerEdittingObject(playerid)
- {
- return GetPVarInt(playerid,"OnObjectEditMode");
- }
- stock ExportMap(playerid, mapname[], function[])
- {
- new map[64],totalobjects = 0,File:mapfile;
- format(map, sizeof(map),"/maps/%s.map",mapname);
- if(dini_Exists(map))
- fremove(map);
- dini_Create(map);
- mapfile = fopen(map,io_write);
- new Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz;
- new model, txd[24], txt[24], col;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(IsValidDynamicObject(objects[i]))
- {
- GetDynamicObjectPos(objects[i],x,y,z);
- GetDynamicObjectRot(objects[i],rx,ry,rz);
- format(msg, sizeof(msg),"object[%d] = %s(%d,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f);\n\r",i,function,objectmodel[i],x,y,z,rx,ry,rz);
- fwrite(mapfile, msg);
- if(strcmp(objectmatinfo[i][0],"None",true))
- {
- sscanf(objectmatinfo[i][0],"is[16]s[16]h",model,txd,txt,col);
- format(msg, sizeof(msg),"SetDynamicObjectMaterial(object[%d],%d,%d,%s,%s,%d);\n\r",i,0,model,txd,txt,col);
- fwrite(mapfile, msg);
- }
- if(strcmp(objectmatinfo[i][1],"None",true))
- {
- sscanf(objectmatinfo[i][1],"is[16]s[16]h",model,txd,txt,col);
- format(msg, sizeof(msg),"SetDynamicObjectMaterial(object[%d],%d,%d,%s,%s,%d);\n\r",i,1,model,txd,txt,col);
- fwrite(mapfile, msg);
- }
- if(strcmp(objectmatinfo[i][2],"None",true))
- {
- sscanf(objectmatinfo[i][2],"is[16]s[16]h",model,txd,txt,col);
- format(msg, sizeof(msg),"SetDynamicObjectMaterial(object[%d],%d,%d,%s,%s,%d);\n\r",i,2,model,txd,txt,col);
- fwrite(mapfile, msg);
- }
- totalobjects ++;
- }
- }
- fclose(mapfile);
- if(totalobjects == 0)
- {
- fremove(map);
- Error(playerid, "You must have atleast one object to save a map!");
- return 1;
- }
- dini_IntSet(map,"Objects",totalobjects);
- format(msg, sizeof(msg),"Map has been saved as '%s' (%s).",mapname,function);
- Info(playerid, msg);
- return 1;
- }
- stock SaveMap(playerid, mapname[])
- {
- new map[64],totalobjects = 0,slotname[5];
- format(map, sizeof(map),"maps/%s.ini",mapname);
- if(dini_Exists(map))
- {
- fremove(map);
- }
- dini_Create(map);
- dini_Set(map,"Owner",PlayerName(playerid));
- SetPVarString(playerid,"LastSavedMap",mapname);
- new Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(IsValidDynamicObject(objects[i]))
- {
- GetDynamicObjectPos(objects[i],x,y,z);
- GetDynamicObjectRot(objects[i],rx,ry,rz);
- format(bigmatinfo, sizeof(bigmatinfo),"%d,%f,%f,%f,%f,%f,%f,%s|%s|%s",objectmodel[i],x,y,z,rx,ry,rz,objectmatinfo[i][0],objectmatinfo[i][1],objectmatinfo[i][2]);
- format(slotname, sizeof(slotname),"%d",i);
- dini_Set(map,slotname,bigmatinfo);
- totalobjects ++;
- }
- }
- if(totalobjects == 0)
- {
- fremove(map);
- Error(playerid, "You must have atleast one object to save a map!");
- return 1;
- }
- dini_IntSet(map,"Objects",totalobjects);
- format(msg, sizeof(msg),"Map has been saved as '%s', Use /loadmap to load it whenever you want.",mapname);
- Info(playerid, msg);
- Tip(playerid, "You can use {FF6600}~k~~GROUP_CONTROL_BWD~ {FFFFFF}to perform a {FF6600}quick save {FFFFFF}of this map.");
- return 1;
- }
- CMD:orot(playerid, params[])
- {
- new Float:Float_1,Float:Float_2,Float:Float_3,Float:Float_4;
- if (sscanf(params, "ffff",Float_1,Float_2,Float_3,Float_4))
- return Usage(playerid, "/orot <rx> <ry> <rz> <speed>");
- new editting = GetPVarInt(playerid, "SelectedObject");
- if(editting == -1) return Error(playerid, "You're not editting any object!");
- if(Attached[editting] >= 1) return Error(playerid, "You can't do this with attached objects");
- SetPVarInt(playerid,"Modifying",1);
- CancelEdit(playerid);
- new Float:X,Float:Y,Float:Z,Float:RX,Float:RY,Float:RZ;
- GetDynamicObjectPos(objects[editting],X,Y,Z);
- GetDynamicObjectRot(objects[editting],RX,RY,RZ);
- MoveDynamicObject(objects[editting],X,Y,Z+0.0001,Float_4,RX+Float_1,RY+Float_2,RZ+Float_3);
- if(IsPlayerEdittingObject(playerid))
- EditDynamicObject(playerid,objects[editting]);
- UpdateObjectInfoTextdraws(playerid,objects[editting],editting);
- format(msg, sizeof(msg),"(RX %s;RY %s;RZ %s)",ProcessFloat(Float_1),ProcessFloat(Float_2),ProcessFloat(Float_3));
- UpdateObjectTextdraw(playerid, msg);
- return 1;
- }
- stock UpdateNearPlayers(playerid)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x,y,z);
- for(new i = 0; i < PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerInRangeOfPoint(i,200, x,y,z))
- {
- Streamer_Update(i);
- }
- }
- }
- return 1;
- }
- stock GetObjectSlot(object)
- {
- if(!IsValidDynamicObject(object)) return -1;
- new slt = -1;
- for(new i = 0; i < MAX_PLAYER_OBJECTS; i ++)
- {
- if(object == objects[i])
- {
- return i;
- }
- }
- return slt;
- }
- stock IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- stock timestamp() //By Y-Less
- {
- new h,m,s,d,n,y;
- gettime(h, m, s);
- getdate(y, n, d);
- return maketime(h, m, s, d, n, y);
- }
- stock maketime(hour, minute, second, day, month, year) //By Y-Less
- {
- static days_of_month[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
- static lMinute, lHour,lDay,lMonth, lYear, lMinuteS, lHourS, lDayS, lMonthS, lYearS;
- if (year != lYear)
- {
- lYearS = 0;
- for (new j = 1970; j < year; j++)
- {
- lYearS += 31536000;
- if ((!(j % 4) && (j % 100)) || !(j % 400)) lYearS += 86400;
- }
- lYear = year;
- }
- if (month != lMonth)
- {
- lMonthS = 0;
- month--;
- for (new i = 0; i < month; i++)
- {
- lMonthS += days_of_month[i] * 86400;
- if ((i == 1) && ((!(year % 4) && (year % 100)) || !(year % 400))) lMonthS += 86400;
- }
- lMonth = month;
- }
- if (day != lDay)
- {
- lDayS = day * 86400;
- lDay = day;
- }
- if (hour != lHour)
- {
- lHourS = hour * 3600;
- lHour = hour;
- }
- if (minute != lMinute)
- {
- lMinuteS = minute * 60;
- lMinute = minute;
- }
- return lYearS + lMonthS + lDayS + lHourS + lMinuteS + second;
- }
- stock Tip(playerid, const message[])
- {
- new string[200];
- format(string, sizeof(string),"{008080}TIP: {FFFFFF}%s",message);
- RenderMessage(playerid,COLOR_WHITE,string);
- return 1;
- }
- stock Error(playerid, const message[])
- {
- new string[200];
- format(string, sizeof(string),"{FF6347}ERROR: {FFFFFF}%s",message);
- RenderMessage(playerid,COLOR_WHITE,string);
- return 1;
- }
- stock Warning(playerid, const message[])
- {
- new string[200];
- format(string, sizeof(string),"{FF0000}WARNING: {FFFFFF}%s",message);
- RenderMessage(playerid,COLOR_WHITE,string);
- return 1;
- }
- stock OtherMsg(playerid, const message[])
- {
- RenderMessage(playerid,COLOR_TIP,message);
- return 1;
- }
- stock Info(playerid, const message[])
- {
- new string[200];
- format(string, sizeof(string),"{00FFFF}INFO: {FFFFFF}%s",message);
- RenderMessage(playerid,COLOR_WHITE,string);
- return 1;
- }
- stock Usage(playerid, const message[])
- {
- new string[200];
- format(string, sizeof(string),"{FFFF00}USAGE: {FFFFFF}%s",message);
- RenderMessage(playerid,COLOR_WHITE,string);
- return 1;
- }
- stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- stock PlayerName(playerid)
- {
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- return name;
- }
- stock RenderMessage(top, color, const text[])
- {
- new temp[156], tosearch = 0, colorint, posscolor, lastcol[12];
- new mess[356], colors, tempc; format(mess, 356, "%s",text);
- while(strlen(mess) > 0)
- {
- if(strlen(mess) < 140)
- {
- SendClientMessage(top, color, mess);
- break;
- }
- strmid(temp, mess, 0, 128);
- while(strfind(temp, "{", true) != -1)
- {
- tempc = strfind(temp, "{", true);
- if(temp[tempc+7] == '}')
- {
- colors ++;
- strdel(temp, tempc, tempc+7);
- }
- else
- {
- temp[tempc] = '0';
- continue;
- }
- }
- temp = "";
- if(strfind(mess," ",true,100+colors*8) != -1)
- {
- tosearch = strfind(mess," ",true,100+colors*8)+1;
- while(tosearch > 140)
- {
- colors --;
- tosearch = strfind(mess," ",true,100+colors*8)+1;
- }
- }
- if(strfind(mess,"{",true) != -1) //color codes detection , YAY
- {
- posscolor = strfind(mess,"{",true);
- if(mess[posscolor+7] == '}') //detected one color
- colorint = posscolor;
- while(strfind(mess,"{",true,colorint+1) != -1) //repeat until none are found
- {
- posscolor = strfind(mess,"{",true,colorint+1);
- if(posscolor > tosearch) //if next color will be on the other line, use last color found to render on the next line
- {
- posscolor = colorint;
- break;
- }
- if(mess[posscolor+7] == '}') //if found, then assign the color
- {
- colorint = posscolor;
- }
- else
- {
- posscolor = colorint; //else, leave the last color.
- break;
- }
- }
- if(colorint == posscolor) //if the color position equals the one that was found
- strmid(lastcol,mess,colorint,colorint+8); //get the last used color string.
- }
- strmid(temp, mess, 0, tosearch);
- SendClientMessage(top, color, temp);
- strdel(mess, 0, tosearch);
- strins(mess, lastcol, 0); //insert last used color into the new line to be processed.
- temp = "";
- tosearch = 0;
- colors = 0;
- }
- return 1;
- }
- stock RenderMessageToAll(color, const text[])
- {
- new temp[156], tosearch = 0, colorint, posscolor, lastcol[12];
- new mess[356], colors, tempc; format(mess, 356, "%s",text);
- while(strlen(mess) > 0)
- {
- strmid(temp, mess, 0, 128);
- while(strfind(temp, "{", true) != -1)
- {
- tempc = strfind(temp, "{", true);
- if(temp[tempc+7] == '}')
- {
- colors ++;
- strdel(temp, tempc, tempc+7);
- }
- else
- {
- temp[tempc] = '0';
- continue;
- }
- }
- temp = "";
- if(strfind(mess," ",true,100+colors*8) != -1)
- {
- tosearch = strfind(mess," ",true,100+colors*8)+1;
- while(tosearch > 140)
- {
- colors --;
- tosearch = strfind(mess," ",true,100+colors*8)+1;
- }
- }
- if(tosearch <= 0)
- {
- SendClientMessageToAll(color, mess);
- break;
- }
- if(strfind(mess,"{",true) != -1) //color codes detection , YAY
- {
- posscolor = strfind(mess,"{",true);
- if(mess[posscolor+7] == '}') //detected one color
- colorint = posscolor;
- while(strfind(mess,"{",true,colorint+1) != -1) //repeat until none are found
- {
- posscolor = strfind(mess,"{",true,colorint+1);
- if(posscolor > tosearch) //if next color will be on the other line, use last color found to render on the next line
- {
- posscolor = colorint;
- break;
- }
- if(mess[posscolor+7] == '}') //if found, then assign the color
- {
- colorint = posscolor;
- }
- else
- {
- posscolor = colorint; //else, leave the last color.
- break;
- }
- }
- if(colorint == posscolor) //if the color position equals the one that was found
- strmid(lastcol,mess,colorint,colorint+8); //get the last used color string.
- }
- strmid(temp, mess, 0, tosearch);
- SendClientMessageToAll(color, temp);
- strdel(mess,0,tosearch);
- strins(mess, lastcol, 0);
- temp = "";
- tosearch = 0;
- colors = 0;
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment