Setting a timer
#1

PHP код:
if (PlayerHealth <= 25)
        {
        if(
Character[hitid][BrutalM] == && playerid != INVALID_PLAYER_ID)
           {
            
GetPlayerPos(hitidBMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2]);
            
Character[hitid][BrutalM] = 1;
            
Character[hitid][CanAccept] = 0;
            
LegHit[hitid] = 0;
            
ApplyAnim(hitid);
            
AllowDamage[playerid] = 1;
            
SetTimerEx("AllowDamageTimer"3000false"i"playerid);
            
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);
            
format(strsizeof(str),"%s was brutally wounded by %s.",GetRoleplayName(hitid),GetRoleplayName(playerid));
            
SendAdminsMessage(1COLOR_REDstr); 
This is the main bit. It's not putting him into BrutalM = 1; because damage gets returned as 0; due to the AllowDamage function.
PHP код:
AllowDamage[playerid] = 1;
      
SetTimerEx("AllowDamageTimer"3000false"i"playerid); 
PHP код:
public AllowDamageTimer(playerid)
{
    
AllowDamage[playerid] = 1;

PHP код:
    if(AllowDamage[hitid] == 1)
    {
    return 
1;
     }
    if(
AllowDamage[hitid] == 0)
    {
    return 
0;
    } 
How else can I do this to make it so when BrutalM = 1; he can't take damage for 3 seconds?
Reply


Messages In This Thread
Setting a timer - by aoky - 27.06.2017, 22:06
Re: Setting a timer - by NaS - 27.06.2017, 23:30

Forum Jump:


Users browsing this thread: 1 Guest(s)