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 / Bug Reports / Re: Sound Bug Near Club By El Burro Payphones on: August 01, 2011, 03:21:12 pm
And it's supposed to repeat itself randomly and ad lib, without any sequencing?

I presume so, it's just nonsensical ambient noise that plays constantly at a position inside that building.

Still don't understand the pinging sound from the building opposite either.

I'm not sure I understand what you mean by pinging, I haven't experienced it my self so not sure what could be causing it. GTA does have random echo effects in places around the map though.
2  Liberty Unleashed / Bug Reports / Re: Sound Bug Near Club By El Burro Payphones on: August 01, 2011, 12:24:07 pm
The main building in your screen shot is not a club it's a bunch of flats, and you're meant to hear two men arguing. I've just verified this in single player and I can hear the two men arguing, it's just not as audible in SP because of the ambient noise of cars etc.
3  Off Topic / Spam / New GTA mod comes out... on: March 07, 2011, 11:58:23 pm

4  Scripting / Script Tutorials / Re: [TUTORIAL] "while" loop on: March 01, 2011, 02:57:48 am
Slight problem would be that not all player IDs are populated in sequence if someone in the middle leaves.


Good point! A simpler solution would be to use GetMaxPlayers() instead of GetPlayers(), such as:

Code: (squirrel) [Select]
for (local p, i = 0, count = GetMaxPlayers(); i < count; i++) {
  if (!(p = FindPlayer(i))) continue;
 
  p.Health = 100;
}

Although this could be inefficient if it's done lots of times on large servers. A better and more efficient alternative would be to keep an active table of players and use foreach to iterate that table:

Code: (squirrel) [Select]
players <- {};

function onPlayerJoin( player )
{
players.rawset(player.Name,player);
}

function onPlayerPart( player, reason )
{
players.rawdelete(player.Name);
}

function HealAllPlayers()
{
foreach(player in players) {
player.Health = 100;
}
}
5  Scripting / Script Snippets / Get a list of players as a table. on: March 01, 2011, 12:48:28 am
Code: (squirrel) [Select]
function GetPlayersTable()
{
local players = {};

for (local player, id = 0, count = GetMaxPlayers(); id < count; id++)
if ((player = FindPlayer(id))) players.rawset(player.Name,player);

return players;
}

This function returns a Squirrel table containing a list of all the players currently on the server. This allows you to use foreach to iterate through all the players on the server. For example:

Code: (squirrel) [Select]
local players = GetPlayersTable();

foreach(player in players)
player.Frozen = true;

The above code would freeze every player on the server. You can also check if a certain player is in the table by name:

Code: (squirrel) [Select]
function onPlayerCommand( player, cmd, args )
{
local players = GetPlayersTable();
local arglist = split( args, " " );

switch(cmd)
{
case "ouch":
local name = arglist[0];

local pos = player.Pos;
pos.z += 5;

if (name in players)
players[name].Pos = pos;

return 1;
}

return 0;
}

The above code would create a new command '/ouch' which a player could use to drop another player on their head by typing '/ouch someguy'.

An optimised way to handle player lists:

One potential efficiency problem with the GetPlayersTable() function above is that when using it in a foreach loop you will essentially be looping through the players list twice. One way to avoid this is to keep a global table containing an active list of players. Using GetPlayersTable() to populate a global table would not be sufficient as the list would become invalid as players join and part the server. A solution to this is to use the onPlayerJoin and onPlayerPart callbacks to manage an active list of players:

Code: (squirrel) [Select]
players <- {};

function onPlayerJoin( player )
{
players.rawset(player.Name,player);
}

function onPlayerPart( player, reason )
{
players.rawdelete(player.Name);
}

This way the global 'players' table always contains a valid list of players currently on the server. You would then use this global table in the same way as above, but without the need to define it locally or call GetPlayersTable().
6  Scripting / Script Tutorials / Re: [TUTORIAL] "while" loop on: February 28, 2011, 09:54:53 pm
And here's a loop for people who aren't batshit crazy:

Code: (squirrel) [Select]
for (local p, i = 0, count = GetPlayers(); i < count; i++) {
  if (!(p = FindPlayer(i))) continue;
 
  p.Health = 100;
}
7  Scripting / Script Releases / Re: Liberty Unleashed Speedo Script on: November 11, 2010, 02:20:26 am
There's a bug in the copy of 1.0.1 currently available, it's missing an else in front of DisplayVehicleGear( 1 ); on line 137.

Fix for anybody who needs it:

Change:
Code: [Select]
// If the vehicle is a car display its current gear
if ( IsVehicleCar( pVehicle.Model ) ) DisplayVehicleGear( pVehicle.Gear );
// Otherwise just show 1 (This is to fix the 'reverse' bug on dodo/boats etc, they only have gear 0)
DisplayVehicleGear( 1 );

To:
Code: [Select]
// If the vehicle is a car display its current gear
if ( IsVehicleCar( pVehicle.Model ) ) DisplayVehicleGear( pVehicle.Gear );
// Otherwise just show 1 (This is to fix the 'reverse' bug on dodo/boats etc, they only have gear 0)
else DisplayVehicleGear( 1 );
8  News and Content / Liberty Unleashed News / Re: LU 0.1 has been released! on: October 26, 2010, 02:06:38 pm
Nice job on the release gyz! The new speedo is awesome. The browser is nice aswell, although it might be a good idea to have the installer set the game path so you don't have to browse for it when you first try to launch a game.
9  Liberty Unleashed / Suggestions / Re: Suggestions : add buildings/rooftops collision and texture on: May 18, 2010, 12:00:24 am
It's technically possible, but it's unlikely it'll be in the first release.
10  Archive / Archived Items / ... on: April 10, 2010, 11:35:59 pm
11  Liberty Unleashed / Liberty Unleashed Chat / Re: GTAWinter is not compatible with Liberty Unleashed on: December 06, 2009, 02:28:30 am
What?
12  Liberty Unleashed / Suggestions / Re: Liberty Unleashed beta version on: October 02, 2009, 04:56:05 pm
Sorry but due to unforeseen circumstances the project has been cancelled.
13  Archive / Archived Items / Re: Public testing! on: December 12, 2008, 08:14:29 pm
LU works on the Steam version of GTA3 for anybody who cares to know. So no need to get your self a CD copy if you already have GTA3 installed through Steam!
Pages: [1]
© Liberty Unleashed Team.