fall into the water :v

Started by Kid_Buu, Jan 06, 2018, 07:36 PM

Previous topic - Next topic

Kid_Buu

Hi, I wanted to request a function where, for example, if you fall into the water, they give you a weapon or a vehicle.

VK.Jona83Killer

#1
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.



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

Xmair

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.



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.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Kid_Buu

sorry, I do not know much about programming on vcmp is that I'm 14 years old

Could you give me an example?

Xmair

I know people who started programming at 12. lol

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Zone_Killer

Bohemia Is God Of Punjabi Rap
Yo Yo Honey Singh tou chutiya hai

VK.Jona83Killer

I was 11 years a month ago

and look at my server papu

!

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.

Discord: zeus#5155

Retard

And i am 12 started scripting 4 months ago
Just another retard roaming around.

Mohamed Boubekri

I'm Start Scripting in 2 Month Ago ;D
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mötley

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