Player Marker

Started by Fjose, Dec 01, 2014, 01:53 AM

Previous topic - Next topic

Fjose

I was seeing some functions but I can't find a function for hide players only with a different skin. player can see others with same skin but not with a different skin, that's my idea.


Honey

I think this could be done by player.Team, I've done this before but Don't remember how :/

.

#2
I believe this can be achieved by setting different worlds. The following code might be very inefficient because it's re-grouping the players on each spawn. But it's an example and frankly I'm not even sure it works :D

function onPlayerSpawn(i_player)
{
// Create a variable to count the worlds
local _counter = 0;
// Table to group the players with the same skin
local _groups = {};
// Loop through the online players (in reverse order)
for (local id = GetMaxPlayers()-1; id >= 0; id--)
{
// Grab the player by it's ID
local player = FindPlayer(id);
// See if we have a valid player
if (player == null) continue;
// See if there's anyone else with this skin and add them to the group
else if (_groups.rawin(player.Skin)) player.World = _groups.rawget(player.Skin);
// There's no one else using this script so let's create the group
else _groups.rawset(player.Skin, _counter++);
}
}

LET ME KNOW IF IT WORKS SO THAT I CAN ADD IT TO MY SNIPPETS.
.

Thijn

The above snippet would partially work. When a player gets first assigned a group it isn't setting the world for that player.
Also, I'm not entirely sure world 0 would work the way world 1 works.

Fjose

#4
Sorry guys,  I forgot a detail.. I was talking about is visible on radar for only players with same skin

Edited.

.

Depending on how fast is the Blips implementation I could arrange for something like that. If the Blip position doesn't take much resources to get updated frequently (every 1,2,3 etc. seconds) then I could implement something that could work out (eventually). Let's wait for a dev/mod to shed some light on the subject and then I'll proceed with an example or a full snippet.
.

Fjose

Dev/Mod(s) have something to say?

MatheuS

Reviving the topic .

I need to know this also
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.