Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Maximiliano

#1
It looks very good, good job <3 ;)
#2
Script Showroom / Re: Mapper System
Feb 14, 2021, 01:31 AM
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
#3
Script Showroom / Mapper System
Feb 11, 2021, 12:16 AM
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.
#4
Script Showroom / Re: Punishment System
Mar 26, 2020, 03:18 PM
Quote from: =RK=MarineForce on Mar 25, 2020, 10:40 AMIndex Timer Does not exists wtf?

Requeriments: S.L.C Extended Timers ( http://forum.vc-mp.org/?topic=1487.0 )
#5
Quote from: rww on Mar 01, 2019, 04:00 PMU can get correct vehicle angle by this script

function CVehicle::GetRadiansAngle() //by Gudio
{
local angle = ::asin(this.Rotation.z) * -2;
return this.Rotation.w < 0 ? 3.14159 - angle : 6.28319 - angle;
}

I never get problems with values from this code ;)

Example, how to get correct angle by /pos command

onPlayerCommands event:
local veh = player.Vehicle;

if (cmd == "pos")
{
if (!veh) ClientMessage("* Your Cords:[#ffffff] "+player.Pos.x+", "+player.Pos.y+", "+player.Pos.z+", "+player.Angle,player,128,255,0,255);
else ClientMessage("* Your Vehicle Cords:[#ffffff] "+player.Pos.x+", "+player.Pos.y+", "+player.Pos.z+", "+veh.GetRadiansAngle(),player,128,255,0,255);
ClientMessage("* Virtual World:[#ffffff] "+player.World+" [#80ff00]/ Sec World:[#ffffff] "+player.SecWorld+" [#80ff00]/ Unique World: [#ffffff]"+player.UniqueWorld,player,128,255,0,255);
}
#6
Quote from: Doom_Kill3R on Feb 21, 2020, 07:34 AMSockets can be used for other stuff than just IRC yes, but you need to basically understand how they work and what to do with the requests and responses, although I never tried it.
Thank you very much for explaining and commenting.

Quote from: Luckshya on Feb 21, 2020, 07:56 AMI have used sockets for HTTP requests but I had to create sockets everytime to send a request. So I created that simple plugin for that.

Maybe try this: https://forum.vc-mp.org/?topic=7522.0

And you can use JSON parser to parse the json string to squirrel data using some available parser like https://github.com/electricimp/JSONParser
I will use your module :D Thank you very much




#7
Hello, good morning, I have a question :'v. Could someone explain to me how the NewSocket works, and if an example is possible (that is not related to the IRC).

Is it possible to use NewSocket to use an Web API ? Example: https://api.chucknorris.io/jokes/random .
If is possible, can i use it many times? Or will cause lag?

Excuse my ignorance about it and my bad english XD.

Thanks in advance.
#8
Script Showroom / Re: Punishment System
Jan 22, 2020, 08:38 PM
Quote from: JackSparrow on Jan 16, 2020, 04:14 AMWe can't ban this tag plr =FF= but we can ban this tag plr [FF]
any error in the console?
#10
Quote from: Kelvinvenema on Dec 25, 2019, 02:14 PM
Quote from: Maximiliano on Dec 25, 2019, 02:07 PMYou can create a function and then you use the NewTimer function:
NewTimer (Function, Milliseconds, Number of times to be repeated, function parameters);

Example:
function Test( player )
{
    MessagePlayer("Timer working correctly", player);
}

NewTimer("Test", 1000, 2, player);
1000 miliseconds = 1 second. 2 = Number of times to be repeated. - player = function parameters


Another example:
function GotoPlayer( player, player2 )
{
    player.Pos = player2.Pos;
    MessagePlayer("You has teleported to " + player2.Name + ".", player);
}

NewTimer("GotoPlayer", 3000, 1, player, player2);
3000 miliseconds = 3 second. 1 = Number of times to be repeated. - player,  player2 = function parameters.

i don't know that that works in my example
for example i will use
a command like fixvehicle
how do i add a cooldown so that players can only use this command every 10m
your example doesn't give me the lines i can use.



Use an array to save the commands that the user can no longer use.
Example:
CommandsUsed <- array( GetMaxPlayers(), []);

function onPlayerCommand( player, cmd, text )
{
if ( cmd.tolower() == "fix" )
{
if ( CommandsUsed[ player.ID ].find("fix") ) MessagePlayer("You can't use this command in this time. (Wait approximately less than 10 minutes) ",player);
else
{
//Your code here...
CommandsUsed[ player.ID ].push( "fix" );
NewTimer("CommandRelease", 600000, 1, player, cmd);

}
}
}


function CommandRelease(player, cmd) //This will eliminate the array command, so the player can use it again
{
if ( CommandsUsed[ player.ID ].find( cmd ))
{
local position = CommandsUsed[ player.ID ].find( cmd );
CommandsUsed[ player.ID ].remove(position);
}
}

It's untested XD
#11
You can create a function and then you use the NewTimer function:
NewTimer (Function, Milliseconds, Number of times to be repeated, function parameters);

Example:
function Test( player )
{
    MessagePlayer("Timer working correctly", player);
}

NewTimer("Test", 1000, 2, player);
1000 miliseconds = 1 second. 2 = Number of times to be repeated. - player = function parameters


Another example:
function GotoPlayer( player, player2 )
{
    player.Pos = player2.Pos;
    MessagePlayer("You has teleported to " + player2.Name + ".", player);
}

NewTimer("GotoPlayer", 3000, 1, player, player2);
3000 miliseconds = 3 second. 1 = Number of times to be repeated. - player,  player2 = function parameters.
#12
Support / Re: Build mode not working :(
Dec 25, 2019, 12:05 AM
it don't load anything :c  https://streamable.com/u5f3g :c
--------------------------------------------------------------------
I don't like bother you, but I need help to fix the buildmode :c Someone can help me :c?
#13
Support / Build mode not working
Dec 24, 2019, 09:05 PM
The build mode work for someone?

My build mode isn't working :( it don't load anything :c  https://streamable.com/u5f3g :c
#14
Hello :D Could someone explain to me how to create a plugin?

I have seen different topics (like this: https://forum.vc-mp.org/?topic=13.0), but I cant understand :c... I would be very grateful if someone can explain to me and/or send me a video about it.

Thank you very much in advance. :D
#15
Support / Build mode not working :(
Dec 23, 2019, 01:30 AM
The build mode work for someone?

My build mode isn't working :(

Does anyone know how to fix it?