Main Menu
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

Topics - Vortrex

#1
Scripting Releases / Vortrex's Essential Resources
August 16, 2022, 07:15:38 PM
Some basic resources for anybody to use.

Source: https://github.com/VortrexFTW/v-essentials

These scripts are modular and publicly available for anybody to use. Description of each is available in the readme file
#2
Module Releases / Terminal Bell Module
May 18, 2022, 10:23:42 PM
This is a simple terminal bell module for those who want to use it for their server. Most of the functions have been lightly tested, but if you run into any issues please report them on the GitHub issues page for the repository.

Download:
https://github.com/VortrexFTW/mod_bell/releases

Instructions:
Place into your server's "modules" folder and put "<module src="module_folder_name/module_file_name" />" into the modules section of your server XML. Be sure to include the folder your modules are stored in (it's relative to the main server directory) and do not include a file extension.
<modules>
    <module src="modules/mod_bell" />
</modules

JavaScript Example:
if(chatMessage.indexOf("!admin") != -1) {
module.bell.ring();
}

Available Functions:
bool = module.bell.ring(void);
#3
Module Releases / SMTP Module
May 18, 2022, 10:21:41 PM
This is a simple SMTP module for those who want to use it for their server. Most of the functions have been lightly tested, but if you run into any issues please report them on the GitHub issues page for the repository.

Download:
https://github.com/VortrexFTW/mod_smtp/releases

Instructions:
Place into your server's "modules" folder and put "<module src="<I>module_folder_name/module_file_name</I>" />" into the modules section of your server XML. Be sure to include the folder your modules are stored in (it's relative to the main server directory) and do **not** include a file extension.
<modules>
    <module src="modules/mod_smtp" />
</modules

JavaScript Example:
module.smtp.send("smtp.yourmailserver.com, 465, true, "yourusername", "yourpassword", "[email protected]", "Firstname Lastname", "Testing", "Testing the email module!", "[email protected]", "Firstname Lastname");
Available Functions:
void module.smtp.send(string host, int port, bool useTLS, string smtpUser, string smtpPassword, string toEmail string toName, string subject, string body, string fromEmail, string fromName);
#4
Scripting Releases / [JS] Server name changer
October 22, 2021, 03:11:03 PM
Script was moved to my essentials resource page

https://github.com/VortrexFTW/v-essentials/tree/master/v-servernames





#5
Announcements / Moderator Application
April 13, 2021, 04:52:42 AM
Name:
Discord (including #ID):
Timezone (GMT):
Email:
Why do you want to be a moderator?

Do you have any experience with scripting?
If yes, give a brief description of your history in scripting, and what languages you've used:

Have you ever been or are you currently a tester, contributor, moderator, developer, VIP, or any other special role in another GTA multiplayer mod?
If yes, please explain which multiplayer mod and what roles:
#6
Scripting Releases / [JS] SUMO/Derby Gamemode
August 31, 2020, 08:02:16 PM
Here's a simple SUMO/Derby gamemode.

Works for any game, but maps are only included for GTA III and GTA San Andreas.



The goal is to be the last player alive! Use your vehicle and knock off or destroy all your opponents vehicles to win!

Bots spawn at match start to fill empty slots, and will attempt to block your vehicle or ram you.



Source:  https://github.com/VortrexFTW/gtac_sumo



This source is free for anybody to use as they see fit. You can freely modify, copy, and redistribute it.

Credits aren't required, but are greatly appreciated.
#7
Module Releases / GeoIP Module
March 14, 2020, 10:55:56 AM
Here is a GeoIP module for those who want to use it for their server.

Download: https://github.com/VortrexFTW/mod_geoip/releases

First you'll need an MMDB database file from MaxMind. You'll need to make an account, receive a license key, and then download the database file (it's free). After you have the database file, copy/upload to your server, and use the name for it in the file arg for the GeoIP functions below. Directory starts with the main server folder, but relative paths are supported.

Place into your server's "modules" folder and put "<module src="mod_geoip" />" into the modules section of your server XML. Be sure to include the name of your modules folder (it's relative to the main server directory) and do **not** include an extension. It should look similar to this:
<modules>
    <module src="modules/mod_geoip" />
</modules>


JavaScript Example
addEventHandler("OnPlayerJoined", function(event, client) {
let countryName = module.geoip.getCountryName("geoip-city.mmdb", client.ip);
console.log(client.name + " connected from " + countryName);
});

Lua Example
addEventHandler("OnPlayerJoined", function(event, client)
local countryISO = module.geoip.getCountryName("geoip-city.mmdb", client:ip)
print(client:name .. " connected from " .. countryName)
end)


All functions below return strings.
// Country info
module.geoip.getCountryName(string dbFile, string ipAddress)
module.geoip.getCountryISO(string dbFile, string ipAddress)

// Continent info
module.geoip.getContinentName(string dbFile, string ipAddress)
module.geoip.getContinentCode(string dbFile, string ipAddress)

// For states, provinces, etc
module.geoip.getSubdivisionName(string dbFile, string ipAddress)
module.geoip.getSubdivisionISO(string dbFile, string ipAddress)

// Misc
module.geoip.getCityName(string dbFile, string ipAddress)
module.geoip.getPostalCode(string dbFile, string ipAddress)
#8
Archive / [ADDED] Server properties
February 21, 2020, 04:00:36 PM
We could use some more server properties. I know some have to be read-only, but it'd be nice to see as many as possible being writable. Some ideas:server.password
server.rconPassword
server.rcon
server.listed
server.httpPort
server.minClientVersion
server.processInterval
server.syncInterval
server.syncMethod
server.duplicateNames
server.compressPackets
server.packetCompressionLevel

server.pickupStreamInDistance
server.pickupStreamOutDistance
server.streamInDistance
server.streamOutDistance

server.setCVar(name, value)
server.getCVar(name, val)
#9
General Chat / Wiki Page Templates
January 24, 2020, 02:22:11 PM
The GTA Connected wiki provides several templates to make adding and editing pages easier. Below are a list of commonly used templates with descriptions of accepted values and information. Any field that is indicated as required must be provided or the wiki page will show that documentation for it wasn't added. Please don't leave any pages you add or edit with blank or missing required template values.



[/hr]



[/td][td]no[/td][/tr]
[tr][td]name[/td][td]
the property name ... this is only the name, don't use quotes or include the parent object
[/td][td]no[/td][/tr]
[tr][td]returnTypes[/td][td]
what the property returns as a type (int, string, etc)
[/td][td]no[/td][/tr]
[tr][td]readonly[/td][td]
Boolean indicating whether or not this property's value can be set
[/td][td]no[/td][/tr]
[tr][td]usage[/td][td]
Explain what the property does if it's value is set, and what is returned if the value is only read
[/td][td]no[/td][/tr]
[tr][td]returnInfo[/td][td]
Explain what the property returns if used as a getter
[/td][td]no[/td][/tr]
[tr][td]notes[/td][td]
Any extra information that scripters should be aware of goes here.
[/td][td]yes[/td][/tr]
[/table][/spoiler]


[/hr]



[/td][td]no[/td][/tr]
[tr][td]name[/td][td]
The method name ... this is only the name, don't use quotes or parentheses
[/td][td]no[/td][/tr]
[tr][td]returnTypes[/td][td]
What the method returns as a type (int, string, etc)
[/td][td]no[/td][/tr]
[tr][td]usage[/td][td]
explain what the method does when used
[/td][td]no[/td][/tr]
[tr][td]returnInfo[/td][td]
explain what the method returns. Use void if it doesn't return anything
[/td][td]no[/td][/tr]
[tr][td]notes[/td][td]
Any extra information that scripters should be aware of goes here.
[/td][td]yes[/td][/tr]
[tr][td]parameter1[/td][td]
first argument as [type name description]. Example: "string dataName The string name of the data."
[/td][td]yes[/td][/tr]
[tr][td]parameter2[/td][td]
Same as parameter1 but with the second parameter's information
[/td][td]yes[/td][/tr]
[tr][td]parameter3[/td][td]
Same as parameter1 but with the third parameter's information
[/td][td]yes[/td][/tr]
[/table][/spoiler]
#10
General Chat / Wiki Editing
January 24, 2020, 06:27:27 AM
On January 24, 2020 the GTAC team has decided to make the wiki editable to approved users so that the community can submit examples and documentation for scripting. The wiki has templates available to make adding a page easy. More info available for these on this forum topic.

In order to maintain a clean and accurate wiki, the following rules have been created:
  • Pages created must be named for the top-most level of inheritance (example: ped.id would be entity.id)
  • Do not create pages for functions/properties/etc that don't exist.
  • No spam or irrelevant/unrelated information
  • Arguments must be listed with accurate types and easy to understand names
  • No discriminatory information or insult

Inheritance heirarchy and variable types can be found   here

Discriminatory information as listed above includes (but is not limited to) any derogatory or negative mention of the basis of race, color, religion, creed, gender, gender expression, age, national origin, ancestry, disability, marital status, sexual orientation, or military status.
#11
Scripting Help / Which language should you use?
November 17, 2019, 12:01:06 AM
I've been asked this question several times in the discord so I decided to just write a topic to save time having to re-explain it. Plus nobody likes walls of text and it's a lot cleaner on the forum.

So I'll start by saying that if you have experience with any of the three scripting languages supported by GTAC (JavaScript, Lua, and Squirrel), then the easy answer is to use that. Familiarity is best and you'll probably be more productive with a language you already know. If you don't have any scripting experience, or never tried any of those three languages, continue reading.


JavaScript
Let's start with JavaScript. It has a massive "community" behind it, and usually within the top languages on sites where you can get help or find resources (Stack Overflow, GitHub, etc). JavaScript is everywhere now, handling both back and front end operations, which is a far cry from it's origins as a way to run simple client-side operations within a web page. For future programming aspirations outside of GTA Connected (especially in web development), this is the language to use. JavaScript resources also start and execute faster than the other two languages on GTA Connected.

Sounds too good to be true right? You bet it is. Despite all the advantages, there are some cons to using it. It's the most complex of the three, and it's quirks make it a poor starter language to learn. JS used to be a big mess but gradually becoming more refined thanks to standards like ECMAScript.


Squirrel
Squirrel is barely known outside of GTA multiplayer mods (and even within them) and a couple other tiny projects. However, I find Squirrel's syntax to be the easiest, but I'm already fluent with it and have been for many years. It has a simple table-oriented structure and basically grabs many of the good parts from other languages. Squirrel was used on a couple other GTA multiplayer mods, like Liberty Unleashed and IV-MP, although both are now defunct. VC-MP is the only active mod that supports Squirrel, and you can find many resources there.

The only issue is that very little documentation exists for it and can make the learning curve a bit more complex. This can be alleviated a bit, thanks to many similarities to JavaScript, which has documentation everywhere. If you're not already using another language and don't plan on doing any scripting outside of GTA Connected, then I definitely recommend Squirrel.


Lua
Lua is the language I'm least adept with, so this answer might be a little bias. You'll find no shortage of Lua scripters around GTA multiplayer modifications. On top of that, there are many useful resources in Lua from other GTA MP mods like FiveM and MTA SA. Lua's operators are generally more oriented around words instead of symbols, so sometimes it can look more like something you'd read/write rather than code. If you need help, Mex is our local Lua guru here at GTA Connected, bringing his ample experience from MTA:SA, VCO, and SOL-O (VCO and SOL-O both long gone) and his VLE resource is still the most advanced and sophisticated that I've ever seen in my many years within various GTA multiplayers. If you're coming from MTA:SA or FiveM (or plan to use them now or in the future alongside GTA Connected), this might be the language for you.

But like the other languages it's not without it's shortcomings. It's not widely supported around the web and not many other projects have support for it. The syntax of Lua is the least similar to the others that GTA Connected provides, which makes converting or borrowing code from them (or vice verse) generally difficult and slow.



I hope you found this information useful.
#12
Module Releases / SQlite Module
October 11, 2019, 11:44:21 PM
This is a simple SQlite module for those who want to use it for their server. This module was created by Jack Powell, but since he's busy working on GTAC updates, he gave me permission to make a topic and provide releases. Original GitHub repo here

Downloads:
https://github.com/VortrexFTW/mod_sqlite/releases

Instructions:
Download and place the module file into your server's "modules" folder and put "<module src="mod_sqlite" />" into the modules section of your server XML. Be sure to include the name of your modules folder (it's relative to the main server directory) and do not include a file extension. It should look similar to this:
<modules>
    <module src="mod_sqlite" />
</modules>

JavaScript Example:
let db = new module.sqlite.Database("test.db");
let query = db.query("SELECT * FROM test_table");
console.log(query);

Available Functions:
databaseHandle module.sqlite.Database(string pathToDBFile);
void databaseHandle.query(string queryString);
void databaseHandle.close(void);
#13
ATTENTION: This resource is now obsolete. Please check https://github.com/VortrexFTW/gtac_vortrex/tree/master/v-events for the new version, included in my basic resources.


Here's a few events for entering and exiting vehicles and spheres:
addEvent("OnPedEnterSphere", 2);
addEvent("OnPedExitSphere", 2);
addEvent("OnPedEnterVehicle", 3);
addEvent("OnPedExitVehicle", 2);

addEventHandler("OnEntityProcess", function(event, entity) {
if(entity.isType(ELEMENT_PLAYER) || entity.isType(ELEMENT_CIVILIAN)) {
getElementsByType(ELEMENT_VEHICLE).forEach(function(vehicle) {
if(entity.vehicle == vehicle) {
if(entity.getData("in.vehicle") == null) {
triggerEvent("OnPedEnteredVehicle", entity, entity, vehicle, getPedVehicleSeat(entity));
triggerEvent("OnPedEnteredVehicle", vehicle, entity, vehicle, getPedVehicleSeat(entity));
entity.setData("in.vehicle", vehicle);
}
} else {
if(entity.getData("in.vehicle") == vehicle) {
triggerEvent("OnPedExitedVehicle", entity, entity, entity.getData("in.vehicle"));
triggerEvent("OnPedExitedVehicle", vehicle, entity, entity.getData("in.vehicle"));
entity.removeData("in.vehicle");
}
}
});

getElementsByType(ELEMENT_MARKER).forEach(function(sphere) {
if(sphere.position.distance(entity.position) <= sphere.radius) {
if(entity.getData("in.sphere") == null) {
triggerEvent("OnPedEnterSphere", entity, entity, sphere);
triggerEvent("OnPedEnterSphere", sphere, entity, sphere);
entity.setData("in.sphere", true);
}
} else {
if(entity.getData("in.sphere") != null) {
triggerEvent("OnPedExitSphere", entity, entity, sphere);
triggerEvent("OnPedExitSphere", sphere, entity, sphere);
entity.removeData("in.sphere");
}
}
});
}
});

function getPedVehicleSeat(ped) {
for(let i=0;i<=3;i++) {
if(ped.vehicle.getOccupant(i) == ped) {
return i;
}
}
return 0;
}

Just throw that into any client script. Once in place, you can use event handlers with it like you normally would.

Event names are OnPedEnterSphere and OnPedExitSphere for the spheres and OnPedEnterVehicle and OnPedExitVehicle for vehicles.



These are bindable, so you can use bindEventHandler with any ped object, if you want.



Handler arguments are the same for both sphere events: (Ped, Sphere)

For vehicle events, the enter event is: (Ped, Vehicle, Seat) and the exit event is (Ped, Vehicle)


addEventHandler("OnPedExitSphere", function(event, ped, sphere) {
message("Ped " + String(ped.id) + " entered sphere + " + String(sphere.id), COLOUR_YELLOW);
});

// In this section, "sphere" references an existing sphere in the game world.
bindEventHandler("OnPedEnterSphere", sphere, function(event, ped, sphere) {
message("Ped " + String(ped.id) + " entered sphere + " + String(sphere.id), COLOUR_YELLOW);
});

addEventHandler("OnPedExitVehicle", function(event, ped, vehicle) {
message("Ped " + String(ped.id) + " exited vehicle + " + String(vehicle.id), COLOUR_YELLOW);
});
#14
Scripting Releases / [JS] Police Pursuit
July 15, 2019, 11:59:16 PM
What is it?

Just a couple simple snippets to make police cars chase you if you have a wanted level.



How it works:

If you have a wanted level, and a police car streams in with a police officer NPC driving it, they'll pursue you. Their speed depends on your wanted level. Obviously having a wanted level of 1 will make it easy to escape, while higher levels get more difficult.



Note:

This doesn't spawn any extra vehicles or add higher levels of law enforcement with more vehicles. It only uses what exists to pursue suspects.



Code:

https://pastebin.com/kBeBi72vClient Side[/url]

https://pastebin.com/6xfB1eU6Server Side[/url]
#15
Scripting Releases / [JS] Get Vehicles Within Range
July 06, 2019, 11:56:44 PM
Works both client and server-side.
function getVehiclesInRangeOfPos(pos, distance) {
    return getVehicles().filter(x => x.position.distance(pos) <= range);
}
#16
Scripting Releases / [JS] Get Closest Vehicle
July 06, 2019, 11:54:58 PM
Works both client and server side.function getClosestVehicle(pos) {
    return getVehicles().reduce((i, j) => (i.position.distance(pos) <= j.position.distance(pos)) ? i : j);
}
#17
General Chat / WYSIWYG Editor!
June 30, 2019, 02:48:01 AM
QuoteWow we got a WYSIWYG editor now!


That's so bold

Well I think it's very Italian

That's italics you idiot

Ya'll black.

Careful now, that's a grey area.

http]

https://lipsum.com/That's cute. I link to Lorem Ipsum[/url]
#18
General Chat / What is GTA Connected?
June 14, 2019, 08:03:24 AM
Grand Theft Auto Connected (sometimes called GTA Connected or GTA:C for short) is a scriptable multiplayer modification (MP mod) that supports multiple GTA games, including GTA III, GTA Vice City, GTA San Andreas, and GTA IV.

It's basically the one mod to rule them all.

Before GTA Connected, each GTA game had a different modification to play online. These were created by different teams with a different development process and structure. The problem with that is you have to download each mod separately and you end up with a very different experiences when playing each of them. Also, some mods were more unstable than others, and some have poor sync. For server owners and scripters this also meant you had to completely rewrite your scripts to work on another mod to have a server for another game. Thus, GTA Connected was created under the idea of "why play all these different mods when you only need one?"

It's the same experience across every game. Same amazing sync, same stability and security, same "feel" to the games. No need to deal with different mods. Just download GTAC, choose a game, connect, and play! (You'll need to have a copy of the game you want to play on your PC, of course). For scripters, it's the ultimate dream: You only need to write your scripts once. The functions and structures are identical for every game (with a few minor exceptions). Need an example? Check out "Vortrex's Freeroam Server" on any of the games GTA Connected supports ... It runs the exact same scripts for each game all from the same server directory.
#19
General Chat / Server List Rules
February 19, 2019, 05:55:48 AM
The GTA Connected team provides a server list as a public service for server owner's to list their servers on. This helps players find online servers more easily.

In order to properly maintain the list, the following items in the list are not allowed, and will result in action from the staff team.
  • Any modified server executables or other third party tools that have the capability to add servers or fake/misleading info to the server list.
  • Server spam.
  • Servers that copy another established server or community's information without consent of the other server/community's owner.
  • Servers that contain information used in a discriminatory manner (see the list below).
  • Servers that contain information that attack other servers or players (hateful messages, links, etc)
  • Servers using verified stolen or copied resources without the consent of the original resource author.
  • Servers that contain deceptive or false official distinction (bold text, tags with reserved info, etc)



Also, some information to keep in mind:

- Discriminatory information as mentioned above is something used to discriminate on the basis of race, color, religion, creed, gender, gender expression, age, national origin, ancestry, disability, marital status, sexual orientation, or military status.

- Extreme or repeat violations of these rules will result the service being blocked for the affected parties. This can include IP range bans, a complete firewall, or other measures for the affected parties, depending on the situation. This can also extend to all necessary services, at the staff team's discretion (forum, wiki, discord, etc)

- If you own a server that violates one or more of these rules, we will contact you with a warning to change it. You will be given a specific amount of time to correct any issues. If you don't comply with instructions by the given time, your server will be removed from the server-list. If you are unsure whether or not a correction would be compliant, contact a member of the staff team and they'll let you know.

- Deceptive or false official distinction is any reserved text, emoji, unicode, tags, or other part of the server information that might directly or indirectly deceive others into thinking that the server is marked by the GTA Connected team in some way (like an official or trusted server). Example: changing your server name to include bold text or something like [Official] or any other means of deceptively and/or falsely indicating an official status. This does not apply to servers that actually have the indicated official status.

- False/misleading info as mentioned in the first entry of the list is any false or altered information that might mislead players. This includes (but is not limited to): altered player count and/or list to add fake players, changed server version number found in rules section at the bottom in the launcher and generally anything else that any third-party, modified server, or custom tool could intercept and/or relay false data from.

- If you would like to report a server that violates any of these rules, please contact a member of the staff team. Please be sure to include all necessary info (at the minimum: server name, IP address, owner, and the broken rule)
#20
General Chat / Information about GTA Connected services
February 19, 2019, 05:27:33 AM
So it's recently come to my attention that a rumor has been circulating about restrictions with GTA Connected. It's been said that we have a global ban system and using hacks in-game will result in being globally banned.



I want to make this very clear: we have no such system in place

Bans are issued per-server and are at the discretion of the server owner and anybody the server owner chooses to allow banning (like a moderator, for example). These are applied only to that server and any other servers that use the same ban list (like if there are 2 or more servers running in a community, for example). It is not a global ban that applies to all servers.



The GTA Connected team will not interfere with any servers or clients specifically.

However, using official GTA Connected services (forum, wiki, discord, masterlist, etc) with malicious intent or attacking any official GTA Connected services will result in action from the GTA Connected team.