19.01.2014, 11:45
Seems many people complaining about it, this code below should disable the player who is tabbed/paused from dying.
pawn Код:
#define STATE_ONPLAYERCONNECT (0)
#define STATE_ONPLAYERDISCONECT (1)
#define STATE_ONPLAYERUPDATE (2)
new stock
PlayerState[ MAX_PLAYERS ], StartOPUTick[ MAX_PLAYERS ];
public OnPlayerConnect(playerid) return PlayerState[ playerid ] = STATE_ONPLAYERCONNECT, true;
public OnPlayerDisconnect(playerid, reason) return PlayerState[ playerid ] = STATE_ONPLAYERDISCONECT, true;
public OnPlayerUpdate(playerid) return PlayerState[ playerid ] = STATE_ONPLAYERUPDATE, StartOPUTick[ playerid ] = gettime(), true;
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if( hittype == BULLET_HIT_TYPE_PLAYER && PlayerState[ hitid ] == STATE_ONPLAYERUPDATE && ( gettime() - 10 >= StartOPUTick[ hitid ]) ) return false;
else return true;
}