Новые сообщения · Участники · Правила форума · Поиск · RSS
Страница 1 из 11
Форум samp-ru.org » Pawno » Готовые решения » [Урок] Реалистичный урон от оружие.
[Урок] Реалистичный урон от оружие.
Дата: Пятница, 17.01.2014, 20:13 | Сообщение # 1
vert
PAWN
Пользователь
Сообщений: 422
Статус: Offline
Код работает только на серверах 0.3z.
Для каждого оружие свой урон.
В public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) вставляем:
Код

         new Float:HP;
     GetPlayerHealth(playerid, HP);
     if(issuerid != INVALID_PLAYER_ID)
     {
                 switch(weaponid)
                 {
                     case 22:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-13); // Torso
                    case 4: SetPlayerHealth(playerid, HP-8); // Groin
                    case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-26); // Head
                    }
                         }
                     case 23:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-15); // Torso
                    case 4: SetPlayerHealth(playerid, HP-12); // Groin
                    case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-25); // Head
                    }
                         }
                     case 24:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-23); // Torso
                    case 4: SetPlayerHealth(playerid, HP-20); // Groin
                    case 5: SetPlayerHealth(playerid, HP-15); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-15); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-15); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-15); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-67); // Head
                    }
                         }
                     case 25:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-30); // Torso
                    case 4: SetPlayerHealth(playerid, HP-27); // Groin
                    case 5: SetPlayerHealth(playerid, HP-23); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-23); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-22); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-22); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-70); // Head
                    }
                         }
                     case 27:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-20); // Torso
                    case 4: SetPlayerHealth(playerid, HP-14); // Groin
                    case 5: SetPlayerHealth(playerid, HP-10); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-10); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-9); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-9); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-70); // Head
                    }
                         }
                     case 28:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-10); // Torso
                    case 4: SetPlayerHealth(playerid, HP-8); // Groin
                    case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-20); // Head
                    }
                         }
                     case 29:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-10); // Torso
                    case 4: SetPlayerHealth(playerid, HP-8); // Groin
                    case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-20); // Head
                    }
                         }
                     case 30:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-21); // Torso
                    case 4: SetPlayerHealth(playerid, HP-14); // Groin
                    case 5: SetPlayerHealth(playerid, HP-9); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-9); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-8); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-8); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-40); // Head
                    }
                         }
                     case 31:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-21); // Torso
                    case 4: SetPlayerHealth(playerid, HP-14); // Groin
                    case 5: SetPlayerHealth(playerid, HP-9); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-9); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-8); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-8); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-40); // Head
                    }
                         }
                     case 32:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-10); // Torso
                    case 4: SetPlayerHealth(playerid, HP-8); // Groin
                    case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-20); // Head
                    }
                         }
                     case 33:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-26); // Torso
                    case 4: SetPlayerHealth(playerid, HP-15); // Groin
                    case 5: SetPlayerHealth(playerid, HP-10); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-14); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-10); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-14); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-40); // Head
                    }
                         }
                     case 34:
                         {
                             switch(bodypart)
                    {
                    case 3: SetPlayerHealth(playerid, HP-33); // Torso
                    case 4: SetPlayerHealth(playerid, HP-28); // Groin
                    case 5: SetPlayerHealth(playerid, HP-20); // Left ARM
                    case 6: SetPlayerHealth(playerid, HP-20); // Right ARM
                    case 7: SetPlayerHealth(playerid, HP-20); // Left Leg
                    case 8: SetPlayerHealth(playerid, HP-20); // Right Leg
                    case 9: SetPlayerHealth(playerid, HP-100); // Head
                    }
                         }
                 }
     }


Skype: avg.kazax
VK: vk.com/ukazax
 
Форум samp-ru.org » Pawno » Готовые решения » [Урок] Реалистичный урон от оружие.
Страница 1 из 11
Поиск:

скачать скрипты, вирты самп, моды, читы самп, уроки pawn, античит на сервер, новости gta, мап карты

filterscripts, gamemodes, map scripts, role play, samp 0.3z, drift, скрипты, игровые моды, самп