Hi, I wanted to request a function where, for example, if you fall into the water, they give you a weapon or a vehicle.
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
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.
sorry, I do not know much about programming on vcmp is that I'm 14 years old
Could you give me an example?
I know people who started programming at 12. lol
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.
And i am 12 started scripting 4 months ago
I'm Start Scripting in 2 Month Ago ;D
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