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
Pages: [1]
1  Liberty Unleashed / LU Clans / Clan spamming will not be tolerated anymore on: May 20, 2014, 12:17:04 pm
We had enough clan spamming in the last month, anymore clanspamming will lead to being banned from the forum permanently.
2  Servers / Advertise your server! / LU Racing server on: October 14, 2013, 06:56:54 pm

Liberty Unleashed Racing Server

The only racing server available at the moment, hosted on the powerful machines of VRocker Hosting.
Server loads an XML map and the associated record table with it and starts it when there's more than one player, so get your hands on the wheel and set new records!


Host: VRocker Hosting
Script: Racing mode v0.1 with compiled client scripts.
IRC Server: LUNet (
IRC Channel: #LURace


GUI arrows to guide you within the racetrack (big thanks to [AoD]NC!!)
Interactive scoreboard which keeps tracks of checkpoints and reorganises.
Auto starter.
Anti car explosion.
Record system.
-- and more!

Main priorities

Adding more racetracks


3  Liberty Unleashed / Liberty Unleashed Chat / Showing some 0.1.1 features... on: September 03, 2013, 10:01:15 pm
This topic's main purpose is to showoff 0.1.1 features and let you guys know the developers didn't forget about you :)

  • Custom objects

As you know the 0.1.1 update includes custom objects which you can load and spawn by their name.

This option lets you build your own objects and place them ingame by the use of XML files and CreateObject function and the collision, texture and model files of the object!


  • NPCs

NPCs are non-player characters and they are, as you already know, a feature in 0.1.1 ! They don't do much in this version but it's nice to have them! You can set their alpha, give them weapons, put them in vehicles.. etc..


Along with the possibility of adding your own timecyc.dat to the server and the new ban system which relies on GUIDs, 0.1.1 also comes with lots of bugfixes!

4  Scripting / Script Tutorials / How to fix compiled client scripts issues. on: August 07, 2013, 01:23:47 pm
After intensive talking with [AoD]NC, he told me that my errors could be due to version difference. (thanks Gudio)

So, I tried printing the version and this is what I found:

Server is using version Squirrel 3.0 stable
Client is using version Squirrel 3.0 beta 1 (older)

So in order to compile your script, you will have to use this executable I packed after compiling the 3.0 beta 1 source.

The executable will execute every line you type, so you will have to write:
Code: [Select]
Source: Clicky!
Executable: Clicky!

- I haven't tested with lots of client scripts, but as mine worked, I decided to share this solution. It might not work, but it will most likely do.
5  Scripting / Script Tutorials / How to set a vehicle's angle correctly. on: July 27, 2013, 01:15:54 am
If you didn't know, setting a vehicle's angle points to weird directions, well, here is your fix!
Instead of passing degrees, you must pass a radian.
I provided a simple DegreesToRadians function below:

Code: [Select]
function DegreesToRadians(deg)
local rad = deg * PI / 180.0;
return rad;

You will have to do
Code: [Select]
vehicle.Angle = DegreesToRadians(desiredangle);
Usage example:
Code: [Select]
vehicle.Angle = DegreesToRadians(180);
The above example will set 'vehicle' s angle to 180.
6  Off Topic / General Chat / Happy birthday Force! on: July 20, 2013, 06:29:24 pm
Happy birthday Force, even if  your bd was on 19th of July :D.

7  Scripting / Script Snippets / [SQ3.0.2] Bunch of useful snippets on: March 09, 2013, 12:55:02 pm
Return full time in array

Code: [Select]
function GetTimeTable()
timestamptable <- array(5,0);
local time = GetFullTime().tostring();
timestamptable[0] = time.slice(0,3);
timestamptable[1] = time.slice(4,7);
timestamptable[2] = time.slice(8,10);
timestamptable[3] = time.slice(11,19);
timestamptable[4] = time.slice(20,24);
return timestamptable;

How to use it: GetTimeTable()[id], id can be 0,1,2,3,4 but not higher or lower. 0 returns day in 3 letters, 1 returns month in 3 letters, 2 returns day number in 1 integer, 3 returns the time in 8 characters, 4 returns year in 1 integer.

Code: [Select]
function onConsoleInput(cmd,text)
       print("Executing command: " + cmd + " with params: " + text + " at " + GetTimeTable()[0] + "/" + GetTimeTable()[1] + "/" + GetTimeTable()[3] );

Sending script error messages w/o forcing an error 2 ways.

Code: [Select]
function PrintErrorMessage(errortitle,optionalparams)
                throw("\"" + errortitle + "\" , possible cause: " + optionalparams);
                throw("\"" + errortitle + "\"");

How to use it: PrintErrorMessage("hello","apple");

Method 2

Code: [Select]
function PrintErrorMessage2(errortitle,optionalparams)
                error("Error at \"" + errortitle + "\" , possible cause: " + optionalparams);
                error("Error at \"" + errortitle + "\"");

How to use it: PrintErrorMessage("hello","apple");

To be continued.
If you have useful snippets, post them over here.

PS: SQ3.0.2 is the Squirrel version used by LU.
8  Scripting / Script Snippets / Player loop, new method on: November 14, 2012, 03:41:25 pm
This is a loop-through method using arrays tested by me, ( with myself... duh.. )! The good thing is that this method loops only through the valid player instances, and not some unfilled slot ( like for( local i = 0; i < GetMaxPlayers(); i++ ) ).

Also, morphine shown me a method using constructor and classes, but I thought this would be easier to teach, so here it is.

I will show it in an example:

Code: [Select]
playerson <- [];

function onPlayerJoin( player )
playerson.push( player.ID );

function onPlayerPart( player, reason )
playerson.remove( player.ID );

function HealAll()
foreach(playerid, val in playerson )
print( "CLIENT NAME: " + FindPlayer(playerid).Name );

function onPlayerCommand( player, cmd, params )
if( cmd == "printall" )


CLIENT NAME: yournamegoeshere
CLIENT NAME: yournamegoeshere

What happens if there is no player in the server ?

Nothing will happen, no message from the server.

Can be modified at your will, some credits won't hurt anyone.
9  Scripting / Script Tutorials / Efficient Scripting.. on: October 17, 2012, 12:41:54 pm
This method that I've learned from AdTec shows a nice way to reduce else blocks memory and this is how I do it, maybe results are not visible, but it's certainly an improvement.

Code: [Select]
function onPlayerCommand( player, cmd, params ) // the actual function
{ // the opening bracket
if( player && cmd ) // Check if player and command exist, not really mandatory..
{ // opening bracket of above 'if'

local delim = cmd.slice( 0, 1 ); // get the first letter from the "cmd" string
switch(delim) // create a switch in which we have our cases.
{// opening bracket of the switch

case "e": // first case

                       if( cmd == "examplecmd" )
                                 Message("Example command1");
                        else if( cmd == "examplecmd2" )
                                Message("Example command2");
                          break; // break first case to start another one, dunno if it's mandatory

                         case "b":
                                   if( cmd == "blah" )
            } // end switch
} // end first bracket
} // end function bracket

Sorry for the awful identation.
10  Scripting / Script Releases / [RELEASE]: Chat correction on: August 11, 2012, 04:55:40 pm
Chat Correction v0.1

What is this?

Scroll down for too long ; didn't read version

This is a script wrote by [VU_R]ShadowX which corrects your chat by setting the text as lowercase, then setting the first letter as uppercase, and based on few trigger words, sets the correct gramatical symbol at the end of the sentence.

TL;DR Version:

Something to correct your gramatical mistakes.

How to install?

Download and copy corrector.nut to your scripts folder, then edit Script.xml adding this new line
Code: [Select]
<script file="corrector.nut" client="0" />

Download link: Here!
11  Servers / Advertise your server! / LU: Game of 5 ( Features 5 unique gamemodes! ) on: July 23, 2012, 12:42:55 pm
Game of FIVE


It all started when I was thinking of a simple game which was supposed to give you the best deathmatch/Team Deathmatch by combining 5 unique gamemodes into one single script, triggered at random times.

Game of FIVE features 5 unique gamemodes that are meant to amaze you by their simplity and efficience.

Attack & Defend

I hope everyone knows what Attack and Defend is, and I hope few guys played on A/D Servers in various GTA MP Mods, but this mode features 3 unique things.

Last moment rumble! - This mode allows spectators to join a fight in a random team if they arre able to grab the lucky pickup that spawns once / 3 rounds. They are equiped with Map weapons and they are thrown on the battlefield!

Experience & Experience advantages! - This system allows you to increase your experience by killing enemies and decreases if you kill your teammates. More experience allows you to buy special weapons / vehicles / items!

_______________________________________ LIST _____________________________________

HEADPOPPER WITH A SCOPE ( SNIPER ) - 50 EXP - Gives you sniper rifle
BOOMLAUNCHER ( ROCKETLAUNCHER ) - 100 EXP - Gives you Rocket Launcher
WALK'N'DEAD ( GROUND MINE ) - 150 EXP - Gives you the abillity to plant a mine
BIRTHDAY BOOMGIFT ( SATCHEL & DETONATOR ) - 200 EXP - Satchel triggered by a detonator
MOLOTOV BE WITH YOU ( Molotov x5 ) - 250 EXP - Gives you 5 Molotovs
GRENADE FOR MASACRE ( Grenade x5 ) - 250 EXP - Gives you 5 Grenades
ULTIMATE GEAR ( RPG + M16 + SHOTGUN + SATCHEL ) - 800 EXP - All needed to fix your opponents

SHOOTING PATRIOT - 50 EXP - Patriot with Predator guns ( Att )
PANZER FOR 2 - 150 EXP - Gives you a RHINO ( Att )
PANZER FOR 8 - 200 EXP - Spawns 4 RHINOS ( Att )
555-AIRBOMB ( Dodo with bombs ) - 650 EXP - Spawns one of your teammates at Airport and gives them a dodo full with bombs ( Att )

BOMB DA FIELD ( Mine x 15 ) - 1000EXP - Fills the map with the finest groundmines for a certain win! ( Def )



Spawns every single player in a closed area and equips them with:

  • Shotgun
  • M16
  • Rocket Launcher
  • Grenades & Molotovs
  • 2 Groundmines
  • 2 Satchels

Alone in a jungle

Ever thought of this ? 2 guys armed with the finest armory ( Kevlar, Shotgun, M16, Satchels, Groundmines ) vs 10 guys armed with ( Kevlar, Shotgun, Uzi )


Spawns every player in a dodo at airport, their point is to ram the living things outta each other till one wins


Spawns every player in a Rhino for extra fun!

Looking for additional developers!
12  Scripting / Script Help / [C++] I need some help regarding C++ -> SQ modules on: July 13, 2012, 10:35:25 pm
I've been trying and thinking on how to make a module that messages "hello world" ingame to all players, but I obviously fail at it, here is my C file ( as the headers and other requested files are included )

NOTE: 1. I've been seeking help on IRC but it seems I am too annoying for this comunity with my obvious annoying PMs.
          2. I know this is not a place to request C++ Help.

Code: [Select]
#include "SQFuncs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <sqstdaux.h>
#include <sqstdio.h>

        #ifdef SQUNICODE
        #define scvprintf vwprintf
        #define scvprintf vprintf

extern SQAPI sq;

//_SQUIRRELDEF( MessagePeople )
/*SQUIRREL_API SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,const SQChar *sourcename,SQBool raiseerror);*/
   // char phat [] = "hello world";
//sq->pushstring( v, _SC(" Message(phat) "), -1 );
//sq->call( v, _SC("Message(phat) "), true, true );
//sq->call( v, _SC("Message(phat); "), true, true );
// return SQ_OK;

_SQUIRRELDEF( HelloSquirrel )
sq->pushstring( v, _SC( "Hello Squirrel Module!" ), -1 );

return 1; /* return 0 indicates the Squirrel function does not return a value, 1 returns a value */

SQInteger iArgCount = sq->gettop( v ); /* Get the argument count */

if ( iArgCount == 3 ) /* Argument count = 2 arguments + root table = 3 */
SQInteger i1 = 0, i2 = 0;

sq->getinteger( v, 2, &i1 ); /* Get argument 1 in slot 2 to 'i1' */
sq->getinteger( v, 3, &i2 ); /* Get argument 2 in slot 3 to 'i2' */

sq->pushinteger( v, i1 + i2 ); /* Return the sum of these two numbers */
return 1;

sq->pushbool( v, SQFalse );
return 1;

        void printfunc(HSQUIRRELVM v, const SQChar *s, ...)
                va_list arglist;
                va_start(arglist, s);
                scvprintf(s, arglist);

        void call_Message(HSQUIRRELVM v, const SQChar *s)
                int top = sq->gettop(v); //saves the stack size before the call
                sq->pushroottable(v); //pushes the global table
                if(SQ_SUCCEEDED(sq->get(v,-2))) { //gets the field 'foo' from the global table
                        sq->pushroottable(v); //push the 'this' (in this case is the global table)
                        sq->call(v,2,0,0); //calls the function
                sq->settop(v,top); //restores the original stack size

        int main(int argc, char* argv[])
                HSQUIRRELVM v;
                v = sq->open(1024); // creates a VM with initial stack size 1024

        //        sq->seterrorhandlers(v);

                sq->setprintfunc(v, printfunc, NULL); //sets the print function

                sq->pushroottable(v); //push the root table(were the globals of the script will be stored)
 //               if(SQ_SUCCEEDED(sq->dofile(v, _SC("SRPGv0.1.nut"), 0, 1))) // also prints syntax errors if any
//                {
 //               }

                sq->pop(v,1); //pops the root table

                return 0;

SQInteger RegisterSquirrelFunc( HSQUIRRELVM v, SQFUNCTION f, const SQChar* fname, unsigned char ucParams, const SQChar* szParams )
char szNewParams[ 32 ];

sq->pushroottable( v );
sq->pushstring( v, fname, -1 );
sq->newclosure( v, f, 0 ); /* create a new function */

if ( ucParams > 0 )
ucParams++; /* This is to compensate for the root table */

sprintf( szNewParams, "t%s", szParams );

sq->setparamscheck( v, ucParams, szNewParams ); /* Add a param type check */

sq->setnativeclosurename( v, -1, fname );
sq->newslot( v, -3, SQFalse );
sq->pop( v, 1 ); /* pops the root table */

return 0;

void RegisterFuncs( HSQUIRRELVM v )
/* Add your Squirrel functions here */

RegisterSquirrelFunc( v, HelloSquirrel, "Hello", 0, 0 );
RegisterSquirrelFunc( v, Sum, "Sum", 2, "ii" );
//RegisterSquirrelFunc( v, MessagePeople, "MessagePeople", NULL, NULL );

13  Scripting / Script Help / Error.. error.. error.. on: July 02, 2012, 06:24:15 pm
So, I have been thinking about this system that loads up previous player position from SQLite database, and sets you there, but I encounter an error.

Code: [Select]
function PrecachePosition(player)
player.Skin = sqlite_column_data(sqlite_query(database, "SELECT Skin FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
/* local x = sqlite_column_data(sqlite_query(database, "SELECT * FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),1);
local y = sqlite_column_data(sqlite_query(database, "SELECT * FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),2);
local z = sqlite_column_data(sqlite_query(database, "SELECT * FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),3);*/
local wep = sqlite_column_data(sqlite_query(database, "SELECT Wep FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
local ammo = sqlite_column_data(sqlite_query(database, "SELECT Ammo FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
player.SetWeapon( wep, ammo );
player.Frozen = false;
player.Pos = Vector( sqlite_column_data(sqlite_query(database, "SELECT X FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Y FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Z FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0) );

1.YES the data exists
2.YES the data is in FLOAT format
3.YES the data is valid
4.YES the data is in NUMERIC.NUMERIC format ( FLOAT )
5.YES the data is saved at onPlayerPart(player,partreason)
6.YES I tried to get the exact data and put '.tofloat()' after it
7.The line with the error is surprisingly
Code: [Select]
player.Pos = Vector( sqlite_column_data(sqlite_query(database, "SELECT X FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Y FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Z FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0) );

Yes I also tried this code
Code: [Select]
local x = sqlite_column_data(sqlite_query(database, "SELECT X FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
local y = sqlite_column_data(sqlite_query(database, "SELECT Y FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
local z = sqlite_column_data(sqlite_query(database, "SELECT Z FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
player.Pos = Vector( x.tofloat(), y.tofloat(), z.tofloat() );

also, when I make a class and default all the datas to null, then try to set them to 1, I receive a '' trying to set 'null ''

14  Servers / Advertise your server! / Kyprix Project Server on: June 25, 2012, 04:22:19 pm


Host: VRocker's Machines
Location: France, EU
Gamemode: Roleplay

Current scripting team

Head Developer
[VU]Shadow (me)


X_94 a.k.a Nexus
Pages: [1]
© Liberty Unleashed Team.