Vice City: Multiplayer

Community Projects => SLC's Squirrel Plugin => Topic started by: . on Mar 23, 2016, 09:00 PM

Title: Features you'd like to see.
Post by: . on Mar 23, 2016, 09:00 PM
I'd like to ask people what features do you think are missing from the official Squirrel plug-in so that I could implement them in the one that I'm working on.

Speak your mind here about situations where certain things would've made your life easier and you think would make sense to have in a scripting plug-in.

Keep in mind that your suggestion is open for debate. And if that feature already exists I'll give you an example of it. And if it's planed for later then I'll discuss the way I thought to implement it.

I'll be waiting for your feedback.


NOTE: This plug-in might be obsolete in near future since the devs are working on something else. This is for those that want to stick with Squirrel because that's what they've got used to.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 23, 2016, 10:05 PM
Well no clue as to "is this for a in particular plug-in" if not hear is what would make my life easier and possibly others.

:: A plug-in that will have a method of reloading the script every 6 squirrel [hour] or somewhere in that line of work as ReloadScripts(); does not work properly with function onScriptUnload() This could be very helpful with maintaining the server performance. If you know of any methods that could help a servers performance, This would help Aid the owners servers from lagging out from to much data in the memory,  preventing any possible issues, possible even a crash or future lag as the memory begins to build up, ??? Just posting what would make it easier on myself,.
Title: Re: Features you'd like to see.
Post by: . on Mar 23, 2016, 10:35 PM
Quote from: Mr_Motley on Mar 23, 2016, 10:05 PM:: A plug-in that will have a method of reloading the script every 6 squirrel [hour]

Not really sure how this would improve the performance in any way to be honest. I haven't implemented the reload functionality directly yet but I've left room to easily add it later.

But if this is really a necessary thing, it could be achieved using a routine:
SqRoutine.Create(getroottable(), function(
    SqCore.Reload(true);
), SqTime.Hours(6).MillisecondsRaw, 1).SetTag("AutoReload");

The 'false' argument tells the plugin to reload the scripts before processing any data during the next frame event. Where as 'true' would process data during the next frame events and then reload the scripts. Because the scripts are never reloaded in the middle of the execution.

The 'true' argument tells the plugin to reload the scripts at the end of the current execution. Where as 'false' would disable the reloading if it was enabled before. SqCore.Reloading() returns the boolean value that tells if reloading was enabled.

Also notice that I'm not saving that timer which is why I've gave it a tag so that I can later retrieve it and stop it or modify it if I want to.
SqRoutine.FindByTag("AutoReload").Terminate();
Otherwise I'd have no possibility of stopping/modifying that timer.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 23, 2016, 11:08 PM
Understanding..

Unfortuntly I wanted to create an error and test it in a cmd build and was capable of fixing it even though I feel it is still an error but data is still written to the account etc

  if (cmd == "reset" || cmd == "restartserver") {
    if (admin[player.ID] < 1) {
      AdminCommand(player);
      return true;
    }
    (onScriptUnload() || ReloadScripts());
    return true;
  }

//part of an 5 minute timer
  if (Date["hour"] == 6 && Date["min"] == 0) {
  (onScriptUnload() || ReloadScripts());
  }
Sorry for the inconvenience as I was going to delete the post
Title: Re: Features you'd like to see.
Post by: aXXo on Mar 24, 2016, 12:44 AM
Will existing squirrel scripts be fully(or semi) compatible with the new plugin or everything will need a complete re-write?



The onPlayerMove() function is unusable, it should be removed. In most cases this function is used to detect when a player enters/exits an area. Could we have something that can be used without causing lag?

Example:
[CZone] CreateZone( [float] minX, [float] minY, [float] minZ, [float] maxX, [float] maxY, [float] maxZ )
It should accept null parameters to make it possible to create 2D or 1D zones.

CZone Properties:
.ID
.minX, .minY, .minZ,
.maxX, .maxY, .maxZ
.Remove()

onPlayerEnterZone( player, zoneID )
onPlayerExitZone( player, zoneID )



The GetWeaponName() needs improvement. GetWeaponName( "stormeus" ) should not return "Stubby Shotgun". 8)



Script extensions:
This might not be in scope of the squirrel plugin, but I'll suggest it here:
If possible, the server should look for a directory called "extensions" in the directory. The plugin should automatically dofile() every .nut in this directory, without the scripter calling it in their main script file.

The extensions directory could have further sub directory called libraries. NUT files inside <extensions/libraries/> should be automatically compiled before the script file specified in server.cfg. (highest priority)
NUT files inside <extensions/> should be executed after all the other files are compiled.

This would make sharing squirrel code much easier.



Appending/Attaching functions(hooking)
local myVehicleFunc = function( player, vehicle ) {}

myVehicleFunc.attach( "onPlayerEnterVehicle" )
Will attach the new function to VCMP's event. Hence, every time onPlayerEnterVehicle is called, myVehicleFunc is also called.
Together with script extensions idea suggested above, sending code to noobs will simply be drag-dropping files in folders.
Title: Re: Features you'd like to see.
Post by: . on Mar 24, 2016, 01:52 AM
Quote from: aXXo on Mar 24, 2016, 12:44 AMWill existing squirrel scripts be fully(or semi) compatible with the new plugin or everything will need a complete re-write?

If I had kept most of the implementation similar then it wouldn't be any different than the plugin we have already. What I've kept was mostly the naming style. Scripts will require a partial re-write. You'll most likely end up ditching most of the redundant code because the plugin tries to replace repetitive code.



Quote from: aXXo on Mar 24, 2016, 12:44 AMThe onPlayerMove() function is unusable, it should be removed. In most cases this function is used to detect when a player enters/exits an area. Could we have something that can be used without causing lag?

Example:
[CZone] CreateZone( [float] minX, [float] minY, [float] minZ, [float] maxX, [float] maxY, [float] maxZ )
It should accept null parameters to make it possible to create 2D or 1D zones.

CZone Properties:
.ID
.minX, .minY, .minZ,
.maxX, .maxY, .maxZ
.Remove()

onPlayerEnterZone( player, zoneID )
onPlayerExitZone( player, zoneID )

Yes this is something that I am currently thinking about. The onMove event is still exposed to the server because it has to be there in case anyone needs it. And trust me, there are situations where you need such callback.

As for the zone thing I can't say much right now because I haven't yet figured out the full implementation. Once I get something started I'll be sure to post it here or in the main thread.



Quote from: aXXo on Mar 24, 2016, 12:44 AMThe GetWeaponName() needs improvement. GetWeaponName( "stormeus" ) should not return "Stubby Shotgun". 8)
Well, that's probably because the function doesn't need the full name to retrieve a name. But I think you mean the GetWeaponID function, right? Because GetWeaponName takes an ID and returns the name. Whereas GetWeaponID takes a name and returns a weapon ID.

Let's have the following code:

local id = GetWeaponID("stormeus");
print( GetWeaponName(id) );

Let me explain why this happens. This is the code that does it:
        // [S]crewdriver
        // [S]ilenced Ingram
        // [S]niper Rifle
        // [S]PAS-12 Shotgun
        // [S]tubby Shotgun
        // [S]uicide
        case 's':
            // [Sc]rewdriver
            if (b == 'c') return SQMOD_WEAPON_SCREWDRIVER;
            // [Si]lenced Ingram
            else if (b == 'i') return SQMOD_WEAPON_INGRAM;
            // [Sn]iper Rifle
            else if (b == 'n') return SQMOD_WEAPON_SNIPER;
            // [SP]AS-12 Shotgun
            else if (b == 'p') return SQMOD_WEAPON_SPAS12;
            // [St]ubby Shotgun
            else if (b == 't') return SQMOD_WEAPON_STUBBY;
            // [Su]icide
            else if (b == 'u') return SQMOD_WEAPON_SUICIDE;
            // Default to unknwon
            else return SQMOD_UNKNOWN;

The function takes the first 3 significant characters from the name in 3 variables "a", "b", "c" and the the last character in another variable named "d"

First it sees that the first letter was 's' (the "a" variable) so then it looks for weapon candidates that begin with the letter 's'. Then it checks for the second character which is 't' and since none of the weapons that begin with the character 's' have a second character 't' except stubby. It assumes that's what you want.

In reality all you need to pas is "st" and you'd still get stubby. You could pass "stupid" and you'd still get stubby. Because only the first 2 characters are required for this weapon.

In cases where collisions could occur you probably need to specify more characters and sometimes even the last character is used to tell which weapon was requested. Example is the weapon names that have a similar name except the last character.

And the same applies for vehicle and skin names.



Quote from: aXXo on Mar 24, 2016, 12:44 AMScript extensions:
This might not be in scope of the squirrel plugin, but I'll suggest it here:
If possible, the server should look for a directory called "extensions" in the directory. The plugin should automatically dofile() every .nut in this directory, without the scripter calling it in their main script file.

The extensions directory could have further sub directory called libraries. NUT files inside <extensions/libraries/> should be automatically compiled before the script file specified in server.cfg. (highest priority)
NUT files inside <extensions/> should be executed after all the other files are compiled.

This would make sharing squirrel code much easier.

You can't really use this approach because of the order of execution. In your directory, scripts will be executed alphabetically.

Let's say that you have script A.nut which has:
print(Test.Value);
And then script B.nut which has:
enum Test
{
    Value = 1
};

The code from script A.nut needs to be compiled after the code from B.nut. But because they're compiled alphabetically, you're going to have an issue there.

What the plugin allows you to do is to specify as many scripts as you want in the configuration file:
[Scripts]
Source=addons/B.nut
Source=scripts/A.nut
#Source=utils/C.nut

They're executed in the order that you add them. The third one is commended out so it's never executed.



Quote from: aXXo on Mar 24, 2016, 12:44 AMAppending/Attaching functions(hooking)
local myVehicleFunc = function( player, vehicle ) {}

myVehicleFunc.attach( "onPlayerEnterVehicle" )
Will attach the new function to VCMP's event. Hence, every time onPlayerEnterVehicle is called, myVehicleFunc is also called.
Together with script extensions idea suggested above, sending code to noobs will simply be drag-dropping files in folders.

This feature is already implemented. Because the plugin was developed with OOP in mind. You can attach to events of a certain player/vehicle/pickup etc. And you'll receive events only from that player/vehicle/pickup etc.

And example will be added here soon.
Title: Re: Features you'd like to see.
Post by: KAKAN on Mar 24, 2016, 02:29 AM
I want something like this (http://forum.liberty-unleashed.co.uk/index.php/topic,1857.0), it's somewhat same to @aXXo's request.
Title: Re: Features you'd like to see.
Post by: . on Mar 24, 2016, 02:35 AM
Quote from: KAKAN on Mar 24, 2016, 02:29 AMI want something like this (http://forum.liberty-unleashed.co.uk/index.php/topic,1857.0), it's somewhat same to @aXXo's request.

Already planned to be a part of the standard plugin library. I was waiting to have at least a beta first to see how I should implement it. I'll post the example code in this post as soon as I have something working.
Title: Re: Features you'd like to see.
Post by: aXXo on Mar 24, 2016, 04:46 AM
Quote from: S.L.C on Mar 24, 2016, 01:52 AMIn reality all you need to pas is "st" and you'd still get stubby. You could pass "stupid" and you'd still get stubby. Because only the first 2 characters are required for this weapon.
It is a minor discrepancy, which occurs when a player is trying to send "steroids" but ends up getting a stubby to the face #ArgoDrugDealsGoneWrong.
Of course it is easy to fix with a small workaround and a simple check, but I still prefer if the GetWeaponID() checks if the argument passed in the function is a sub-string of the intended weapon before returning the weapon ID. It will take a performance hit, but will be more accurate.

Quote from: S.L.C on Mar 24, 2016, 01:52 AMYou can't really use this approach because of the order of execution. In your directory, scripts will be executed alphabetically.

Let's say that you have script A.nut which has:
print(Test.Value);
And then script B.nut which has:
enum Test
{
    Value = 1
};

The code from script A.nut needs to be compiled after the code from B.nut. But because they're compiled alphabetically, you're going to have an issue there.

What the plugin allows you to do is to specify as many scripts as you want in the configuration file:
[Scripts]
Source=addons/B.nut
Source=scripts/A.nut
#Source=utils/C.nut

They're executed in the order that you add them. The third one is commended out so it's never executed.

Yes, that's the reason I mentioned 2 directories:
Flow of compilation:
- Squirrel plugin loads.
- Squirrel plugin checks if the /extensions/ directory exists
- If found, Squirrel plugin checks if the /extensions/libraries/ directory exists.
- If found, all the .nut files inside /extensions/libraries/ should be compiled first.
- Then proceed with the normal flow and compile the files that are specified inside the configuration file, server.cfg
[Scripts]
Source=addons/B.nut
Source=scripts/A.nut
#Source=utils/C.nut
- Then compile all the .nut files inside the /extensions/ directory.

In your example, the B.nut which has the enum will be placed inside the /extensions/libraries/ directory. So, it is forced to be compiled before A.nut which is located in the /extensions/ directory.

The objective here is to make sharing code easy. It allows someone to release a snippet and organize the script files by packing them into the /extensions/ and /extensions/libraries directory. The author should take care that the stuff that needs pre-compilation(like enums or other function definitions) need to go inside /extensions/libraries/.

So, if someone needs to implement the release in their server, all they need to do is unzip the contents in their server directory and it should be ready to go. No need to edit server.cfg or add dofile() statements.
Title: Re: Features you'd like to see.
Post by: . on Mar 24, 2016, 04:52 AM
@aXXo Is it ok if I just implement the feature that KAKAN mentioned and allow the user to implement his own function that loads scripts from a directory? That way we can make the feature optional and be easy for the user to customize. For example, execute libraries that begin with "Critical..." first and those that begin with "Latent..." after. And those that begin with "Dev" only during development. Would have the same desired effect except it allows the user to customize.
Title: Re: Features you'd like to see.
Post by: Xmair on Mar 24, 2016, 09:57 AM
Make a CreateMovableGate like seby suggested once.
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 24, 2016, 12:14 PM
RestartServer();
player.AcceptKeys(int keyid, bool accept);
Title: Re: Features you'd like to see.
Post by: aXXo on Mar 24, 2016, 04:39 PM
Quote from: S.L.C on Mar 24, 2016, 04:52 AM@aXXo Is it ok if I just implement the feature that KAKAN mentioned and allow the user to implement his own function that loads scripts from a directory? That way we can make the feature optional and be easy for the user to customize. For example, execute libraries that begin with "Critical..." first and those that begin with "Latent..." after. And those that begin with "Dev" only during development. Would have the same desired effect except it allows the user to customize.
Yes, that would definitely work. But it won't be of much help to the type of users I'm trying to target here.
I prefer if people could just drag and drop .nut files in their folders and the plugin loads the scripts automatically. In kakan's suggestion, they would still need to use the GetFileList() function and dofile them in a loop in their main script.
The people I'm trying to target are guys who dont't even want to look at code or have a text editor. Guys who map objects, fetch coordinates or test custom object,weps,skins etc.
Guys who just want to host a private TDM script at their home PC and play with their friends to practice for an upcoming clan war.
It would also help with newbie scripters who ask "Where do I place this code?" or "this code does not work for me!" because they fail to incorporate copy-pasted stuff in their existing scripts.
Title: Re: Features you'd like to see.
Post by: KAKAN on Mar 24, 2016, 04:49 PM
This thing is kinda impossible, but I want a way to stream more than 3000 vehicles, objects etc( already in SAMP ).

And also, this thing is impossible via scripts, still then, can you give it a try? The things are NPC's. It's the most awaited feature in VCMP( I think ).( @Stormeus can add this functionality using the client. Currently, we can only use objects for NPC, but it would use a shit use of onPlayerMove in-case we want the NPC function correctly. So, I want you to add this :D )

And also, this is impossible too, but we want GUI. Make some functions for it then we may request @Stormeus to add GUI functionality in the client :)



Quote from: aXXo on Mar 24, 2016, 04:39 PMYes, that would definitely work. But it won't be of much help to the type of users I'm trying to target here.
I prefer if people could just drag and drop .nut files in their folders and the plugin loads the scripts automatically. In kakan's suggestion, they would still need to use the GetFileList() function and dofile them in a loop in their main script.
The people I'm trying to target are guys who dont't even want to look at code or have a text editor. Guys who map objects, fetch coordinates or test custom object,weps,skins etc.
Guys who just want to host a private TDM script at their home PC and play with their friends to practice for an upcoming clan war.
It would also help with newbie scripters who ask "Where do I place this code?" or "this code does not work for me!" because they fail to incorporate copy-pasted stuff in their existing scripts.
True dat. Hope SLC agrees here. Anyways, I wanted the GetFileList for some other purpose. Your suggestion is great too, helpful for newbies. We can create an INI file which would store that Boolean value. If it's true, then it would compile all the scripts present in that folder.( 'that'/path to the folder is to be defined in the INI file )



Quote from: NE.CrystalBlue on Mar 24, 2016, 12:14 PMRestartServer();
player.AcceptKeys(int keyid, bool accept);
What would RestartServer do? We already got ReloadScripts function. Just a bit editing to the onScriptLoad part would make it perfect.

player.AcceptKeys? need some more information on this.
Title: Re: Features you'd like to see.
Post by: . on Mar 24, 2016, 05:31 PM
Guys come on? MP3 Sounds? This is not something I can possibly implement.



NPC? Again, how could  possibly implement this on a scripting plugin? If the server had the options to create NPC, then I could probably write the AI system for them to help out the user. But nothing more than that.



GUI? Again, not something I could implement. I could implement wrappers and helpers to interact with it but nothing more than that. There are things that I simply cannot create. Not not that I wouldn't know to do it. I just simply can't do it without a messed up way of using it.



Restart Server? I could possibly create a function that retrieves the server process PID and then you can create your own restart utility which you can call with with the system() function.

system(format("restart.exe -p %d -e \"%s\"",
                GetServerProcessPID(),
                SqSysPath.With(SqSysPath.Current(), "server.exe").String));

Then your "restart.exe" kills the process with the specified PID and starts the one at the specified path. That utility can even be a python script or something simple.

@Stormeus Can you update ShutdownServer() to take an arbitrary integer as the return code? So that we can have our ways of communicating with the scripts that start our server?



Drag and Drop?

Again... I will never implement such thing directly. However, I could implement script callbacks that you can attach to and listen to the dropped files directly. That way, you can filter the files you want and execute or place them where you want. For example if you see you dropped a .png file you can copy that to the storage directory. If you see a .xml file was dropped and has the name "Objects" you can scan it for objects you want to create.

Like I said, I will never implement such features directly. Because they seem finical and particular to one person. I am trying to cover a broader range of scripters without imposing certain implementations on them.



CreateMovableGate? Again, this is something that could be implemented in script and seems particular to a certain person. Which is why I will create helpers to achieve this more easily but never enforce such thing on the scripter.



I hope I was quite clear that I don't want to impose features on scripters. I will only create helpers to help him create what he needs or someone else to create it and he just has to copy that script and and add a path in the config file. If that's too hard, then perhaps scripting is not for him.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 24, 2016, 05:58 PM
I feel that garages are un-professional. And to remove the door and build it yourself is a little bit on the lame side, compared to the garage sound being synced,

I prefer to use the default usage of the garages like in Liberty Unleashed.

Well since the front page of Liberty unleashed says

QuoteSome of you keen-eyed folks out there may have noticed another person in the developers list the last few days, that person being maxorator, which many of you know is the main developer of VC:MP so let me explain.

Some of you may know that the LU team have had a close relationship with VC:MP for quite some time. We have always been in contact with the developers exchanging ideas and we have created some unofficial addons for the mod (such as the hugely popular VCMP Squirrel server) and after some discussion we decided that it would be in everybodies best interests if we join forces :)   

What does this mean? Simply put it means that the VC:MP team have full access to the LU source and likewise with the LU team. We will all be working on the two projects simultaneously, implementing similar ideas and fixing the odd bugs here and there to ensure that the GTA community get two great multiplayer mods for two different games.

We all hope to be able to show the results of our collaboration soon, either in the form of an LU beta or a VC:MP one. But for now, give Maxorator, Falcon and Bakasan a big hearty welcome!
This should be simple to accomplish I hope, I hope to see this in a future update as well as possibly loading the original game icons in scripting alike LU
Title: Re: Features you'd like to see.
Post by: karan20000000000 on Mar 25, 2016, 06:54 AM
player.AcceptInput()
I suggested this to Stormeus before and I guess he has forgotten. In lame words its something like, server pressing the 't' key for the player and the player just starts typing.
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 25, 2016, 09:15 AM
@KAKAN
RestartServer is for pure restart of the server not the script.
AcceptKeys so if you bind a key, you can choose which players when pressed the key should trigger the function (sorry, too lazy to correct my English here)
@S.L.C
No .exe! I can already do it through batch and system("exit"); but I want to do it on linux
Title: Re: Features you'd like to see.
Post by: . on Mar 25, 2016, 10:13 AM
@karan20000000000 Already had that discussion with @Stormeus. I can't find the IRC logs but essentially it was like this. The server provided a function like CaptureInput(player_id) and when that function was called on a player all the player input would be streamed to a callback like onPlayerInput(player_id, character). Or a list of characters that is sent in groups to the server every few frames to avoid flooding the server with each individual character. The only key that cannot cannot be captured is the Esc key which can be used by the client to leave the input mode manually. Or automatically by the server with a function like ReleaseInput(player_id). Normally, there should also be callbacks when the user actually enters/leaves input mode since he can leave manually from this mode.

But either way, this is not something that can be implemented by me. So what we're talking here is just an idea.



@NE.CrystalBlue Come on man, restart? Are you serious? What kind of use does that thing have? That thing is implemented in the script that starts the server. Why do you think I asked Stormeus to allow custom exit/shutdown codes so that I can tell that script if I want to restart now,later or simply shut down.



Guys tbh these are some of the most selfish and finical (if it's the right word) features that one could ask. None of these will be useful when it comes to programming. The only thing that made sense was the get file list function which was already planed.

I asked you for good helpers and utilities that save you from repeating code like the built-in command system or other various functions which cannot be easily implemented via script and would help in therms of performance if they were built on the C++ side.

I didn't asked you to pour on me the things that the developers aren't implementing like GUI or NPC or other sh!t that I couldn't possibly implement on a god damn scripting plugin.

I didn't asked for useless features that feel like they've come from the mouth of the most laziest programmer and only "useful" to that person and no one else.

I was tempted to lock the topic because it had no purpose but then I changed my mind and decided to leave it open in the hope that someone actually understood what I meant.



This is what I meant with things that save you from repeating code:
(https://s11.postimg.org/3zgyojmz3/Untitled.jpg) (https://postimg.org/image/3zgyojmz3/)(https://s11.postimg.org/9ox78ut5b/Untitled2.jpg) (https://postimg.org/image/9ox78ut5b/)(https://s11.postimg.org/svaec19n3/Untitled3.png) (https://postimg.org/image/svaec19n3/)(https://s8.postimg.org/as6vthaap/Untitled.jpg) (https://postimg.org/image/as6vthaap/)
Title: Re: Features you'd like to see.
Post by: ysc3839 on Mar 25, 2016, 10:27 AM
I hope VCMP could open source. So we can do everything we want.
Title: Re: Features you'd like to see.
Post by: . on Mar 25, 2016, 10:43 AM
Quote from: ysc3839 on Mar 25, 2016, 10:27 AMI hope VCMP could open source. So we can do everything we want.

Not completely though! Maybe they could do like MTA did and make it in such a way that allows you to contribute to the client but the network code is closed source. That way people can't troll the f* out of servers. I mean, let's be honest. This is the home of VC:MP. Some of the worst butt-hurt people can be found here. And if you don't do as they please. You're f*ed.

Quote from: ysc3839 on Mar 25, 2016, 10:27 AMSo we can do everything we want.

That's the real scary thing. People always find a way to ruin things. ALWAYS
Title: Re: Features you'd like to see.
Post by: . on Mar 25, 2016, 12:40 PM
Quote from: vito on Mar 25, 2016, 12:29 PM
Quote from: S.L.C on Mar 24, 2016, 05:31 PMGuys come on? MP3 Sounds? This is not something I can possibly implement.
How about looping sounds at last?

Seriously man? Sounds again? If you know your sound is 1 second long. Then just create a routine which repeats that song every 1 second:
SqRoutine(
    /* environment -> */ getroottable()
    /* function to be called -> */, PlaySound,
    /* every 1 second -> */ 1000,
    /* forever... -> */ 0,
    /* arg 1: world id -> */ 0,
    /* arg 2: sound id -> */ 99999,
    /* arg 3: position -> */ Vector3(0.0, 0.0, 0.0)
).SetTag("RepeatSound99999");

// Later if I want to stop it
SqRoutine.FindByTag("RepeatSound99999").Terminate();

Why is this so hard :-\
Title: Re: Features you'd like to see.
Post by: . on Mar 25, 2016, 01:01 PM
@aXXo Here's that example I promised. You need to download the x32 bit server executable because I have't included it (obviously). And if you're wondering why is the DLL so big, is because it's a debug build.

This link expires in about 48 hours: http://expirebox.com/download/a69d4ac23eee91360d4c638fa0b9eab1.html (http://expirebox.com/download/a69d4ac23eee91360d4c638fa0b9eab1.html)

Basically, it's a simple dummy script that creates 2 pickups. One that can be picked up only by a certain player and one that can be picked up only by players of a certain level. It's a very simple script that tries to demonstrate that the plug-in works best when OOP is used.

Uses the internal player level which is nothing more than e simple integer that tells the level of that player. For example 0 = guest, 1 = user, 2 = frequent user, 3 = vip, 4 = moderator, 5 administrator etc. (you can also implement your own style of checking the authority level of a user)
You have a dummy command there to change your level.

Please note that this is affected by a bug(?) in the server and if you close the server with Ctr+C while spawned you'll get a crash. Dunno where this comes from because it happens in the official plugin as well. Although I'll try to look into it later to see why this happens.
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 25, 2016, 01:02 PM
What about the acceptkeys one? That'd add efficiency to keys
Title: Re: Features you'd like to see.
Post by: . on Mar 25, 2016, 01:02 PM
Quote from: NE.CrystalBlue on Mar 25, 2016, 01:02 PMWhat about the acceptkeys one? That'd add efficiency to keys

Can you elaborate?
Title: Re: Features you'd like to see.
Post by: aXXo on Mar 25, 2016, 11:10 PM
Looks great @S.L.C I . I guess you would need to spend a lot of time to document stuff in the wiki because this is very different from the usual coding practices in GTA-MP. Expect a lot of tears ;D

SqCmd.Create("getauth", "i", ["level"], 1, 1)What are the params? Command name, expected typeof args, expected argument description, min arguments, max arguments?



Will this plugin improve error handling?
In previous plugin the syntax error reported for a script which is loaded through dofile() statement was not very expressive, example:

Main.nut consists
Line 1: dofile("A.nut");

Assume there was a syntax error inside A.nut, at line 10.
The server would report the error in Main.nut Line 1: expression expected. It would be cool if it could locate the syntax error inside A.nut with accurate line and column number like it does with the Main script.

There are also some other errors which are not very expressive. I can't recall them exactly right now, but I'll try:
"No overlord match for this argument list found"...something like that occurs when a global function is missing the double semi-colon.
"Invalid parameter passed to function, found instance, expected table".....something like that maybe. I don't remember what or why this occurred, but I remember their was nothing wrong with parameters and it was a pain in the ass to locate the actual error.



Is it possible to have events for player's ping and FPS?
Something like player.onPingUpdate() and player.onFPSUpdate()

or SetPingLimit([int] ping), SetFPSThreshold([float] FPS) that would set the Ping/FPS limit on a server
and player.onPingBreach(), player.onFPSBreach() which will be called everytime a lagger surpasses those limits.
finicky level 8999 :)

Running a routine to calculate the average Ping and FPS of every connected player on the server might not be a good idea performance-wise.
Title: Re: Features you'd like to see.
Post by: . on Mar 25, 2016, 11:56 PM
@aXXo The command system was briefly explained in the main  topic (http://forum.vc-mp.org/?topic=292.msg13374#msg13374). Some of the features have changed though and some are new but the concept should be the same.

First argument is the command name.

Second are the command masks for each argument. At the moment it supports the following specifiers:


And you can combine them if one argument accepts multiple types of values.

Let's say that your command expects integer or float for the first argument, boolean for the second, uppercase string for the third and integer, float or boolean for the fourth. Then your mask should be like:
"if|b|u|ifb"
That way the command system knows how to parse the parameters and what values to expect.

Third argument is the argument names. You don't necessarily need to specify any but it helps a lot if you do. For example, let's say I'm creating a register command with 3 arguments. I'll probably specify ["name", "password", "email"].

The fourth and fifth argument is the minimum and maximum arguments that the command needs. When calling the command you only need the minimum and the rest is optional. You can have up to 16 arguments. I believe that's a fair number.

Because I specified argument names I can enable the .Associate option on the command which instead of giving me an array as the 'args' parameter it sends a table with each argument and the associated value that was extracted from the command.

Which is what this line does:
SqCmd.FindByName("getauth").Associate = true;NOTE: I'm searching for the command because I haven't saved it into a variable or something when I created it like:
cmd_getauth <- SqCmd.Create("getauth", "i", ["level"], 1, 1);
Which is why I'm able to refer to the argument by it's name in the callback function:
player.Authority = args.level;
Instead of:
player.Authority = args[0];
Another nice feature is that if I named the arguments I can use the .Generate() method to generate information about the command based on argument names and  types. This is done automatically when you create the command but can later on be called manually if you modify anything in the command.

Example:
print( SqCmd.Create("test", "is|f|b|g", ["nameorid", "angle", "enable", "message"], 3, 4).Info );
Output:
<nameorid:integer,string> <angle:float> <enable:boolean> <*message:...>NOTE: The '*' means the argument is optional.

Which makes it easy to make an info command that tells information about all other commands for example:
SqCmd.Create("cmdinfo", "s", ["name"], 1, 1).BindExec(this, function(player, args)
{
    // Find the requested command
    local cmd = SqCmd.FindByName(args.name);
    // Does it exist?
    if (cmd == null)
    {
        player.Message("This command doesn't exist");
    }
    else
    {
        player.Message("Command Info: %s %s", args.name, cmd.Info);
    }
});

SqCmd.FindByName("getauth").Associate = true;

And you no longer have to document your commands manually. And a bunch of other features like Failure Callback, Post-Execution Callback, Custom, Authority Callback, Help message (actual text by you telling what the command does), Custom error handling and much more.

Not to mention that you remove a lot of the useless Squirrel code required to extract the arguments which make commands much faster and safer.



Quote from: aXXo on Mar 25, 2016, 11:10 PMWill this plugin improve error handling?
In previous plugin the syntax error reported for a script which is loaded through dofile() statement was not very expressive...

I am still trying to improve that but I believe the generated message is much more clear and gives you a nice trace-back of the function calls back to the root where the first call originated. As well as their call-stack level and the variables that existed on those levels at the time of the exception.

(https://s29.postimg.org/cmmrapffr/Untitled.jpg)



Quote from: aXXo on Mar 25, 2016, 11:10 PMIs it possible to have events for player's ping and FPS?
Something like player.onPingUpdate() and player.onFPSUpdate()

or SetPingLimit([int] ping), SetFPSThreshold([float] FPS) that would set the Ping/FPS limit on a server
and player.onPingBreach(), player.onFPSBreach() which will be called everytime a lagger surpasses those limits.
finicky level 8999 :)

Running a routine to calculate the average Ping and FPS of every connected player on the server might not be a good idea performance-wise.

Those would have to be implemented by the developers. But since it's not a feature needed by too many people I'd say it won't be implemented any time soon. And if I were to implement it then I'd probably make a separate module for them because I don't want to enforce such feature on everyone. Since it adds more stress to calculate and like I said, it's not something critical or needed by most people.
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 26, 2016, 04:42 AM
Let's suppose you bind key lshift for ultra superman jump
BUT
you only want this to vip members. If every member calls the function = laggg!
so you do for all non vip members
player.AcceptKeys(LSHIFT, false);
tada lag finished
Title: Re: Features you'd like to see.
Post by: KAKAN on Mar 26, 2016, 09:40 AM
Quote from: NE.CrystalBlue on Mar 26, 2016, 04:42 AMLet's suppose you bind key lshift for ultra superman jump
BUT
you only want this to vip members. If every member calls the function = laggg!
so you do for all non vip members
player.AcceptKeys(LSHIFT, false);
tada lag finished
function onKeyDown( player, key ){
if( player.Level < 2 && vipkeys.find(key) != null ) return;
else{
//TADA!
}
}
vipkeys is an array, and you know what it should contain :)
Title: Re: Features you'd like to see.
Post by: KAKAN on Mar 26, 2016, 09:42 AM
Quote from: S.L.C on Mar 25, 2016, 11:56 PMThose would have to be implemented by the developers. But since it's not a feature needed by too many people I'd say it won't be implemented any time soon. And if I were to implement it then I'd probably make a separate module for them because I don't want to enforce such feature on everyone. Since it adds more stress to calculate and like I said, it's not something critical or needed by most people.
Though, I want the onFPSUpdate/Change thingy :D I want to set a FPS limit too.
onPingChange is also a good thing. It can be done by the server using a 0 ms timer, but it would lag the server out too!
Title: Re: Features you'd like to see.
Post by: . on Mar 26, 2016, 11:41 AM
@KAKAN Humor me and tell me what would you do with the FPS/PING update callbacks? What would you plan on using them. Just give me a good reason because I fail to see one.



@NE.CrystalBlue Isn't that the same thing we've discussed already? And like I said, it's not something that can be implemented by me. I can implement it. But it would still use the current keybinds which means I'd still receive key events from all players. You just won't receive them in scripts.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 26, 2016, 01:20 PM
I personally do not understand what would be the purpose of having FPS/PING update callbacks. As FPS can be detected just like Ping and ping is simple to update. What is the purpose of having an fps/ping update callback?

This code can be modified and repeated for FPS
What would be the usage of the callbacks?

       
ping_kick <- array(GetMaxPlayers(), 0);

function Second() {
 
  for (local i=0;i<GetMaxPlayers();i++) {
    local player = FindPlayer(i);
   
    if (player) {
      if (player.ID == i) {       
        //ping
        if (player.Ping > 600 && admin[i] == 0) {
          ping_kick[i]++;
          if (ping_kick[i] > 30) {
            Message("[#ff0000]"+player.Name+" has been kicked for high ping ("+player.Ping+")");
            KickPlayer(player); 
          }
        }
        else {
          ping_kick[i] = 0;
        }
        //ping

function onScriptLoad() {
   
  NewTimer( "Minute", 60000, 0);
  NewTimer( "Second", 1000, 0);

This would be the max usage I would ever want Fps and ping to do. please explain the usage of the callbacks ???
Title: Re: Features you'd like to see.
Post by: Xmair on Mar 26, 2016, 02:15 PM
What the fuck is that.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 26, 2016, 02:24 PM
Quote from: Xmair on Mar 26, 2016, 02:15 PMWhat the fuck is that.
Getting the average ping for a given amount of time.
Title: Re: Features you'd like to see.
Post by: . on Mar 26, 2016, 02:49 PM
@Mr_Motley The plugin gives you the option to retrieve a list of active players (or other entities) as an array. So you don't have to process unconnected players or entities that don't exist.

SqRoutine.Create(this, function() {
    local players = SqPlayer.FindActive();

    foreach (player in players)
    {
        if (player.Authority >= 6 /* <- fictional number*/)
        {
            continue; // This is an admin
        }
        else if (player.Ping > 600)
        {
            player.Message("Your ping is higher than 600");
            player.Kick();
        }
    }
}).SetTag("LatencyCheck");
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 26, 2016, 03:17 PM
Just remember I don't use other scripting methods as i use ini. i don't understand the method you posted.

does that method above kick instant ping spikes? or will it get the average ping for a given amount of time?
Title: Re: Features you'd like to see.
Post by: Stormeus on Mar 26, 2016, 03:26 PM
Quote from: Mr_Motley on Mar 26, 2016, 02:24 PM
Quote from: Xmair on Mar 26, 2016, 02:15 PMWhat the fuck is that.
Getting the average ping for a given amount of time.

I wouldn't call it averaging, I'd call it a high ping threshold.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 26, 2016, 03:37 PM
Quote from: Stormeus on Mar 26, 2016, 03:26 PM
Quote from: Mr_Motley on Mar 26, 2016, 02:24 PM
Quote from: Xmair on Mar 26, 2016, 02:15 PMWhat the fuck is that.
Getting the average ping for a given amount of time.

I wouldn't call it averaging, I'd call it a high ping threshold.

Your right @Stormeus I was just trying to explain it simple,. At the end I set  the ping Threshold value to 0. also you have about > 30 to get your ping back to a normal value, rather than a instant kick, I took ping spikes in consideration when making this as I noticed a lot of VC:MP server owners have not done this and will kick instant ping spikes, which is unfair to the player base
Title: Re: Features you'd like to see.
Post by: Xmair on Mar 26, 2016, 03:50 PM
Good luck kicking players with 600  ping then.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 26, 2016, 04:05 PM
it will kick anything 600 and up :P

also I'm on American soil so its possible the players ping may be crazy. as player play from Germany to all over, or if I were to get Drakes Free host the host is in France so players ping may be kinda wack just considerations
Title: Re: Features you'd like to see.
Post by: aXXo on Mar 27, 2016, 09:31 AM
Off-topic: I'm curious about the server performance, when calculating the average ping and average FPS of all connected players on the server through a timer/routine.

Particularly talking about Vicewar, where we easily get 40+ (frustrated) players. It is important to implement a ping limit and a FPS threshold to the server while making sure the scripts have no lag. Does a third party plugin in C++ ensure that such a process has no impact on server performance?
Title: Re: Features you'd like to see.
Post by: Stormeus on Mar 27, 2016, 12:05 PM
C/C++ will always be faster, but calculating averages is basic floating-point additions and divisions. Squirrel doesn't (or at least shouldn't) have a significant amount of overhead for iterating over arrays and calculating averages.
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 29, 2016, 05:25 PM
"I'm on American soil"
Love that line :P
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 29, 2016, 05:34 PM
Quote from: S.L.C on Mar 26, 2016, 11:41 AM@KAKAN Humor me and tell me what would you do with the FPS/PING update callbacks? What would you plan on using them. Just give me a good reason because I fail to see one.



@NE.CrystalBlue Isn't that the same thing we've discussed already? And like I said, it's not something that can be implemented by me. I can implement it. But it would still use the current keybinds which means I'd still receive key events from all players. You just won't receive them in scripts.
C++ is faster than script IO and simple conditions shouldn't be noticable in very large amounts like the fire button with 30 players when using C++.
Title: Re: Features you'd like to see.
Post by: Striker on Mar 30, 2016, 01:34 AM
Quote from: S.L.C on Mar 23, 2016, 09:00 PMI'd like to ask people what features do you think are missing from the official Squirrel plug-in so that I could implement them in the one that I'm working on.

Speak your mind here about situations where certain things would've made your life easier and you think would make sense to have in a scripting plug-in.

Keep in mind that your suggestion is open for debate. And if that feature already exists I'll give you an example of it. And if it's planed for later then I'll discuss the way I thought to implement it.

I'll be waiting for your feedback.


NOTE: This plug-in might be obsolete in near future since the devs are working on something else. This is for those that want to stick with Squirrel because that's what they've got used to.
Can't we do smoke/cigarette like we use to do in the game when we type a cheat?
Title: Re: Features you'd like to see.
Post by: aXXo on Mar 30, 2016, 08:22 PM
Quote from: Striker on Mar 30, 2016, 01:34 AMCan't we do smoke/cigarette like we use to do in the game when we type a cheat?
No. Smoking causes lung cancer.
Title: Re: Features you'd like to see.
Post by: Mötley on Mar 31, 2016, 12:02 AM
^ Yeah I was told that many times :P( it's a bad habit but someone has to have it ;) ) , You could do a lot with smoking, if distance traveled in smoking  == [100.000] freeze player set animation to ground, get ticket count stand back up (unless paramedic arrives)

As well as buying cigarettes at stores etc lazy explanation

some servers may add a pack of cigarettes in the weapon hud
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Mar 31, 2016, 08:54 AM
Why will someone buy a cigarette then? It's not real life, they cant be addicted in a game :P
Title: Re: Features you'd like to see.
Post by: . on Mar 31, 2016, 08:59 AM
If you people can't stay on topic then get the f* out of here!
Title: Re: Features you'd like to see. Players
Post by: Coolkid on Mar 31, 2016, 11:05 AM
Stop talking about cigarette  here there are kids like kakan who are 12 what impression will go in them

Do you know every year more than a million people leave cigarette do U know how????

By dying
Title: Re: Features you'd like to see.
Post by: KAKAN on Mar 31, 2016, 01:18 PM
Quote from: Coolkid on Mar 31, 2016, 11:05 AMStop talking about cigarette  here there are kids like kakan who are 12 what impression will go in them
What's your age?
Very few peoples are 18+ here xd
Title: Re: Features you'd like to see.
Post by: Stormeus on Mar 31, 2016, 10:36 PM
Quote from: Coolkid on Mar 31, 2016, 11:05 AMStop talking about cigarette  here there are kids like kakan who are 12 what impression will go in them

This is a mod for a game rated for mature audiences in which people murder each other with guns, can hire prostitutes, and routinely drop vulgar language in dialogue. I don't understand why people playing VC:MP try to take this moral high ground and do stuff like ban the word "fuck" in servers when the game itself is the complete opposite of clean.
Title: Re: Features you'd like to see.
Post by: Xmair on Apr 07, 2016, 02:20 PM
Can you make something like 'onPlayerShootAnotherPlayer( player, player2 , invehicleplayer1, invehicleplayer2 )'?
Title: Re: Features you'd like to see.
Post by: . on Apr 07, 2016, 09:09 PM
Quote from: Xmair on Apr 07, 2016, 02:20 PMCan you make something like 'onPlayerShootAnotherPlayer( player, player2 , invehicleplayer1, invehicleplayer2 )'?

Probably not. Because it can easily be implemented via script. And looks particular to a very small group of people. Which means I'd be adding useless processing for the rest of scripters.
Title: Re: Features you'd like to see.
Post by: Thijn on Apr 08, 2016, 05:41 AM
Quote from: S.L.C on Apr 07, 2016, 09:09 PM
Quote from: Xmair on Apr 07, 2016, 02:20 PMCan you make something like 'onPlayerShootAnotherPlayer( player, player2 , invehicleplayer1, invehicleplayer2 )'?

Probably not. Because it can easily be implemented via script. And looks particular to a very small group of people. Which means I'd be adding useless processing for the rest of scripters.
I don't think this can be implemented at all. What event would you use for this?
Title: Re: Features you'd like to see.
Post by: KAKAN on Apr 08, 2016, 06:16 AM
Quote from: Thijn on Apr 08, 2016, 05:41 AM
Quote from: S.L.C on Apr 07, 2016, 09:09 PM
Quote from: Xmair on Apr 07, 2016, 02:20 PMCan you make something like 'onPlayerShootAnotherPlayer( player, player2 , invehicleplayer1, invehicleplayer2 )'?

Probably not. Because it can easily be implemented via script. And looks particular to a very small group of people. Which means I'd be adding useless processing for the rest of scripters.
I don't think this can be implemented at all. What event would you use for this?
Also, it can't be implemented using a plugin. Because the server doesn't know who is killing whom, but the client does.
Title: Re: Features you'd like to see.
Post by: DizzasTeR on Apr 08, 2016, 06:22 AM
The event name is given wrong though, its something like onPlayerReceiveDamage( player, damageFrom, amount )

The player is the instance of player who got damaged, damageFrom can either be another player's weapon, fall or drowning etc. Amount is how much health is lost.

This can only be done by developers.
Title: Re: Features you'd like to see.
Post by: karan20000000000 on Apr 08, 2016, 06:30 AM
Probably player.AimDir would do the work but I don't know how much of memory it would consume checking whether out of all players, the opponent is in direction and whether the bullets injured the opponent everytime a player shoots. Moreover it wouldn't work for rockets.
Title: Re: Features you'd like to see.
Post by: NicusorN5 on Apr 10, 2016, 09:44 AM
I will like to see NPCs. :P
Title: Re: Features you'd like to see.
Post by: . on Apr 10, 2016, 11:16 AM
Quote from: NicusorN5 on Apr 10, 2016, 09:44 AMI will like to see NPCs. :P

Read the topic! This is not about features that VCMP should have.
Title: Re: Features you'd like to see.
Post by: . on Apr 10, 2016, 01:20 PM
For those that keep insisting on VCMP implementing NPC, please consider the following reasons why they're not implemented.

Quote23:56:47 <SLC> everyone on the forum insists on VCMP having NPCs implemented. but I keep thinking. will they know to implement an AI system to actually use those NPC? :/
23:59:12 <Kirollos> xDD
23:57:33 <SLC> because in my short programming experience. AI (Artificial Inteligence) systems are not an easy task
23:57:59 <SLC> and these people can't even do a proper print(value); without breaking something
23:59:41 <SLC> I'm guessing that their idea of NPC is that you create something like an object and call a function EnterInVehicleMoron() to simply make a character sit in a vehicle like a retard doing nothing
00:00:55 <SLC> or put him like a pillar inside some weapon shop to look at you constantly hoping you won't steal weapons
00:03:02 <SLC> I'm gonna laugh so hard if the devs decide to implement it and then see how no one will use it to it's full potential because... well... you know... "pro" scripters
00:05:31 <Kirollos> yeah ofc, vc-mp is full of pro scripters
00:05:05 <SLC> I keep trying to think of ways where the average VCMP scripter could use NPC and trying to keep it to a realistic level of their knowledge
00:06:17 <SLC> so far I got the vehicle thing and ammo salesman
00:06:29 <SLC> because they both do nothing
Title: Re: Features you'd like to see.
Post by: . on Apr 18, 2016, 05:01 PM
Quote from: vito on Apr 18, 2016, 04:58 PMoptions
disable sprint for all
disable jumping for all

How dafuq am I supposed to do that man? Use your brain for a second or two, if you have any. How am I supposed to do that?
Title: Re: Features you'd like to see.
Post by: Xmair on Apr 18, 2016, 05:16 PM
A better anticheat.
Title: Re: Features you'd like to see.
Post by: . on Apr 18, 2016, 05:29 PM
Quote from: Xmair on Apr 18, 2016, 05:16 PMA better anticheat.

Yeah, I actually have the best anti-cheat implemented. Basically, no one can use aim-bots, wall-hacks, speed-hacks or any kind of hacks using this anti-cheat system. I just tested it a few hours ago to see how well it performs. @Murdock can confirm it's legit. None of us could any kind cheats whatsoever. It even fixes all of the VC:MP bugs and glitches that can be used to cheat. It uses the server to inject itself into the client and then takes over the client and blocks all forms of cheating.

Even though it's finished. I'll probably release it sometime next year (Q4) because I want to be able to use cheats a little longer.
Title: Re: Features you'd like to see.
Post by: Thijn on Apr 18, 2016, 05:55 PM
Quote from: vito on Apr 18, 2016, 05:42 PM
Quote from: . on Apr 18, 2016, 05:01 PM
Quote from: vito on Apr 18, 2016, 04:58 PMoptions
disable sprint for all
disable jumping for all

How dafuq am I supposed to do that man? Use your brain for a second or two, if you have any. How am I supposed to do that?
Is it was off-topic?
S.L.C. is making a scripting plugin. Things you can't currently do with the server can't magically work on this plugin. S.L.C. is limited by the plugin api provided by the server.
Title: Re: Features you'd like to see.
Post by: Xmair on Apr 19, 2016, 05:56 PM
CPlayer.Gravity?
Title: Re: Features you'd like to see.
Post by: Thijn on Apr 19, 2016, 05:59 PM
Quote from: Xmair on Apr 19, 2016, 05:56 PMCPlayer.Gravity?
Not possible.

Check this file for every possible API call you can make to the server. That's what SLC has to deal with and is limited by:
https://bitbucket.org/stormeus/0.4-squirrel/src/43456fd5de04aa3a2e970c89938c790540c90c42/VCMP.h?fileviewer=file-view-default
Title: Re: Features you'd like to see.
Post by: vcmptr on Apr 19, 2016, 09:39 PM
HTTP page downloader. Like this (http://php.net/manual/en/function.file-get-contents.php). I've tried with sockets but I could not.
Title: Re: Features you'd like to see.
Post by: . on Apr 19, 2016, 09:52 PM
Quote from: vcmptr on Apr 19, 2016, 09:39 PMHTTP page downloader. Like this (http://php.net/manual/en/function.file-get-contents.php). I've tried with sockets but I could not.

I have that planned for a module that wraps the Mongoose (https://github.com/cesanta/mongoose) library. It's still a work in progress but when finished, it should provide a fully functional HTTP server/client with support for web-sockets for real time live maps (no more jsoon files). As well as TCP and UDP communications.

However, I need to implement that in a way that doesn't affect the frame-rate.Which means I'd have to run it into a separate thread. And since Squirrel is not a thread safe language. I'm not sure how to achieve that without creating a bottleneck from all the context switching to communicate between threads. Which means that this module is still pending for now.

And I can't see any safe and decent way of going with this so I might spend a while until I come up with something.
Title: Re: Features you'd like to see.
Post by: Zihad-VCMP on Apr 22, 2016, 06:22 AM
A better server files downloader -...- It gets really booooooring if the server has lots of files and a bit large files like 5+ MB. So a better downloader that can download using Computer's bestest speed would be better. Like downloading it at at least 256 kbps....
Title: Re: Features you'd like to see.
Post by: KAKAN on Apr 22, 2016, 06:32 AM
Quote from: Zihad-VCMP on Apr 22, 2016, 06:22 AMA better server files downloader -...- It gets really booooooring if the server has lots of files and a bit large files like 5+ MB. So a better downloader that can download using Computer's bestest speed would be better. Like downloading it at at least 256 kbps....
Quote from: Thijn on Apr 19, 2016, 05:59 PM
Quote from: Xmair on Apr 19, 2016, 05:56 PMCPlayer.Gravity?
Not possible.

Check this file for every possible API call you can make to the server. That's what SLC has to deal with and is limited by:
https://bitbucket.org/stormeus/0.4-squirrel/src/43456fd5de04aa3a2e970c89938c790540c90c42/VCMP.h?fileviewer=file-view-default
Read before posting :D
Simple answer: Not possible :D
Title: Re: Features you'd like to see.
Post by: . on Apr 22, 2016, 07:33 AM
Quote from: KAKAN on Apr 22, 2016, 06:32 AMSimple answer: Not possible :D

It is possible. Just not on my end.
Title: Re: Features you'd like to see.
Post by: KAKAN on Apr 22, 2016, 08:47 AM
Quote from: . on Apr 22, 2016, 07:33 AM
Quote from: KAKAN on Apr 22, 2016, 06:32 AMSimple answer: Not possible :D

It is possible. Just not on my end.
You're wrong. It's not possible. Stormeus is never going to do it due to his laziness in doing stuff :D
Title: Re: Features you'd like to see.
Post by: . on Apr 22, 2016, 08:52 AM
Quote from: KAKAN on Apr 22, 2016, 08:47 AMStormeus is never going to do it due to his laziness in doing stuff :D

Pay him the amount of money that any average programmer would charge for such a job and I can guarantee you that he will implement it.

But then again, I don't see you implementing anything! So why complain that he isn't?
Title: Re: Features you'd like to see.
Post by: Stormeus on Apr 22, 2016, 12:58 PM
Quote from: KAKAN on Apr 22, 2016, 08:47 AM
Quote from: . on Apr 22, 2016, 07:33 AM
Quote from: KAKAN on Apr 22, 2016, 06:32 AMSimple answer: Not possible :D

It is possible. Just not on my end.
You're wrong. It's not possible. Stormeus is never going to do it due to his laziness in doing stuff :D

ok
Title: Re: Features you'd like to see.
Post by: EK.IceFlake on Apr 22, 2016, 02:24 PM
Quote from: . on Apr 18, 2016, 05:29 PM
Quote from: Xmair on Apr 18, 2016, 05:16 PMA better anticheat.

Yeah, I actually have the best anti-cheat implemented. Basically, no one can use aim-bots, wall-hacks, speed-hacks or any kind of hacks using this anti-cheat system. I just tested it a few hours ago to see how well it performs. @Murdock can confirm it's legit. None of us could any kind cheats whatsoever. It even fixes all of the VC:MP bugs and glitches that can be used to cheat. It uses the server to inject itself into the client and then takes over the client and blocks all forms of cheating.

Even though it's finished. I'll probably release it sometime next year (Q4) because I want to be able to use cheats a little longer.
"to inject itself into the client"
So you need on client side, like who the hell would download quitcheating.exe
Title: Re: Features you'd like to see.
Post by: . on Apr 22, 2016, 04:20 PM
Apparently some people can't read sarcasm. @Thijn please clean up some of the posts in this topic because people seem to think the last post is always the actual topic.
Title: Re: Features you'd like to see.
Post by: ysc3839 on Apr 22, 2016, 04:45 PM
Quote from: vito on Apr 22, 2016, 04:07 PMAny anticheat can be hacked, even in gta v
i don't think GTA:V have a good anti-cheat system, but you should see Tencent's TenProtect, which uses system driver to protect the games. But hackers still can use hacks.
Title: Re: Features you'd like to see.
Post by: KAKAN on Jun 09, 2016, 04:58 AM
*BUMP*
MongoDB, JSON, a better sockets/http implementation
Title: Re: Features you'd like to see.
Post by: Xmair on Jun 09, 2016, 05:35 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
<~SLC> how's this for a JSON module done in a couple hours :P http://s33.postimg.org/cel840csv/Untitled.png
Title: Re: Features you'd like to see.
Post by: Thijn on Jun 09, 2016, 05:54 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
Those can all be made by anyone with some knowledge of C++/C. This topic is mainly about features the devs need to add to VC:MP.
Not new plugins.
Title: Re: Features you'd like to see.
Post by: KAKAN on Jun 09, 2016, 07:03 AM
Quote from: Thijn on Jun 09, 2016, 05:54 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
Those can all be made by anyone with some knowledge of C++/C. This topic is mainly about features the devs need to add to VC:MP.
Not new plugins.
Very few of us here knows much about C++, so it's better if someone does it for me. I want the MongoDB, because it was mainly made for the simple queries, which are used by most of the scripters of VCMP.
Quote from: Xmair on Jun 09, 2016, 05:35 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
<~SLC> how's this for a JSON module done in a couple hours :P http://s33.postimg.org/cel840csv/Untitled.png
Looks like my BNC isn't working well, lets see if I can fix it.
Title: Re: Features you'd like to see.
Post by: ysc3839 on Jun 09, 2016, 08:50 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
JSON: https://github.com/electricimp/JSONParser
Title: Re: Features you'd like to see.
Post by: KAKAN on Jun 09, 2016, 09:29 AM
Quote from: ysc3839 on Jun 09, 2016, 08:50 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
JSON: https://github.com/electricimp/JSONParser
Thanks a lot!
https://github.com/electricimp/Promise
That's another thing which I loved in JS and was going to make one for myself, but got it there :)
:edit: Wow, that's f*cking awesome:- https://github.com/electricimp/imp-build-api-v4
Title: Re: Features you'd like to see.
Post by: ysc3839 on Jun 09, 2016, 09:35 AM
Quote from: KAKAN on Jun 09, 2016, 09:29 AM
Quote from: ysc3839 on Jun 09, 2016, 08:50 AM
Quote from: KAKAN on Jun 09, 2016, 04:58 AM*BUMP*
MongoDB, JSON, a better sockets/http implementation
JSON: https://github.com/electricimp/JSONParser
Thanks a lot!
https://github.com/electricimp/Promise
That's another thing which I loved in JS and was going to make one for myself, but got it there :)
:edit: Wow, that's f*cking awesome:- https://github.com/electricimp/imp-build-api-v4
What is this?