Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: ! on Dec 15, 2016, 06:52 AM

Title: /fix (with checking hp and tyres)
Post by: ! on Dec 15, 2016, 06:52 AM
Created this topic only for newbie as there is not any topic similar to this i mean
/fix with checking vehicle tyres. :) ;D

I have checked this only on infernus(4 tyres)

//Add this in function onPlayerCommand( player, cmd, text )
if ( cmd == "fix" )
{
if ( !player.Vehicle ) MessagePlayer( "You must be in the vehicle you want to fix.", player );
else if ( ( player.Vehicle.Health == 1000 )  && ( player.Vehicle.GetTyre(0) == 0 || player.Vehicle.GetTyre(1) == 0 || player.Vehicle.GetTyre(2) == 0 || player.Vehicle.GetTyre(3) == 0 ) ) MessagePlayer( "Your vehicle health is at maximum.", player );
else
{
player.Vehicle.Fix();
MessagePlayer( "Vehicle fixed.", player );
}
}
Title: Re: /fix (with checking health and tyres)
Post by: MatheuS on Dec 15, 2016, 08:31 AM
You're forgetting some " in MessagePlayer.
Title: Re: /fix (with checking health and tyres)
Post by: ! on Dec 15, 2016, 08:35 AM
Quote from: MatheuS on Dec 15, 2016, 08:31 AMYou're forgetting some " in MessagePlayer.
Oh thx for informing mistakenly removed during removing colour constants -_-