Mapper System

Started by Maximiliano, Feb 11, 2021, 12:16 AM

Previous topic - Next topic

Maximiliano

Requeriments: S.L.C Extended Timers ( http://forum.vc-mp.org/?topic=1487.0 )

Credits: Diego^ ( This system is based on https://forum.vc-mp.org/index.php?topic=1143.0 )

Video: https://www.youtube.com/watch?v=K_xtzc2nSRU

Commands: /obj, /copy, /objdel, /mov, /rot, /gotomyobj, /objinfo, /objselect (mouse or id)

Code:

[spoiler]
Put in OnScriptLoad:
OBJ_DB <- ConnectSQL( "Objects.db" );
dofile( "scripts/timersystem.nut" );
dofile( "scripts/_MapperSystem.nut" );
Mapper.LoadSystem()

Put in onPlayerCommand:
::Mapper.onCommand( player, cmd, text )

Put in onObjectShot:
::Mapper.onObjectShot(player, object)

Put at the end of the main.nut:

function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
  tokenized = split(string, separator),
  text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}


Create a file .nut called _MapperSystem.nut with the following code:
[spoiler]

Pastebin: https://pastebin.com/mp77pE0q

I upload the system to pastebin because it exceeded the character limit XD
[/spoiler][/spoiler]

Notes:
I have tested it in a Blank Server and works fine, if you found some bug, tell me.

I made this system 1 or 2 years ago to use it personally, and since I did not continue to the server I decided to share the system.
I hope someone will find it useful <3.

Razor.


Gito Baloch

Programming is the language I speak, the world I shape, and the future I code

Sebastian

Can you provide screenshots/video ?

Maximiliano

Quote from: Razor. on Feb 11, 2021, 12:40 AMGreat work!
Quote from: Gito Baloch on Feb 11, 2021, 03:36 AMWelldone bro!!!

Thank you guys <3!
Quote from: Sebastian on Feb 11, 2021, 09:08 AMCan you provide screenshots/video ?

Sure, no problem. I will upload the video to youtube and update this post when it is ready