PartyInfo[InParty[playerid]][pMember][X] is storing the PlayerID of the party members. This is a script I'll be releasing here because the community helped me a lot and yet I'm having troubles with it.
The script has to work because if I enable the markers and you see everyone it changes the color of the marker so the script has to work.
pawn Код:
stock ShowMarkers(playerid)
{
if(PartyInfo[InParty[playerid]][pMember][1]!=-1&&PartyInfo[InParty[playerid]][pMember][1]!=playerid)
{
SetPlayerMarkerForPlayer(playerid, PartyInfo[InParty[playerid]][pMember][1], COLOR_RED);
SendClientMessage(playerid,-1,"Color Red");
}
if(PartyInfo[InParty[playerid]][pMember][2]!=-1&&PartyInfo[InParty[playerid]][pMember][2]!=playerid)
{
SetPlayerMarkerForPlayer(playerid,PartyInfo[InParty[playerid]][pMember][2],COLOR_GREEN);
SendClientMessage(playerid,-1,"Color Green");
}
if(PartyInfo[InParty[playerid]][pMember][3]!=-1&&PartyInfo[InParty[playerid]][pMember][3]!=playerid)
{
SetPlayerMarkerForPlayer(playerid, PartyInfo[InParty[playerid]][pMember][3], COLOR_BLUE);
SendClientMessage(playerid,-1,"Color Blue");
}
if(PartyInfo[InParty[playerid]][pMember][4]!=-1&&PartyInfo[InParty[playerid]][pMember][4]!=playerid)
{
SetPlayerMarkerForPlayer(playerid, PartyInfo[InParty[playerid]][pMember][4], COLOR_YELLOW);
SendClientMessage(playerid,-1,"Color Yellow");
}
if(PartyInfo[InParty[playerid]][pMember][5]!=-1&&PartyInfo[InParty[playerid]][pMember][5]!=playerid)
{
SetPlayerMarkerForPlayer(playerid, PartyInfo[InParty[playerid]][pMember][5], COLOR_PURPLE);
SendClientMessage(playerid,-1,"Color Purple");
}
SendClientMessage(playerid,-1,"End");
}
Script runs through because I get the ,,End" message too.
EDIT: Tried adding this to onplayerconnect, still not working.
Color Invisible is defined: #define COLOR_INVISIBLE 0xFFFFFF00
pawn Код:
SetPlayerColor(playerid,COLOR_INVISIBLE);
for(new i =0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetPlayerMarkerForPlayer(playerid, i, COLOR_INVISIBLE);
SetPlayerMarkerForPlayer(i, playerid, COLOR_INVISIBLE);
}
}
Edit 2.: It seems to work if I set a timer to 1.5 - 3 seconds and it makes all the players ,,invisible" after spawning. Any better solution to this?