Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: KAKAN on Oct 04, 2015, 01:13 PM

Title: Marks
Post by: KAKAN on Oct 04, 2015, 01:13 PM
So, these are just the markers I made around VCMP, to make it feel like VC.
Unfortunately, I don't have enough time to create all of them, if u have some more, you are free to post them here
I missed one important marker: and that is B, the biker one

Snip:-
Add this on onScriptLoad()
LoadMarks();
And here are the functions, paste them anywhere in your script.
Marks <- [
[ Vector( 496.2365, -84.4060, 10.0303 ), 13 ],
[ Vector( -378.1886, -541.0148, 17.2831 ), 29 ],
[ Vector( -636.5052, -1486.2062, 13.6366 ), 12 ],
[ Vector( -865.0884, -569.6799, 11.1080 ), 21 ],
[ Vector( -1004.1774, 198.2034, 11.4103 ), 22 ],
[ Vector( -884.3292, 1053.2415, 13.1551 ), 23 ],
[ Vector( -1022.6064, -856.6926, 13.0927 ), 26 ],
[ Vector( -46.8305, 953.1503, 10.9403 ), 15 ],
[ Vector( -596.642, 642.104, 11.6765 ), 5 ],
[ Vector( -680.864, 1202.67, 11.1098 ), 16 ],
[ Vector( -62.7244, -1481.67, 10.4879 ), 16 ],
[ Vector( 199.832, -474.905, 11.0699 ), 18 ]
];


function LoadMarks( ) for(local i = 0; i < Marks.len(); i++ ) CreateMarker( 1, Marks[ i ][ 0 ], 5, RGB(10, 10, 10), Marks[ i ][ 1 ] );

function GetMarkCount() return Marks.len();
Title: Re: Marks
Post by: DizzasTeR on Oct 04, 2015, 01:50 PM
function onScriptLoad()
{
    LoadMarks();
}

function LoadMarks()
{
local Marks = [
[ CreateMarker( 1, Vector( 496.2365, -84.4060, 10.0303 ), 5, RGB(10, 10, 10), 13 ) ],
[ CreateMarker( 1, Vector( -378.1886, -541.0148, 17.2831 ), 5, RGB(10, 10, 10), 29 ) ],
[ CreateMarker( 1, Vector( -636.5052, -1486.2062, 13.6366 ), 5, RGB(10, 10, 10), 12 ) ],
[ CreateMarker( 1, Vector( -865.0884, -569.6799, 11.1080 ), 5, RGB(10, 10, 10), 21 ) ],
[ CreateMarker( 1, Vector( -1004.1774, 198.2034, 11.4103 ), 5, RGB(10, 10, 10), 22 ) ],
[ CreateMarker( 1, Vector( -884.3292, 1053.2415, 13.1551 ), 5, RGB(10, 10, 10), 23 ) ],
[ CreateMarker( 1, Vector( -1022.6064, -856.6926, 13.0927 ), 5, RGB(10, 10, 10), 26 ) ],
[ CreateMarker( 1, Vector( -46.8305, 953.1503, 10.9403 ), 5, RGB(10, 10, 10), 15 ) ]
];

foreach( val, id in Marks ) {}
print( "Markers loaded" );
}

Locals are faster in functions, since its only going to get called once, the local Marks array will locally get created on server start until the markers are created, you can also avoid that for loop and use a simple foreach since we are using an array. :D
Title: Re: Marks
Post by: Thijn on Oct 04, 2015, 03:32 PM
@Doom_Killer
You don't even need a loop there. And you don't need those extra [ ] either.

local Marks = [
 CreateMarker( 1, Vector( 496.2365, -84.4060, 10.0303 ), 5, RGB(10, 10, 10), 13 ),
 CreateMarker( 1, Vector( -378.1886, -541.0148, 17.2831 ), 5, RGB(10, 10, 10), 29 ),
 CreateMarker( 1, Vector( -636.5052, -1486.2062, 13.6366 ), 5, RGB(10, 10, 10), 12 ),
 CreateMarker( 1, Vector( -865.0884, -569.6799, 11.1080 ), 5, RGB(10, 10, 10), 21 ),
 CreateMarker( 1, Vector( -1004.1774, 198.2034, 11.4103 ), 5, RGB(10, 10, 10), 22 ),
 CreateMarker( 1, Vector( -884.3292, 1053.2415, 13.1551 ), 5, RGB(10, 10, 10), 23 ),
 CreateMarker( 1, Vector( -1022.6064, -856.6926, 13.0927 ), 5, RGB(10, 10, 10), 26 ),
 CreateMarker( 1, Vector( -46.8305, 953.1503, 10.9403 ), 5, RGB(10, 10, 10), 15 ]
 ];
Title: Re: Marks
Post by: DizzasTeR on Oct 04, 2015, 03:35 PM
Didn't mean to make it with loop, but still it can be configured with loop as well, the loop is empty, shows the loop isn't needed tho but the idea was it can be made more simpler.
Title: Re: Marks
Post by: KAKAN on Oct 04, 2015, 04:09 PM
Yet, I like to use my way. As it is simple and easier to understand.
Hmm, the thing,"locals are faster", I didn't knew about it. Thanks!
Title: Re: Marks
Post by: HaCkeR0o1 on Oct 21, 2015, 01:50 PM
KAKAN i use this marks. Good work but add more marks which are not in VC.
Title: Re: Marks
Post by: KAKAN on Oct 21, 2015, 03:47 PM
I forgot to update.
I'll update it as soon as I'm back from my trip
Title: Re: Marks
Post by: HaCkeR0o1 on Oct 25, 2015, 11:30 AM
ok KAKAN
Title: Re: Marks
Post by: KAKAN on Oct 25, 2015, 01:54 PM
Updated the whole code.
Title: Re: Marks
Post by: WAJID on Nov 14, 2017, 11:23 AM
NICE BRO