Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kid_Buu on Jan 06, 2018, 07:36 PM

Title: fall into the water :v
Post by: Kid_Buu on Jan 06, 2018, 07:36 PM
Hi, I wanted to request a function where, for example, if you fall into the water, they give you a weapon or a vehicle.
Title: Re: fall into the water :v
Post by: VK.Jona83Killer on Jan 07, 2018, 02:57 AM
I'm sure you want a swimming system.
Well, with this little function you can change it to give you a vehicle.
As for example in American Roleplay.

(https://i62.servimg.com/u/f62/19/72/23/95/gta-vc11.jpg)

Well, here the code

function onPlayerHealthChange( player, oldhp, newhp )
{
if ( player.Pos.z <= GetWaterLevel() ) return MessagePlayer(""Learn to swim men!,player);
}

Note: I have not tried it, it may have errors
Title: Re: fall into the water :v
Post by: Xmair on Jan 07, 2018, 05:50 AM
Quote from: VK.Jona83Killer on Jan 07, 2018, 02:57 AMI'm sure you want a swimming system.
Well, with this little function you can change it to give you a vehicle.
As for example in American Roleplay.

(https://i62.servimg.com/u/f62/19/72/23/95/gta-vc11.jpg)

Well, here the code

function onPlayerHealthChange( player, oldhp, newhp )
{
if ( player.Pos.z <= GetWaterLevel() ) return MessagePlayer(""Learn to swim men!,player);
}

Note: I have not tried it, it may have errors

Don't use this if you want real lag in your server lol. Just use a timer to check it for all players every x seconds.
Title: Re: fall into the water :v
Post by: Kid_Buu on Jan 07, 2018, 05:57 PM
sorry, I do not know much about programming on vcmp is that I'm 14 years old

Could you give me an example?
Title: Re: fall into the water :v
Post by: Xmair on Jan 08, 2018, 02:51 PM
I know people who started programming at 12. lol
Title: Re: fall into the water :v
Post by: Zone_Killer on Jan 08, 2018, 03:10 PM
Quote from: Kid_Buu on Jan 07, 2018, 05:57 PMI'm 14 years old
I'm also 14 years old.
Title: Re: fall into the water :v
Post by: VK.Jona83Killer on Jan 08, 2018, 06:02 PM
I was 11 years a month ago

and look at my server papu
Title: Re: fall into the water :v
Post by: ! on Feb 05, 2018, 11:07 AM
And there I am 7 years old started scripting 3 years ago and now take a look at Grand Theft Auto San Ferrio.
 ;D ;D ;D :P
.
.
.
Yes it is 7.
Title: Re: fall into the water :v
Post by: Retard on Feb 05, 2018, 12:12 PM
And i am 12 started scripting 4 months ago
Title: Re: fall into the water :v
Post by: Mohamed Boubekri on Feb 05, 2018, 12:34 PM
I'm Start Scripting in 2 Month Ago ;D
Title: Re: fall into the water :v
Post by: Mötley on Feb 05, 2018, 01:15 PM
You could probably do this on

onPlayerHeathChange
function onPlayerHealthChange( player, lastHP, newHP ) {
     if ( lastHP > newHP ) {
       if ( player.Pos.z <= GetWaterLevel() ) {
          local vehicle = CreateVehicle( 136, player.Pos, player.Angle, 1, 2);
          player.Vehicle = vehicle;
          return true;
       }
     }
}
This was scripted at random, and with just thoughts, not tested