YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

y_classes bug when player die.

Open orsx opened this issue 3 years ago • 4 comments

I'm having a problem with y_classes, when the player dies, 'OnPlayerDeath' is called, but the life bar keeps blinking, and I can still move the character.

PS: I'm using OS Linux, not been tested on windows, but I believe the same bug also occurs.

Code to reproduce that.

#include <a_samp>

#include <YSI_Visual\y_classes>
#include <YSI_Coding\y_hooks>

#define YSI_NO_HEAP_MALLOC
#define _YSI_NO_VERSION_CHECK


main() {
    print("Starting");

}

hook OnGameModeInit() {

    Class_Add(123, -2187.0582, 706.6134, 53.8905, 262.5324, WEAPON_GRENADE, 5);

    Class_Add(169, -2187.0582, 706.6134, 53.8905, 262.5324, WEAPON_GRENADE, 5);
}

hook OnPlayerRequestClass(playerid, classid) {
    SetPlayerCameraPos(playerid, 484.9201, -11.7566, 1000.6796);
    SetPlayerCameraLookAt(playerid, 489.4576, -15.1996, 1000.6796);

    SetPlayerPos(playerid, 489.4576, -15.1996, 1000.6796);
    SetPlayerInterior(playerid, 17);
    SetPlayerFacingAngle(playerid, 51.5555);

    ApplyAnimation(playerid, "Dancing", "Dan_Loop_A", 5.0, 1, 0, 0, 0, 0);
    return Y_HOOKS_CONTINUE_RETURN_1; // Without this, player die, but return to Class Selection.
}

hook OnPlayerSpawn(playerid) {
    SetPlayerInterior(playerid, 0);
}

Video reproducing the "bug"

Video

orsx avatar Jun 29 '21 21:06 orsx

@Y-Less, Can help me? Please

orsx avatar Jul 01 '21 19:07 orsx

#define YSI_NO_HEAP_MALLOC
#define _YSI_NO_VERSION_CHECK

These should be defined before including any of YSI scripts.

DEntis-T avatar Aug 02 '21 14:08 DEntis-T

By the way. In the video, you died after you killed yourself with third grenade. Maybe your health was magically at 1 or 2 hp so it started blinking.

DEntis-T avatar Aug 02 '21 14:08 DEntis-T

And, yeah I am not Y_Less but I was like let's just hop in here LOL

DEntis-T avatar Aug 02 '21 14:08 DEntis-T