Fixed turf bug

This commit is contained in:
Dusan 2019-05-31 10:36:46 +02:00
parent 71b4d4af8f
commit a3be94a4b8

View File

@ -285,14 +285,7 @@ hook OnPlayerEnterDynArea( playerid, areaid )
new new
first_turf = Turf_GetFirstTurf( playerid ); first_turf = Turf_GetFirstTurf( playerid );
if ( ! IsPlayerMovieMode( playerid ) ) CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf );
{
if ( first_turf == INVALID_GANG_TURF )
return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" );
// if ( p_GangID[ playerid ] != INVALID_GANG_ID && g_gangTurfData[ first_turf ] [ E_OWNER ] == INVALID_GANG_ID ) ShowPlayerHelpDialog( playerid, 2000, "You can take over this turf by typing ~g~/takeover" );
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(%s)~n~~w~~h~%s", g_gangTurfData[ first_turf ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ? ( "FACILITY" ) : ( "TERRITORY" ), ReturnGangName( g_gangTurfData[ first_turf ] [ E_OWNER ] ) ) );
}
} }
return Y_HOOKS_CONTINUE_RETURN_1; return Y_HOOKS_CONTINUE_RETURN_1;
} }
@ -346,6 +339,21 @@ hook OnPlayerLeaveDynArea( playerid, areaid )
return Y_HOOKS_CONTINUE_RETURN_1; return Y_HOOKS_CONTINUE_RETURN_1;
} }
public OnPlayerUpdateGangZone( playerid, zoneid )
{
if ( ! IsPlayerMovieMode( playerid ) )
{
if ( zoneid == INVALID_GANG_TURF )
return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" );
if ( p_GangID[ playerid ] != INVALID_GANG_ID && g_gangTurfData[ zoneid ] [ E_OWNER ] == INVALID_GANG_ID )
ShowPlayerHelpDialog( playerid, 6000, "You can take over this turf by typing ~g~/takeover" );
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(%s)~n~~w~~h~%s", g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ? ( "FACILITY" ) : ( "TERRITORY" ), g_gangTurfData[ zoneid ] [ E_OWNER ] == -1 ? ( "Uncaptured" ) : ( ReturnGangName( g_gangTurfData[ zoneid ] [ E_OWNER ] ) ) ) );
}
return 1;
}
/* ** Commands ** */ /* ** Commands ** */
CMD:takeover( playerid, params[ ] ) CMD:takeover( playerid, params[ ] )
{ {