Fix mining face position

Fixed : https://github.com/zeelorenc/sf-cnr/issues/64
Reported-by: Stanislav Gromov ( Daniel-Cortez )
Signed-off-by: Pichai Lertwachirakul ( zekodef )
This commit is contained in:
Pichai Lertwachirakul 2019-10-01 14:22:18 +07:00 committed by GitHub
parent 52fe146e93
commit 44b9b1d1e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,6 +272,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{ {
static static
Float: X, Float: Y, Float: Z; Float: X, Float: Y, Float: Z;
static Float: offset = 0.0;
foreach ( new m : miningrock ) foreach ( new m : miningrock )
{ {
@ -283,7 +284,8 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
if ( g_miningData[ m ] [ E_ORES ] <= 0 ) if ( g_miningData[ m ] [ E_ORES ] <= 0 )
return SendError( playerid, "There are no ores left in this rock." ); return SendError( playerid, "There are no ores left in this rock." );
SetPlayerFacePoint( playerid, X, Y, Z ); GetDynamicObjectPos( g_miningData[ m ] [ E_OBJECT ], X, Y, Z );
SetPlayerFacePoint( playerid, X, Y, offset );
SetPlayerMineOre( playerid, m ); SetPlayerMineOre( playerid, m );
SendServerMessage( playerid, "You're now mining a rock." ); SendServerMessage( playerid, "You're now mining a rock." );
return 1; return 1;