Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Spiller

#31
Support / Re: Question about player's marker
Nov 27, 2020, 03:45 AM
Quote from: Kenneth Law on Nov 27, 2020, 12:55 AMI've tried the way similar to the codes you gave, but there is still another problem which is the limitation of number of markers you can create in VCMP server. It has a restriction of 100. Give the example that 10 players are in server, in which I might have to create 9 markers for each player. That's totally 90 markers already. It could be insufficient for me to use.

Totally, that's why I mentioned this is not much of a solution.
Besides Doom already stated that this can't be done exactly how you want it to be.
#32
Support / Re: Question about player's marker
Nov 26, 2020, 11:15 AM
This is not much of a solution but you can do something like this. (but at what cost?)

https://youtu.be/Gzskg2PrZT0

Code
SetShowOnRadar(false);
enum MARKER_CONFIG
{
RADIUS = 50, // Radius in which markers will be visible
UPDATE_TIME = 1000 // Markers are updated at this rate (ms)
};

PlayerIDs <- [];
MarkerData <- array(GetMaxPlayers(), null);

class MarkerClass
{
playerID = 0;
Marker = null;

Markers = null;
HasMarker = null;

constructor(pID)
{
this.playerID = pID;

Markers = [];
HasMarker = [];
}

function HasMarkerFor(pID)
{
if(this.HasMarker.find(pID) == null)
return false;

return true;
}

function CreateMarkerFor(pID)
{
local player = ::FindPlayer(this.playerID), target = ::FindPlayer(pID);
if(!player || !target) return 1;

local NewMarker = ::CreateMarker(player.UniqueWorld, target.Pos, 3, target.Colour, 0);
this.Markers.append(NewMarker);
this.HasMarker.append(pID);
}

function RemoveMarkerFor(pID)
{
local Position = this.HasMarker.find(pID);
if(Position == null) return 1;

::DestroyMarker(this.Markers[Position]);
this.Markers.remove(Position);
this.HasMarker.remove(Position);
}

function Destroy()
{
foreach(val in this.Markers)
::DestroyMarker(val);

this = null;
}
}

function MarkerHandler()
{
foreach(i, Entity in PlayerIDs)
{
local player = FindPlayer(Entity);
if(player)
{
foreach(Entity_ in PlayerIDs)
{
if(Entity_ == Entity)
continue;

if(CheckRadius(Entity, Entity_))
{
if(!MarkerData[Entity].HasMarkerFor(Entity_))
MarkerData[Entity].CreateMarkerFor(Entity_);
}
else
{
if(MarkerData[Entity].HasMarkerFor(Entity_))
MarkerData[Entity].RemoveMarkerFor(Entity_);
}
}

foreach(i, Marker in MarkerData[Entity].Markers)
{
DestroyMarker(Marker);

local target = FindPlayer(MarkerData[Entity].HasMarker[i]);
if(!target) return 1;

CreateMarker(player.UniqueWorld, target.Pos, 3, target.Colour, 0);
}
}
}
}
NewTimer("MarkerHandler", MARKER_CONFIG.UPDATE_TIME, 0);

function CheckRadius(Entity, Entity_)
{
local p1 = FindPlayer(Entity),
p2 = FindPlayer(Entity_);

if(p1 && p2)
{
if(!p1.IsSpawned || !p2.IsSpawned) return false;

if(sqrt(((p1.Pos.x - p2.Pos.x)*(p1.Pos.x - p2.Pos.x)) + ((p1.Pos.y - p2.Pos.y)*(p1.Pos.y - p2.Pos.y))) < MARKER_CONFIG.RADIUS)
return true;
}

return false;
}

onPlayerJoin
function onPlayerJoin( player )
{
PlayerIDs.append(player.ID);
MarkerData[player.ID] = MarkerClass(player.ID);
}

onPlayerPart
function onPlayerPart( player, reason )
{
PlayerIDs.remove(PlayerIDs.find(player.ID));
MarkerData[player.ID].Destroy();
}

Hastebin, if the formatting in above code appears messed up.

P.S. Didn't test much.
#33
Check if your ports are properly forwarded,
Use Thijn's Connection Checker to confirm.

(if you don't know your IP address, just Google, "my IP address")
#34
Servers / [0.4] The Demolition Wars
Oct 20, 2020, 05:52 AM



The Demolition Wars
Releasing 24th October
49.12.15.63:8192



We are happy to finally announce release date for our server.
Save this date! Saturday 24th of October at 15 GMT.
After dedicating 3+ months of time into the server, we are glad that everything has been put in place.




The development does not stop here, we will keep adding new features constantly to the server.
Together with the release, staff applications will be opened to public for numerous ranks.

Read More...



#35
General Discussion / Re: VCMP Client on linux
Oct 06, 2020, 06:33 AM
so it actually worked?
Back in the day I tried booting it up on Linux but could not get it to work with wine.