Game crashing
#3

I did that but I'm getting the same issue. I'm using a timer for some stuff.

PHP код:
 if (PlayerHealth <= 25 && Character[hitid][BrutalM] == && hitid != INVALID_PLAYER_ID && IsPlayerConnected(hitid))
        {
        if(
Character[hitid][BrutalM] == && weaponid 15)
           {
            
GetPlayerPos(hitidBMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2]);
            
Character[hitid][BrutalM] = 1;
            
Character[hitid][CanAccept] = 0;
            
LegHit[hitid] = 0;
            
ApplyAnim(hitid);
            
format(DTextSsizeof(DTextS), "(( %s is currently injured, type /damages %i for more info. ))"GetName(hitid), hitid);
            
label[hitid] = Create3DTextLabel(DTextSCOLOR_REDBMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2], 10.00);
            
Attach3DTextLabelToPlayer(label[hitid], hitid000.7);
            
ClearPlayerWeapons(hitid);
             
SetTimerEx("AllowDamage"3000false"i"hitid);
            
format(strsizeof(str),"%s was brutally wounded by %s.",GetRoleplayName(hitid),GetRoleplayName(playerid));
            
SendAdminsMessage(1COLOR_REDstr); 
PHP код:
forward AllowDamage(playerid);
public 
AllowDamage(playerid)
{
    
AllowDamageMode[playerid] = 1;
    return 
1;

It happens when the player is in AllowDamageMode and takes damage. Here is OnPlayerDamage

PHP код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
    new 
Float:PlayerHealth;
    new 
str[256];
    if(
issuerid != INVALID_PLAYER_ID)
        {
    if(
Character[playerid][BrutalM] == && Character[playerid][Dead] == && issuerid != INVALID_PLAYER_ID)
    {
    
GetPlayerHealth(playeridPlayerHealth);
    if(
amount PlayerHealth) {
    
SetPlayerHealth(playerid20);
    return 
0;
    }
 }
    if(
Character[playerid][BrutalM] == && issuerid != INVALID_PLAYER_ID)
    {
    
GetPlayerHealth(playeridPlayerHealth);
    if(
amount PlayerHealth) {
    
SetPlayerHealth(playerid999);
    return 
1;
    }
}
        if(
Character[playerid][BrutalM] == && AllowDamageMode[playerid] == 1)
        {
        
Delete3DTextLabel(label[playerid]);
        
label2[playerid] = Create3DTextLabel("(( THIS PLAYER IS DEAD ))"COLOR_REDCharacter[playerid][DPosX], Character[playerid][DPosY], Character[playerid][DPosZ], 10.00);
        
Attach3DTextLabelToPlayer(label2[playerid], playerid000.7);
        
Character[playerid][Dead] = 1;
        
Character[playerid][BrutalM] = 0;
        
AllowDamageMode[playerid] = 0;
        
ApplyAnim(playerid);
        
SCM(playeridCOLOR_YELLOW">> You are now dead. You can use /respawnme after 60 seconds to respawn.");
        
Character[playerid][CanSpawn] = 0;
        
RespawnT 60;
        
RespawnEx SetTimer("RespawnTimer"999true);
        
SetTimerEx("RespawnTimer2"60000false"i"playerid);
        
format(strsizeof(str),"%s was finished off by %s.",GetRoleplayName(playerid),GetRoleplayName(issuerid));
        
SendAdminsMessage(1COLOR_LIGHTREDstr);
        } 
Reply


Messages In This Thread
Game crashing - by aoky - 03.07.2017, 01:39
Re: Game crashing - by jlalt - 03.07.2017, 01:51
Re: Game crashing - by aoky - 03.07.2017, 02:01
Re: Game crashing - by jlalt - 03.07.2017, 07:34

Forum Jump:


Users browsing this thread: 1 Guest(s)