From a57114f4c126f05de64dfe3bd494823229734c59 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Thu, 11 Oct 2018 14:06:18 +0100 Subject: [PATCH] textdraw placements --- .../irresistible/cnr/features/_features.pwn | 2 +- .../irresistible/cnr/features/damage_feed.pwn | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/_features.pwn b/gamemodes/irresistible/cnr/features/_features.pwn index 64dbe09..3652200 100644 --- a/gamemodes/irresistible/cnr/features/_features.pwn +++ b/gamemodes/irresistible/cnr/features/_features.pwn @@ -38,7 +38,7 @@ #include "irresistible\cnr\features\crime_reports.pwn" #include "irresistible\cnr\features\fires.pwn" #include "irresistible\cnr\features\car_jacker.pwn" - +#include "irresistible\cnr\features\damage_feed.pwn" // disabled // #include "irresistible\cnr\features\eastereggs.pwn" diff --git a/gamemodes/irresistible/cnr/features/damage_feed.pwn b/gamemodes/irresistible/cnr/features/damage_feed.pwn index 8941418..469684e 100644 --- a/gamemodes/irresistible/cnr/features/damage_feed.pwn +++ b/gamemodes/irresistible/cnr/features/damage_feed.pwn @@ -19,9 +19,11 @@ #define TYPE_GIVEN ( 1 ) #define TYPE_TAKEN ( 2 ) +#define TEXTDRAW_ADDON ( 120.0 ) + /* ** Forwards ** */ -forward OnPlayerFeedUpdate( playerid ); -forward OnPlayerTakenDamageFeed( playerid, issuerid, Float: amount, weaponid, bodypart ); +forward OnPlayerFeedUpdate ( playerid ); +forward OnPlayerTakenDamageFeed ( playerid, issuerid, Float: amount, weaponid, bodypart ); /* ** Variables ** */ enum E_DAMAGE_FEED @@ -57,11 +59,7 @@ hook OnPlayerConnect( playerid ) /* ** Functions ** */ public OnPlayerTakenDamageFeed( playerid, issuerid, Float: amount, weaponid, bodypart ) { - if ( issuerid != INVALID_PLAYER_ID ) - { - AddDamageFeedHit( issuerid, playerid, amount, weaponid, TYPE_GIVEN ); - } - + AddDamageFeedHit( issuerid, playerid, amount, weaponid, TYPE_GIVEN ); AddDamageFeedHit( playerid, issuerid, amount, weaponid, TYPE_TAKEN ); return 1; } @@ -97,7 +95,7 @@ stock UpdateDamageFeed( playerid, bool: modified = false ) /* ** Textdraws ** */ if ( g_damageFeedGivenTD[ playerid] == PlayerText: INVALID_TEXT_DRAW ) { - new PlayerText: handle = CreatePlayerTextDraw( playerid, 200.000000, 340.000000, "_"); + new PlayerText: handle = CreatePlayerTextDraw( playerid, ( 320.0 - TEXTDRAW_ADDON ), 340.0, "_"); if ( handle == PlayerText: INVALID_TEXT_DRAW ) return print("[DAMAGE FEED ERROR]: Unable to create TD (given damage)" ); @@ -116,7 +114,7 @@ stock UpdateDamageFeed( playerid, bool: modified = false ) if ( g_damageFeedTakenTD[ playerid] == PlayerText: INVALID_TEXT_DRAW ) { - new PlayerText: handle = CreatePlayerTextDraw( playerid, 440.000000, 340.000000, "_"); + new PlayerText: handle = CreatePlayerTextDraw( playerid, ( TEXTDRAW_ADDON + 320.0 ), 340.0, "_"); if ( handle == PlayerText: INVALID_TEXT_DRAW ) return print("[DAMAGE FEED ERROR]: Unable to create TD (taken damage)" ); @@ -384,6 +382,6 @@ CMD:feed( playerid, params[ ] ) { p_FeedActive{ playerid } = !p_FeedActive{ playerid }; - SendClientMessageFormatted( playerid, -1, ""COL_GREY"[SERVER]"COL_WHITE" You have %s the damage feed.", p_FeedActive{ playerid } ? ( "toggled" ) : ( "un-toggled" ) ); + SendServerMessage( playerid, "You have %s the damage feed.", p_FeedActive{ playerid } ? ( "toggled" ) : ( "un-toggled" ) ); return 1; } \ No newline at end of file