Jump to content

[ Tutorial ] Damage Settings


khain.dev

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



Un sistem simplu care merge pt dm etc servere.

 

Edited by Khain Developer
[ Anti Flood Pack ] / Click [ Pugb SA:MP ] Click / [ TD Autorizatie ] Click
[ Created dm zone ] Click / [ Salvare vreme si timp ] Click [ Statistica a serverului ] Click
[ Sistema duel ] Click [ TD Registrare/Autorizatie ] Click [ Sistema kill/killed by ] Click
[ Sistema data si ora Click /  [ GM Anticheat ] Click   /  [ Schimbarea mersului ] Click
[ Save Camera ] Click  [ Sitema Concurs ] Click [ Projector pentru elicopter ] Click /
[ DM Zona ] Click / [ Folosirea textelor lungi ] Click / [Khain RPG] Click  / Antisobeit Click
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.