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 ... 17 18 [19]
271  Liberty Unleashed / Suggestions / Re: Add Vehicle.Alarm on: September 30, 2011, 09:54:50 pm
Thats true, but its a temporary solution in case you don't want to wait for when the actual alarm gets put in
272  Liberty Unleashed / Suggestions / Re: Add Vehicle.Alarm on: September 30, 2011, 09:49:51 pm
Well, this could be possible, with the use of sounds and light flashing. Maybe every second or two, make the lights toggle on or off, based on their previous state, and make a horn sound play for anybody in range.

EDIT: I think the onVehicleUpdate() callback checks for the movement when unoccupied, and detects what player moved it ... You could use this for an alarm system in the meantime. I gotta check the LU Bible (Wiki) for this however, so don't quote me on this
273  Liberty Unleashed / Suggestions / Re: Scripting To Allow RCON Access Based On Username/User Account on: September 23, 2011, 09:42:28 pm
It doesn't have a wiki page, but it's listed on the Server-side Functions under "Misc Functions"
274  Liberty Unleashed / Suggestions / Re: Scripting To Allow RCON Access Based On Username/User Account on: September 23, 2011, 03:12:53 pm
This is possible, with the SendRconCommand function
275  News and Content / Updates/Changes / Re: Update 0.1.0.11 (12/09/2011) on: September 23, 2011, 03:08:22 pm
I have an idea for another update { auto reconnect when any thing happen }
Like in SA_MP

You can use /reconnect to reconnect to a server
276  Scripting / Script Help / Re: /spawncar <name> on: June 16, 2011, 09:15:32 pm
This is untested, but it should work (if I didnt put a typo in it):

Code: [Select]
else if ( szCmd == "spawncar" )
{
if (szParams )
{
if ( IsNum( SzParams ) )
{
if ( szParams.tointeger() <= 150 && szParams.tointeger() >= 90 )
{
MessagePlayer( "Spawning a vehicle with model ID " + szParams, pPlayer);
local pVehicle = CreateVehicle( szParams.tointeger(), pPlayer.Pos, pPlayer.Angle );
}
}
else
{
if ( GetVehicleIDFromName( params ) != 0 )
{
MessagePlayer( "Spawning vehicle with model ID " + GetVehicleIDFromName( szParams ), pPlayer);
local pVehicle = CreateVehicle( GetVehicleIDFromName( szParams ), pPlayer.Pos, pPlayer.Angle );
}
else
{
MessagePlayer( "Invalid Model Name", pPlayer);
}
}
}
}
277  Scripting / Script Help / Loading Vehicles using Script on: June 08, 2011, 05:15:45 pm
Hello everybody. I am new to Squirrel, but have used a few other languages similar to it, like Lua and such.

My question is this:
I am wanting to load vehicles using the script so I can add more data to it (like the owner of a vehicle, for example). As I am used to Lua, which I can create a table to store this data, I am not sure how this works in Squiirel. I am able to make the tables and such, but im not sure how to index them and create the vehicles. Here is what I have so far:

Code: [Select]
function LoadVehicleFromSQL()
{
sqlite_query(database,"ALTER TABLE vehicles AUTO_INCREMENT=1");
local amount = sqlite_query(database,"SELECT count(*) FROM vehicles");
local vehicle = 0;
if(amount)
{
for(i = 1;i = amount;i++)
{
local query = sqlite_query(database,"SELECT model,x,y,z,a,color1,color2,owner,faction,job,locked,engine,lights FROM vehicles WHERE id = " + i);
vData[i] <- {};
vData[i].Model <- sqlite_column_data(query,0);
vData[i].X <- sqlite_column_data(query,1);
vData[i].Y <- sqlite_column_data(query,2);
vData[i].Z <- sqlite_column_data(query,3);
vData[i].A <- sqlite_column_data(query,4);
vData[i].Color1 <- sqlite_column_data(query,5);
vData[i].Color2 <- sqlite_column_data(query,6);
vData[i].Owner <- sqlite_column_data(query,7);
vData[i].Faction <- sqlite_column_data(query,8);
vData[i].Job <- sqlite_column_data(query,9);
vData[i].Engine <- sqlite_column_data(query,10);
vData[i].Lights <- sqlite_column_data(query,11);
sqlite_free(query);
vehicle = CreateVehicle(vData[i].Model,Vector(vData[i].X,vData[i],Y,vData[i].Z),vData[i].A,vData[i].Color1,vData[i].Color2);
vehicle.Locked = vData[i].Locked;
vehicle.SetEngineState = vData[i].Engine
vehicle.LightState = vData[i].Lights
}
}
}

I am not sure how to index this table (should it be by the increment in the for loop, or by the instance created from the vehicle?)

The only conclusion I have about this is:
I create the tables, and index them by ID, not the instance, then I could use vehicle.ID in the index like:
vData[vehicle.ID].Model

Any help or information on this is greatly appreciated. I am probably doing it wrong, but Im not sure how to add other info to the vehicle instance (so it could be like vehicle.Owner, or vehicle.Price or something)

Thanks,
WtF
Pages: 1 ... 17 18 [19]
© Liberty Unleashed Team.