SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 18/03/2018, 09:07 AM   #1
Nyzenic
Big Clucker
 
Nyzenic's Avatar
 
Join Date: Sep 2017
Location: Philippines
Posts: 85
Reputation: 43
Lightbulb Custom Player Nametags (with HP/armor bars)

CUSTOM PLAYER NAMETAGS
(this is an old screenshot, the armor bar now shows up above the health bar)


This simple script prevents the famous cleo nametag wallhacks and FakeNick hacks(for fake screenshots/complaints), however this will not affect s*beit nametags

New include version: GitHub
Old filterscript version: Pastebin

NOTE:
  • Make sure to disable the default nametags in your gamemode!
    Place this under OnGameModeInit
    Code:
    ShowNameTags(0);
  • This script removes the default SAMP nametags along with the AFK/paused symbol and replaces them with a 3D text label, so you should use your own AFK detection system if you want to display a player's AFK status.

  • The dot characters don't work well with UTF-8.
    So if you ever encounter this bug

    Just use another encoding method in your text editor/IDE
    >> https://imgur.com/a/elRv1gn
__________________
d-rp.net - coming soon


Last edited by Nyzenic; 04/06/2019 at 12:34 PM.
Nyzenic is offline   Reply With Quote
Old 18/03/2018, 09:36 AM   #2
StrikerZ
High-roller
 
StrikerZ's Avatar
 
Join Date: Mar 2016
Location: Asgard
Posts: 1,054
Reputation: 154
Default Re: Custom Player Nametags

Looks good, but you don't destroy the label when player disconnects.
PHP Code:
if(armour 1.0
This will detect till 1 armour so your getarmourdot function wont work at 0 armor, make it like this
PHP Code:
if(armour 0.0
__________________
StrikerZ is offline   Reply With Quote
Old 18/03/2018, 09:47 AM   #3
Nyzenic
Big Clucker
 
Nyzenic's Avatar
 
Join Date: Sep 2017
Location: Philippines
Posts: 85
Reputation: 43
Default Re: Custom Player Nametags

Quote:
Originally Posted by StrikerZ View Post
Looks good, but you don't destroy the label when player disconnects.
PHP Code:
if(armour 1.0
This will detect till 1 armour so your getarmourdot function wont work at 0 armor, make it like this
PHP Code:
if(armour 0.0
I did that on purpose so that the armour doesn't display when you don't have any(just like in the default nametags)

Quote:
Originally Posted by Debjit View Post
nice, like the health and armor bar.

Ensure that the text labels destroy when player disconnect.
PHP Code:
public OnPlayerDisconnect(playerid)
{
    if(
IsValidDynamic3DTextLabel(cNametag[playerid]))
              
DestroyDynamic3DTextLabel(cNametag[playerid]);
    return 
1;

My bad. Thanks for reminding me!
__________________
d-rp.net - coming soon

Nyzenic is offline   Reply With Quote
Old 18/03/2018, 10:13 AM   #4
StrikerZ
High-roller
 
StrikerZ's Avatar
 
Join Date: Mar 2016
Location: Asgard
Posts: 1,054
Reputation: 154
Default Re: Custom Player Nametags

Quote:
Originally Posted by nnahtann View Post
I did that on purpose so that the armour doesn't display when you don't have any(just like in the default nametags)
Nvm, I misread the code
__________________
StrikerZ is offline   Reply With Quote
Old 18/03/2018, 09:36 AM   #5
Zeth
Huge Clucker
 
Zeth's Avatar
 
Join Date: Feb 2017
Location: Titan
Posts: 431
Reputation: 114
Default Re: Custom Player Nametags

nice, like the health and armor bar.

Ensure that the text labels destroy when player disconnect.
PHP Code:
public OnPlayerDisconnect(playerid)
{
    if(
IsValidDynamic3DTextLabel(cNametag[playerid]))
              
DestroyDynamic3DTextLabel(cNametag[playerid]);
    return 
1;

Zeth is offline   Reply With Quote
Old 18/03/2018, 10:46 AM   #6
HostedPlayerss
Little Clucker
 
HostedPlayerss's Avatar
 
Join Date: Feb 2017
Posts: 32
Reputation: 4
Default Re: Custom Player Nametags

Some time I was looking for a similar FS, Good Work
__________________
HostedPlayerss is offline   Reply With Quote
Old 19/03/2018, 12:08 PM   #7
Eatmysmoke
Little Clucker
 
Eatmysmoke's Avatar
 
Join Date: Jun 2014
Posts: 8
Reputation: 19
Default Re: Custom Player Nametags

Maybe Sob force shows the old nametags? did you try setting a timer at OnFilterScriptInit that runs every 1 second to hide the nametags ShowNameTags(0); ? maybe that will terminate the cheat once and for all
__________________
Eatmysmoke is offline   Reply With Quote
Old 19/03/2018, 12:15 PM   #8
Nyzenic
Big Clucker
 
Nyzenic's Avatar
 
Join Date: Sep 2017
Location: Philippines
Posts: 85
Reputation: 43
Default Re: Custom Player Nametags

Quote:
Originally Posted by Eatmysmoke View Post
Maybe Sob force shows the old nametags? did you try setting a timer at OnFilterScriptInit that runs every 1 second to hide the nametags ShowNameTags(0); ? maybe that will terminate the cheat once and for all
s0b*et also hides the default nametags and creates their own hacked ones.
ShowNameTags(0); every second still won't prevent the cheat.
__________________
d-rp.net - coming soon

Nyzenic is offline   Reply With Quote
Old 19/03/2018, 12:22 PM   #9
Eatmysmoke
Little Clucker
 
Eatmysmoke's Avatar
 
Join Date: Jun 2014
Posts: 8
Reputation: 19
Unhappy Re: Custom Player Nametags

Quote:
Originally Posted by nnahtann View Post
s0b*et also hides the default nametags and creates their own hacked ones.
ShowNameTags(0); every second still won't prevent the cheat.
Oh then that's sad, can't be detected with the current samp features this way.
__________________
Eatmysmoke is offline   Reply With Quote
Old 19/03/2018, 01:56 PM   #10
SeanDenZYR
Big Clucker
 
Join Date: May 2016
Posts: 168
Reputation: 20
Default Re: Custom Player Nametags

you finally released it sire nathan, +rep
SeanDenZYR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Scripts . Error NameTags Player !! nguyendinhdat Scripting Help 11 01/02/2018 02:45 PM
Trying to make player nametags hide when they're crouched. rangerxxll Scripting Help 7 23/10/2015 09:37 AM
Custom player id Brandlax Scripting Help 2 15/11/2012 06:31 PM
See if a player is using our CUSTOM.IMG? TheSpaggiari Scripting Help 4 04/02/2012 07:53 PM


All times are GMT. The time now is 12:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.