Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Fjose on Dec 01, 2014, 01:53 AM

Title: Player Marker
Post by: Fjose on Dec 01, 2014, 01:53 AM
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.

Title: Re: Player Marker
Post by: Honey on Dec 01, 2014, 04:49 AM
I think this could be done by player.Team, I've done this before but Don't remember how :/
Title: Re: Player Marker
Post by: . on Dec 01, 2014, 12:37 PM
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.
Title: Re: Player Marker
Post by: Thijn on Dec 01, 2014, 04:47 PM
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.
Title: Re: Player Marker
Post by: Fjose on Dec 01, 2014, 09:38 PM
Sorry guys,  I forgot a detail.. I was talking about is visible on radar for only players with same skin

Edited.
Title: Re: Player Marker
Post by: . on Dec 01, 2014, 10:02 PM
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.
Title: Re: Player Marker
Post by: Fjose on Dec 03, 2014, 11:04 PM
Dev/Mod(s) have something to say?
Title: Re: Player Marker
Post by: MatheuS on Dec 30, 2014, 05:25 AM
Reviving the topic .

I need to know this also