Liberty Unleashed

Scripting => Script Help => Topic started by: GuenosNoLife on January 29, 2013, 12:48:07 pm

Title: Remove car burnt
Post by: GuenosNoLife on January 29, 2013, 12:48:07 pm
When my car burn and boum, he repair in a few minutes... I want he disappear!
To avoid brothels vehicle anywhere

How make it ?

Thank's!
Title: Re: Remove car burnt
Post by: GuenosNoLife on January 29, 2013, 02:55:21 pm
This was said 95325238 times.
Code: [Select]
plr.Vehicle.OneTime=true;
I don't found in "95325238 times" ;)

And what is the code complete ? How to understand this code if it is not complete? I really want unraveled me but I do not know how
Title: Re: Remove car burnt
Post by: GuenosNoLife on February 03, 2013, 10:33:28 am
This was said 95325238 times.
Code: [Select]
plr.Vehicle.OneTime=true;


Doesn't work,

Code: [Select]
if ( szCmd == "vehicule" )
{
if ( szParams )
{
local pTemp = split( szParams, " " ), ID = 90;
if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger();

if ( ( ID >= 90 ) && ( ID <= 150 ) )
{
local v = pPlayer.Pos;
MessagePlayer( "Vous avez spawner la vehicule ID " + ID + "...", pPlayer );
CreateVehicle( ID, Vector( v.x + 5, v.y, v.z ), pPlayer.Angle );
plr.Vehicle.OneTime=true;
}
}
}

(http://bildberg.eu/kOII3uCS.png)
Title: Re: Remove car burnt
Post by: GuenosNoLife on February 03, 2013, 10:41:07 am
Now work, i remove this on main.nut and create vehicule.nut

I copy the code from LU Wiki :
Quote
function onPlayerCommand( pPlayer, szCommand, szText )
{
   if ( szCommand == "veh" )
   {
      local pVehicle = CreateVehicle( VEH_INFERNUS, pPlayer.Pos, pPlayer.Angle, -1, -1 );
      if ( pVehicle ) pVehicle.OneTime = true;
   }
   
   return 1;
}

But I have another question, how to spawn in the car driving mode directly instead of taking the car?
Title: Re: Remove car burnt
Post by: JoseĀ® on February 04, 2013, 01:36:56 am
I did not know it was going  :o, but thanks is useful because I get to spend in case.

(http://forum.liberty-unleashed.co.uk/index.php?action=dlattach;attach=319;type=avatar)
Title: Re: Remove car burnt
Post by: GuenosNoLife on February 04, 2013, 05:33:31 am
I did not know it was going  :o, but thanks is useful because I get to spend in case.

([url]http://forum.liberty-unleashed.co.uk/index.php?action=dlattach;attach=319;type=avatar[/url])

Don't copy my code, it's bad.. It's work well but a problem, ALL ID spawn to 101 -_-
I don't know why..
Title: Re: Remove car burnt
Post by: IdkanYavuk X on February 04, 2013, 06:23:15 am
Code: [Select]
if ( szCmd == "vehicule" )
{
if ( szParams )
{
local pTemp = split( szParams, " " ), ID = 90;
if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger();

if ( ( ID >= 90 ) && ( ID <= 150 ) )
{
local v = pPlayer.Pos;
MessagePlayer( "Vous avez spawner la vehicule ID " + ID + "...", pPlayer );
local vh = CreateVehicle( ID, Vector( v.x + 5, v.y, v.z ), pPlayer.Angle );
vh.OneTime=true;
}
}
}
Title: Re: Remove car burnt
Post by: GuenosNoLife on February 04, 2013, 04:02:21 pm
Code: [Select]
if ( szCmd == "vehicule" )
{
if ( szParams )
{
local pTemp = split( szParams, " " ), ID = 90;
if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger();

if ( ( ID >= 90 ) && ( ID <= 150 ) )
{
local v = pPlayer.Pos;
MessagePlayer( "Vous avez spawner la vehicule ID " + ID + "...", pPlayer );
local vh = CreateVehicle( ID, Vector( v.x + 5, v.y, v.z ), pPlayer.Angle );
vh.OneTime=true;
}
}
}
Thank's you Great!
Perfect work  ;D
Title: Re: Remove car burnt
Post by: GuenosNoLife on February 04, 2013, 04:46:47 pm
You need to get the closest vehicle and then put the player in it.
It's something like (i can't remember the exact code):
Code: [Select]
plr.Vehicle=GetClosestVehicle(plr);
Yeah it's, or
local veh = GetClosestVehicle( plr );

In Wiki but I don't know how to work this.. I write veh to vh, plr to pPlayer and doesnt work!

Quote
if ( szCmd == "vehicule" )
   {
      if ( szParams )
      {
         local pTemp = split( szParams, " " ), ID = 90;
         if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger();
         
         if ( ( ID >= 90 ) && ( ID <= 150 ) )
         {
            local v = pPlayer.Pos;
            MessagePlayer( "Vous avez spawner la vehicule ID " + ID + "...", pPlayer );
            local vh = CreateVehicle( ID, Vector( v.x + 5, v.y, v.z ), pPlayer.Angle );
            vh.OneTime=true;
            local vh = GetClosestVehicle( pPlayer );
         }
      }
   }

I test remove Vector doesn't work too..
Title: Re: Remove car burnt
Post by: Thijn on February 06, 2013, 10:55:02 am
pPlayer.Vehicle = veh;

Should work fine.
Title: Re: Remove car burnt
Post by: GuenosNoLife on February 06, 2013, 05:11:19 pm
pPlayer.Vehicle = veh;

Should work fine.
It's for what ?
Title: Re: Remove car burnt
Post by: TheMike on February 08, 2013, 09:07:47 pm
Rule is the problem?