Liberty Unleashed
Scripting => Script Help => Topic started 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!
-
This was said 95325238 times.
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
-
This was said 95325238 times.
plr.Vehicle.OneTime=true;
Doesn't work,
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)
-
Now work, i remove this on main.nut and create vehicule.nut
I copy the code from LU Wiki :
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?
-
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)
-
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..
-
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;
}
}
}
-
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
-
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):
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!
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..
-
pPlayer.Vehicle = veh;
Should work fine.
-
pPlayer.Vehicle = veh;
Should work fine.
It's for what ?
-
Rule is the problem?