Detect falling bike
#1

I need some help to detect if play fall from a bike...

On this way i detect splat (on bike too sometimes)
But only sometimes and damage is too slow, i want to make like GTA V, sometimes you fall from bike and die...

Someone know how to help me?
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(weaponid == 54) { // splat
		new damage = floatround(amount);
		damage = damage * 5;
		health[playerid] -= damage;
	}
Reply
#2

You're not actually setting the players health when they fall off.
Reply
#3

OnPlayerExitVehicle shouldn't be called, but the player state will change.
Reply
#4

Quote:
Originally Posted by weex
Посмотреть сообщение
I need some help to detect if play fall from a bike...

On this way i detect splat (on bike too sometimes)
But only sometimes and damage is too slow, i want to make like GTA V, sometimes you fall from bike and die...

Someone know how to help me?
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(weaponid == 54) { // splat
		new damage = floatround(amount);
		damage = damage * 5;
		health[playerid] -= damage;
	}
you should have considered that OnPlayerTakeDamage already calls the damage through Float:amount;

You should also consider the speed of your vehicle, the faster the speed the bigger the damage and since you are considering GTA V here comes your bigger challenge.

The roll damage. Each roll have an equivalent damage to the players health on GTA V, it is affected by speed and bodypart that got hit and a tiny little bit of friction, it is not noticeable but falling on dirt ground and on conrete ground had a small difference that really is unnoticeable.
PHP код:
calculate car speedfall speed(including gravitysince GTA V has that) and some other damages that can occur during land and roll
that sounds scary,
scary yes but doable.

goodluck.
Reply
#5

I've tried this:
Код:
	if(weaponid == 54) {
		amount += ((GetPlayerSpeed(playerid, true)));
		new danoqueda = floatround(amount);
		vida[playerid] -= danoqueda;
	}
But damage caused was 11000000...
wtf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)