SA-MP Forums Archive
[HELP] How to.... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] How to.... (/showthread.php?tid=275566)



[HELP] How to.... - Huxley - 10.08.2011

Hello.

I would like to ask about How do I make a player's visibility on radar to be invisible after they selected a choice via Dialog?

If you help,thanks.I would really appreciate your help.

Sincerely,
Huxley.


Re: [HELP] How to.... - emokidx - 10.08.2011

well i dont know very much but its something regarding :
pawn Код:
ShowPlayerMarkers(0);
to disable


Re: [HELP] How to.... - s0nic - 10.08.2011

Here ya go..
So you can set the color first then place this snippet right after..
Though i remember there was another way..but it should work in the way you need it too..
pawn Код:
SetPlayerColor(playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));//invisible marker and keep the player's color at the same time
And im assuming in the dialog they are choosing their color? Or what..


Re: [HELP] How to.... - Anzhelov - 10.08.2011

Just add one line under "OnGameModeInit()"
To enable = ShowPlayerMarkers(1);
To disable = ShowPlayerMarkers(0);

--- Same goes to the name tags, if you want to disable/enable them. ---
To enable = ShowNameTags(1);
To disable = ShowNameTags(0);


Re: [HELP] How to.... - shaikh007 - 10.08.2011

Here is the code originally from my own server

pawn Код:
CMD:marker(playerid, params[])
{
    ShowPlayerDialog(playerid,1240,DIALOG_STYLE_LIST,"Map Markers","Show Marker\nHide Marker","Ok", "Cancel");
    return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1240:
        {
            if(!response)
            {
            SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
            return 1;
            }

            switch(listitem)
            {
                case 0:
                {
                    for(new i=0; i<MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) ); //from wiki
                    return SendClientMessage(playerid, 0x80FF00AA, "Your marker is now seeable for everyone.");
                }
                case 1:
                {
                    for(new i=0; i<MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) ); //from wiki
                    return SendClientMessage(playerid, 0x80FF00AA, "Your marker is now invisible for everyone.");
                }
            }
        }
    }
    return 1;
}
I think this will help this code was made by Jeffry he made me that code but without dialog i converted into dialog for you.