SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/06/2020, 06:14 PM   #1
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default invisible in radar

Hello! Why is the radar icon displayed when it shouldn't be displayed? Only the name and life bars are removed

In OnPlayerSpawn

PHP Code:
    if(PlayerInfo[playerid][Invisible] == 1)
    {
        foreach(new 
iPlayer)
        {
            if(
PlayerInfo[i][Logged] == 1)
            {
                if(
gTeam[playerid][TEAMATT] == 1)
                {
                    
SetPlayerMarkerForPlayer(iplayerid0x4AAEF000);
                }
                else if(
gTeam[playerid][TEAMATT] == 1)
                {
                    
SetPlayerMarkerForPlayer(iplayerid0xF9F94B00);
                }
                else if(
gTeam[playerid][TEAMEV] == 1)
                {
                    
SetPlayerMarkerForPlayer(iplayerid,  0x97E97000);   
                }
                
ShowPlayerNameTagForPlayer(iplayeridfalse);
            }
        }
    } 
Ertouq is offline   Reply With Quote
Old 07/06/2020, 06:23 PM   #2
zampa
Little Clucker
 
Join Date: Dec 2019
Posts: 17
Reputation: 0
Default Re: invisible in radar

Could be a problem with your variable. Add debug to each team.
zampa is offline   Reply With Quote
Old 07/06/2020, 06:31 PM   #3
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default Re: invisible in radar

Fixed. In the "ifs" i have [playerid] when is [i], lol. Thanks anyway
Ertouq is offline   Reply With Quote
Old 07/06/2020, 06:31 PM   #4
Cell_
Big Clucker
 
Join Date: May 2012
Posts: 161
Reputation: 66
Default Re: invisible in radar

Run this code to ensure the code is actually reached:
pawn Code:
if(PlayerInfo[playerid][Invisible] == 1)
    {
        foreach(new i: Player)
        {
            if(PlayerInfo[i][Logged] == 1)
            {
                if(gTeam[playerid][TEAMATT] == 1)
                {
                    SetPlayerMarkerForPlayer(i, playerid, 0x4AAEF000);
                    SendClientMessage(playerid, -1, "Test");
                }
                /*else if(gTeam[playerid][TEAMATT] == 1) // why? its the same check as above...
                {
                    SetPlayerMarkerForPlayer(i, playerid, 0xF9F94B00);
                }*/

                else if(gTeam[playerid][TEAMEV] == 1)
                {
                    SetPlayerMarkerForPlayer(i, playerid,  0x97E97000);
                    SendClientMessage(playerid, -1, "Test");  
                }
                ShowPlayerNameTagForPlayer(i, playerid, false);
            }
        }
    }

Also, do you have SetPlayerColor somewhere else in the code running after (or at regular intervals) after you run this code? Because SetPlayerColor overrides SetPlayerMarkerForPlayer.
Cell_ is offline   Reply With Quote
Old 07/06/2020, 07:04 PM   #5
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default Re: invisible in radar

Quote:
Originally Posted by Cell_ View Post
Run this code to ensure the code is actually reached:
pawn Code:
if(PlayerInfo[playerid][Invisible] == 1)
    {
        foreach(new i: Player)
        {
            if(PlayerInfo[i][Logged] == 1)
            {
                if(gTeam[playerid][TEAMATT] == 1)
                {
                    SetPlayerMarkerForPlayer(i, playerid, 0x4AAEF000);
                    SendClientMessage(playerid, -1, "Test");
                }
                /*else if(gTeam[playerid][TEAMATT] == 1) // why? its the same check as above...
                {
                    SetPlayerMarkerForPlayer(i, playerid, 0xF9F94B00);
                }*/

                else if(gTeam[playerid][TEAMEV] == 1)
                {
                    SetPlayerMarkerForPlayer(i, playerid,  0x97E97000);
                    SendClientMessage(playerid, -1, "Test");  
                }
                ShowPlayerNameTagForPlayer(i, playerid, false);
            }
        }
    }

Also, do you have SetPlayerColor somewhere else in the code running after (or at regular intervals) after you run this code? Because SetPlayerColor overrides SetPlayerMarkerForPlayer.
I forgot to change the [ATT] to [DEF] in the 2 if. No, there's no color change afterwards. Thank you for telling me
Ertouq 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
invisible radar maps? nbx2000 Scripting Help 1 11/12/2018 04:56 AM
Invisible in Radar... Gotham Scripting Help 7 13/10/2016 08:08 AM
Being invisible on the radar rakshith122 Scripting Help 6 05/03/2014 04:01 PM
[Help] NPC's invisible on Radar BMGP Help Archive 14 17/10/2009 12:20 PM
Invisible checkpoint on radar Scoots Help Archive 1 15/03/2009 08:33 PM


All times are GMT. The time now is 07:16 AM.


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