About /dm1 - Disable Player See And Player Arrow When they are not in DM
#1

Hey i like when player teleport dm and choose a team yeah it will set the color
i want it only inside the dm will see the color and see the player

i mean it when player is not dm and on dm area the player must be disappear and cant see the Player Arrow

How can i do that?

Heres My Code

pawn Код:
if(strcmp("/dm1", cmdtext, true, 10) == 0)
    {
        if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
        if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You are already in DM Area");
        SetPVarInt(playerid, "skin", GetPlayerSkin(playerid));
        SetPVarInt(playerid, "InDm", 1);
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s has teleported to {FFFFFF}Deathmatch Area 1 - DM Area 1 (/dm1)",pName);
        SendClientMessageToAll(COLOR_RED, string);
        SendClientMessage(playerid, COLOR_GREEN,"Welcome To DM Area");
        GameTextForPlayer(playerid,"~w~Welcome To ~r~Death ~g~Match ~y~Area 1",3000,3);
        SetPlayerPos(playerid,1050.6841,938.1620,18.5841);
        SetPlayerFacingAngle(playerid,143);
        ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Choose Your Team!","Team Xtreme Stunting Mafia\nTeam Xtreme Stunting Killers","Choose","Exit");
        return 1;
    }
Hope you help me
Reply
#2

So far I understood:
Everyone in your "DeathMatch Area", should Not be able to see the player markers(Map Icons) of anyone in the area.
Is that correct or do you mean something else?

Quote:
Originally Posted by lyrics
Посмотреть сообщение
i mean it when player is not dm and on dm area the player must be disappear and cant see the Player Arrow
About this line I do not understand what you are trying to say exactly..

Perhaps give us a few example with Red_Player, Blue_Player, Green_Player, Etc.
This will possibly become easier for all the readers to understand your situation and help you faster.
Reply
#3

Quote:
Originally Posted by Improvement™
Посмотреть сообщение
So far I understood:
Everyone in your "DeathMatch Area", should Not be able to see the player markers(Map Icons) of anyone in the area.
Is that correct or do you mean something else?


About this line I do not understand what you are trying to say exactly..

Perhaps give us a few example with Red_Player, Blue_Player, Green_Player, Etc.
This will possibly become easier for all the readers to understand your situation and help you faster.
I was meaning that when player is not inside of DM he/she can not see the player and player arrow color

when he/she is on inside dm he can see the player and the player arrow

thats what i mean
Reply
#4

Quote:
Originally Posted by lyrics
Посмотреть сообщение
I was meaning that when player is not inside of DM he/she can not see the player and player arrow color

when he/she is on inside dm he can see the player and the player arrow

thats what i mean
You can do this by using the following functions/callbacks:
OnPlayerUpdate
IsPlayerInRangeOfPoint
SetPlayerMarkerForPlayer



Here's an example:
pawn Код:
public OnPlayerUpdate(playerid)
{
    //IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
    if(IsPlayerInRangeOfPoint(playerid, 100.0, 200.00, 200.00, 25.00))
    {
        // Make player 42 see player 1 as a red marker
        SetPlayerMarkerForPlayer( 42, 1, 0xFF0000FF );
 
        // Make the players marker an invisible white (chat will be white but marker will be gone).
        SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );
 
        // Make the players marker invisible to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used:
        SetPlayerMarkerForPlayer( 42, 1, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );
 
        // Make the players marker fully opaque (solid) to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used:
        SetPlayerMarkerForPlayer( 42, 1, ( GetPlayerColor( 1 ) | 0x000000FF ) );
    }
}
IMPORTANT NOTE: This is just an example, I'm not telling you that this is the best option.

I hope this helps.

Kind Regards,
Improvement™
Reply
#5

is there anyway by putting on my /dm1 command

if player go there they will see the DM Match!

So is there heres the code if you need it

pawn Код:
if(strcmp("/dm1", cmdtext, true, 10) == 0)
    {
        if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
        if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You are already in DM Area");
        SetPVarInt(playerid, "skin", GetPlayerSkin(playerid));
        SetPVarInt(playerid, "InDm", 1);
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s has teleported to {FFFFFF}Deathmatch Area 1 - DM Area 1 (/dm1)",pName);
        SendClientMessageToAll(COLOR_RED, string);
        SendClientMessage(playerid, COLOR_GREEN,"Welcome To DM Area");
        GameTextForPlayer(playerid,"~w~Welcome To ~r~Death ~g~Match ~y~Area 1",3000,3);
        SetPlayerPos(playerid,1050.6841,938.1620,18.5841);
        SetPlayerFacingAngle(playerid,143);
        ShowPlayerDialog(playerid,9,DIALOG_STYLE_LIST,"Choose Your Team!","Team Xtreme Stunting Mafia\nTeam Xtreme Stunting Killers","Choose","Exit");
        return 1;
    }
Reply
#6

Quote:
Originally Posted by lyrics
Посмотреть сообщение
is there anyway by putting on my /dm1 command
You cannot put callbacks in functions..
OnPlayerUpdate is a callback (just like example: OnPlayerCommandText, OnPlayerDisconnect, OnPlayerDeath).
If you want to know what OnPlayerUpdate does, then click on the OnPlayerUpdate Link above.

Click on the link below to view all callbacks:
https://sampwiki.blast.hk/wiki/Category:Scripting_Callbacks
Reply
#7

Never mind i will not put that system

Reply
#8

So how I basicaly understood is, that when you are in the deathmatch you can see the player marker on the mini map and when you are outside you can't?

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerMarkers
If so just create:


If(inDM == 1 )
{
ShowPlayerMarkers(1);
}
else
{
//nothing here, that means the markers don't show
//or just
ShowPlayerMarkers(0);
}
Reply
#9

So if youre in dm zone, only the ppl who are in the dm zone will see your arrow. And if youre back in the "normal world", you can only see the arrows from the ppl who are in the "normal world"?
If so, just add a virtualworld to the dm zone. You cant see anyone's marker if youre not in the same virtualworld.
Example:
Im in virtualworld 0 (normal world)
You are in virtualworld 1 (dm zone)
We cant see each other
Im in virtualworld 1 (dm zone)
You are in virtualworld 1 (dm zone)
We can see each other
Reply
#10

Quote:
Originally Posted by Roperr
Посмотреть сообщение
So how I basicaly understood is, that when you are in the deathmatch you can see the player marker on the mini map and when you are outside you can't?

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerMarkers
If so just create:


If(inDM == 1 )
{
ShowPlayerMarkers(1);
}
else
{
//nothing here, that means the markers don't show
//or just
ShowPlayerMarkers(0);
}
where should i put this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)