From 60c098abd2dfbd619be5368e433a15b8f05dbf0b Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Thu, 13 Sep 2018 04:03:16 +1000 Subject: [PATCH] move clearchat feature to helpers --- gamemodes/irresistible/cnr/features/visage/poker.pwn | 7 ------- gamemodes/irresistible/helpers.pwn | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/visage/poker.pwn b/gamemodes/irresistible/cnr/features/visage/poker.pwn index 6aa8a59..40ed5af 100644 --- a/gamemodes/irresistible/cnr/features/visage/poker.pwn +++ b/gamemodes/irresistible/cnr/features/visage/poker.pwn @@ -1147,13 +1147,6 @@ stock UpdateInfoTextdrawsForPlayer(playerid) return 1; } -stock Player_Clearchat(playerid) -{ - for(new j = 0; j < 30; j++) - SendClientMessage(playerid, -1, " "); - return 1; -} - public Poker_StartGame(handle, dealer) { TableData[handle][E_TABLE_STING_NEW_GAME] = false; diff --git a/gamemodes/irresistible/helpers.pwn b/gamemodes/irresistible/helpers.pwn index 964e8a9..91fa43e 100644 --- a/gamemodes/irresistible/helpers.pwn +++ b/gamemodes/irresistible/helpers.pwn @@ -13,6 +13,7 @@ #define RandomEx(%0,%1) (random((%1) - (%0)) + (%0)) #define HOLDING(%0) ((newkeys & (%0)) == (%0)) #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) +#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) #define SendUsage(%0,%1) (SendClientMessageFormatted(%0,-1,"{FFAF00}[USAGE]{FFFFFF} " # %1)) #define SendError(%0,%1) (SendClientMessageFormatted(%0,-1,"{F81414}[ERROR]{FFFFFF} " # %1)) #define SendServerMessage(%0,%1) (SendClientMessageFormatted(%0,-1,"{C0C0C0}[SERVER]{FFFFFF} " # %1)) @@ -88,6 +89,15 @@ stock trimString( strSrc[ ] ) strdel( strSrc, 0, strPos ); } +// purpose: clear chat for player +stock Player_Clearchat( playerid ) +{ + for ( new j = 0; j < 30; j ++ ) { + SendClientMessage( playerid, -1, " " ); + } + return 1; +} + // purpose: get distance between players stock Float: GetDistanceBetweenPlayers( iPlayer1, iPlayer2, &Float: fDistance = Float: 0x7F800000, bool: bAllowNpc = false ) {