Добро пожаловать!

Зарегистрировавшись у нас, вы сможете обсуждать, делиться и отправлять личные сообщения другим участникам нашего сообщества.

Зарегистрироваться!
Пользователь
Регистрация
2 Апр 2025
Сообщения
21
на лаунчере арз что то начудили со смертью, устанавливаю игроку 0 хп то он не умирает, как исправить?
 
Пользователь
Регистрация
2 Апр 2025
Сообщения
21
Скорее всего, дело в моде, поменяйте мод
Pawn:
stock AC_SetPlayerHealth(playerid, Float:health) {
    if(!IsPlayerConnected(playerid)) return 0;
   
    new Float:oldHealth;
    GetPlayerHealth(playerid, oldHealth);
   
    if(health < 0.0) health = 0.0;
   
    new Float:maxHealth = GetPlayerMaxHealth(playerid);
    if(health > maxHealth) health = maxHealth;

   
    if(health <= 0.0) {
   
       
        PI[playerid][pHealth] = 0.0;
        SetPlayerHealth(playerid, 0.0);
        ClearAnimations(playerid);
       
        //SpawnPlayer(playerid);
       
        return 1;
    }
   
    SetPlayerHealth(playerid, health);
    PI[playerid][pHealth] = health;
   
    new Float:healthDiff = health - oldHealth;
    if(healthDiff != 0.0) {
        new str[64];
        if(healthDiff > 0.0) {
            format(str, sizeof(str), "+ %.0f HP", healthDiff);
        } else {
            format(str, sizeof(str), "%.0f HP", healthDiff);
        }
        GameTextForPlayer(playerid, str, 500, 1);
    }

    return 1;
}






обработка Onplayerdeath


Pawn:
public OnPlayerDeath(playerid, killerid, reason) {
    if(IsPlayerLogged[playerid] == 0) return Bypasser(playerid, "OnPlayerDeath");


    ApplyAnimation(playerid, "PED", "KO_SHOT_FRONT", 4.1, 0, 1, 1, 1, 0, 1);

    SCMf(playerid, COLOR_RED, "[DEBUG] OnPlayerDeath: playerid %d, killerid: %d, reason: %d", playerid, killerid, reason);
    return 1;
}
 
Пользователь
Регистрация
1 Сен 2022
Сообщения
86
Pawn:
stock AC_SetPlayerHealth(playerid, Float:health) {
    if(!IsPlayerConnected(playerid)) return 0;
   
    new Float:oldHealth;
    GetPlayerHealth(playerid, oldHealth);
   
    if(health < 0.0) health = 0.0;
   
    new Float:maxHealth = GetPlayerMaxHealth(playerid);
    if(health > maxHealth) health = maxHealth;

   
    if(health <= 0.0) {
   
       
        PI[playerid][pHealth] = 0.0;
        SetPlayerHealth(playerid, 0.0);
        ClearAnimations(playerid);
       
        //SpawnPlayer(playerid);
       
        return 1;
    }
   
    SetPlayerHealth(playerid, health);
    PI[playerid][pHealth] = health;
   
    new Float:healthDiff = health - oldHealth;
    if(healthDiff != 0.0) {
        new str[64];
        if(healthDiff > 0.0) {
            format(str, sizeof(str), "+ %.0f HP", healthDiff);
        } else {
            format(str, sizeof(str), "%.0f HP", healthDiff);
        }
        GameTextForPlayer(playerid, str, 500, 1);
    }

    return 1;
}
к чему это?
 
Пользователь
Регистрация
2 Апр 2025
Сообщения
21
Нашёл альтернативное решение, при смерти спавнить игрока)
 
Сверху