From 874a6c821f4140899d092ad264463899872f75a9 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Sun, 2 Dec 2018 17:18:27 +0000 Subject: [PATCH 1/2] should fix http://forum.sfcnr.com/showthread.php?60956-nametags-off-doesn-t-keeps-deactivating --- gamemodes/irresistible/cnr/player.pwn | 3 ++- gamemodes/sf-cnr.pwn | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 165a0b4..32e9c83 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -223,7 +223,8 @@ new p_AimedAtPolice [ MAX_PLAYERS ], bool: p_PassiveModeDisabled [ MAX_PLAYERS char ], //p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... }, - Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID } + Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID }, + bool: p_NameTags [ MAX_PLAYERS char ] = false ; /* ** Getters And Setters** */ diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 0f59327..ab49101 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1501,6 +1501,10 @@ public OnPlayerSpawn( playerid ) CancelEdit( playerid ); HidePlayerHelpDialog( playerid ); + // Name Tags + foreach( new pID : Player ) + ShowPlayerNameTagForPlayer( playerid, pID, p_NameTags{ playerid } ? 1 : 0 ); + // Money Bags if ( p_MoneyBag{ playerid } && p_Class[ playerid ] != CLASS_POLICE ) // SetPlayerAttachedObject( playerid, 1, 1550, 1, 0.131999, -0.140999, 0.053999, 11.299997, 65.599906, 173.900054, 0.652000, 0.573000, 0.594000 ); RemovePlayerAttachedObject( playerid, 1 ), SetPlayerAttachedObject( playerid, 1, 1210, 7, 0.302650, -0.002469, -0.193321, 296.124053, 270.396881, 8.941717, 1.000000, 1.000000, 1.000000 ); @@ -3623,10 +3627,12 @@ CMD:whisper( playerid, params[ ] ) CMD:nametags( playerid, params[ ] ) { if ( strmatch( params, "off" ) ) { - foreach(new i : Player) { ShowPlayerNameTagForPlayer( playerid, i, 0 ); } + foreach( new i : Player ) { ShowPlayerNameTagForPlayer( playerid, i, 0 ); } + p_NameTags{ playerid } = false; SendClientMessage( playerid, 0x84aa63ff, "-> Name tags disabled" ); } else if ( strmatch( params, "on" ) ) { - foreach(new i : Player) { ShowPlayerNameTagForPlayer( playerid, i, 1 ); } + foreach( new i : Player ) { ShowPlayerNameTagForPlayer( playerid, i, 1 ); } + p_NameTags{ playerid } = true; SendClientMessage( playerid, 0x84aa63ff, "-> Name tags enabled" ); } else SendClientMessage( playerid, 0xa9c4e4ff, "-> /nametags [ON/OFF]" ); From f1cac848656553ea4c6f3e1744021c3e4682f104 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Sun, 2 Dec 2018 17:18:43 +0000 Subject: [PATCH 2/2] Revert "should fix http://forum.sfcnr.com/showthread.php?60956-nametags-off-doesn-t-keeps-deactivating" This reverts commit 874a6c821f4140899d092ad264463899872f75a9. --- gamemodes/irresistible/cnr/player.pwn | 3 +-- gamemodes/sf-cnr.pwn | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 32e9c83..165a0b4 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -223,8 +223,7 @@ new p_AimedAtPolice [ MAX_PLAYERS ], bool: p_PassiveModeDisabled [ MAX_PLAYERS char ], //p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... }, - Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID }, - bool: p_NameTags [ MAX_PLAYERS char ] = false + Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID } ; /* ** Getters And Setters** */ diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index ab49101..0f59327 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1501,10 +1501,6 @@ public OnPlayerSpawn( playerid ) CancelEdit( playerid ); HidePlayerHelpDialog( playerid ); - // Name Tags - foreach( new pID : Player ) - ShowPlayerNameTagForPlayer( playerid, pID, p_NameTags{ playerid } ? 1 : 0 ); - // Money Bags if ( p_MoneyBag{ playerid } && p_Class[ playerid ] != CLASS_POLICE ) // SetPlayerAttachedObject( playerid, 1, 1550, 1, 0.131999, -0.140999, 0.053999, 11.299997, 65.599906, 173.900054, 0.652000, 0.573000, 0.594000 ); RemovePlayerAttachedObject( playerid, 1 ), SetPlayerAttachedObject( playerid, 1, 1210, 7, 0.302650, -0.002469, -0.193321, 296.124053, 270.396881, 8.941717, 1.000000, 1.000000, 1.000000 ); @@ -3627,12 +3623,10 @@ CMD:whisper( playerid, params[ ] ) CMD:nametags( playerid, params[ ] ) { if ( strmatch( params, "off" ) ) { - foreach( new i : Player ) { ShowPlayerNameTagForPlayer( playerid, i, 0 ); } - p_NameTags{ playerid } = false; + foreach(new i : Player) { ShowPlayerNameTagForPlayer( playerid, i, 0 ); } SendClientMessage( playerid, 0x84aa63ff, "-> Name tags disabled" ); } else if ( strmatch( params, "on" ) ) { - foreach( new i : Player ) { ShowPlayerNameTagForPlayer( playerid, i, 1 ); } - p_NameTags{ playerid } = true; + foreach(new i : Player) { ShowPlayerNameTagForPlayer( playerid, i, 1 ); } SendClientMessage( playerid, 0x84aa63ff, "-> Name tags enabled" ); } else SendClientMessage( playerid, 0xa9c4e4ff, "-> /nametags [ON/OFF]" );