Jump to content

[ Tutorial ] Damage Settings


Hemingway
 Share

Recommended Posts

Salut!
Daca doresti sa modifici caracteristica unei arme, atunci ai venit in topicul potrivit.

/* define prescurtari ( pentru comoditate ) [ individual ]*/

#define SetPlayerHealth sph
#define GetPlayerHealth gph
#define playerid pi



public 
  OnPlayerTakeDamage(pi, issuerid, Float: amount, weaponid) { 
  
  /*armour */
  new 
    Float: lh
  ; /* variabila care va raspunde de damage */
  gph(pi, lh); /* atribuim variabila catre viata jucatorului, cand impusti in player, i se va modifica procentajul introdus mai jos*/
  switch(weaponid) { 
      
    case 31: /* id arma */
      sph(pi, lh - 4); // [ ( -4 ) - hp-ul playerului scade cu 4 procente ]
      
    /* Daca doresti, poti adauga random damage */
    case 31: {
     switch(random(4)) {
       case 0: 
         sph(pi, lh - 5); 
       case 1: 
         sph(pi, lh - 23); 
       case 2: 
         sph(pi, lh - 10); 
       case 3: 
         sph(pi, lh - 6); 
       /*------------------------------------------ */   
       }
    }
    /* Daca doresti, poti adauga doar damage pe o anumita parte a corpului*/
    case 31: {
        switch (bodypart) // id parte a corpului
        {
            case 3: sph(pi, lh-12);
        }
    }
  }
  return 1;
}

/* Partile corpului id */
3 - Trunchi
4 - Partea abdomenului
5 - Mâna stângă
6 - Mâna dreaptă
7 - Piciorul stâng
8 - Piciorul drept
9 - Cap
/*------------------------------------------ */  

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...