anti collision
#1

Can someone help me on scripting an anti collision? i mean if I fall my health reloads to 100, but if i get a hit it will no reload.

EDIT: i mean if you fall from a high place like from a house roof, your health will demote from 100 to 50 just to make things clear. But No i dont want this, i want a costantly health reload, if you fall and you have 50 (by accident fail) you will get back ur 100 hp.
Reply
#2

Check this page out, it might help you: https://sampwiki.blast.hk/wiki/DisableRe...icleCollisions

If you want to give a radius for it check this page and do some logic with 'If's: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

Here you go, Just an example.
Edit it for youself.
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
   if (
Logged[playerid]==&& issuerid == INVALID_PLAYER_ID)
    {
            new 
Float:hp;
            if(
weaponid == 54GetPlayerHealth(playeridhp), hp+=amountSetPlayerHealth(playeridhp);
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by Ebisu
Посмотреть сообщение
Here you go, Just an example.
Edit it for youself.
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
   if (
Logged[playerid]==&& issuerid == INVALID_PLAYER_ID)
    {
            new 
Float:hp;
            if(
weaponid == 54GetPlayerHealth(playeridhp), hp+=amountSetPlayerHealth(playeridhp);
    }
    return 
1;

OnPlayerTakeDamage is called after damage has been taken. What you have to actually do is check if the player is falling (there are various methods) and if so, set the player's health to 99999 (or blinking).
Reply
#5

Quote:
Originally Posted by Paulice
Посмотреть сообщение
OnPlayerTakeDamage is called after damage has been taken. What you have to actually do is check if the player is falling (there are various methods) and if so, set the player's health to 99999 (or blinking).
Test the code before posting please.
Reply
#6

Quote:
Originally Posted by Ebisu
Посмотреть сообщение
Test the code before posting please.
If you fall from a high height (enough to take all your health away) you will die.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)