fix safe bug
applyanimation sometimes is not working. it makes safe bug if players are not near safe
This commit is contained in:
parent
19400a4a08
commit
1ed11d8424
@ -228,8 +228,15 @@ hook OnProgressCompleted( playerid, progressid, params )
|
|||||||
Float: distance = distanceFromSafe( playerid, robberyid )
|
Float: distance = distanceFromSafe( playerid, robberyid )
|
||||||
;
|
;
|
||||||
|
|
||||||
if ( robberyid != -1 && 0.0 < distance <= 2.5 )
|
if ( robberyid != -1 )
|
||||||
{
|
{
|
||||||
|
if ( !( 0.0 < distance <= 2.5 )) {
|
||||||
|
// applyanimation sometimes is not working. they can move out. just revert safe and players' state.
|
||||||
|
RemovePlayerAttachedObject( playerid, 0 );
|
||||||
|
g_robberyData [ params ] [ E_STATE ] = STATE_NONE;
|
||||||
|
p_UsingRobberySafe [ playerid ] = -1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if ( !g_robberyData[ robberyid ] [ E_ROBBED ] && !IsValidDynamicObject( g_robberyData[ robberyid ] [ E_SAFE_MONEY ] ) )
|
if ( !g_robberyData[ robberyid ] [ E_ROBBED ] && !IsValidDynamicObject( g_robberyData[ robberyid ] [ E_SAFE_MONEY ] ) )
|
||||||
{
|
{
|
||||||
static
|
static
|
||||||
@ -910,4 +917,4 @@ stock GetPlayerDrillStrength( playerid ) return p_drillStrength[ playerid ];
|
|||||||
|
|
||||||
stock SetPlayerDrillStrength( playerid, strength ) {
|
stock SetPlayerDrillStrength( playerid, strength ) {
|
||||||
p_drillStrength[ playerid ] = strength;
|
p_drillStrength[ playerid ] = strength;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user