Jump to content

Recommended Posts

Posted (edited)

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
/*------------------------------------------ */  



Un sistem simplu care merge pt dm etc servere.

 

Edited by Khain Developer

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
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.