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 - Kenneth Law

#16
Quote from: Athanatos on Oct 13, 2021, 01:47 PMI'm afraid SetWaterLevel doesn't work with custom waterpro.dat files. This was tested few years ago.
Quite strange after I added a custom waterpro.dat into my server. The sea becomes invisible although it does exist indeed. Players can drown inside but they can't see any water around. :'( :'( :'(
#17
Quote from: Inferno on Oct 11, 2021, 11:16 AMYou can use custom waterpro.dat to set sea boundaries.
And SetWaterLevel to change its level.
Cool! But I don't know how to deal with those data in this file. Any tutorial for it?
#18
Anyone knows how to create pieces of sea rectangle which can drown players?
My idea is to build another large custom map high up to sky and fill sea around it to make it not be floating in sight :P  Just want the custom map to become a real world.
No! Please don't try to tell me the function SetWaterLevel() because I've tried it and found that the water only existed outside the default vice city island. There is actually a lack of sea in the part of the original island area.
#19
Videos & Screenshots / Re: Extreme Racing
May 11, 2021, 12:20 PM
Quote from: Sebastian on May 11, 2021, 07:58 AM
Quote from: Kenneth Law on May 11, 2021, 02:56 AMThanks for promoting my server!!
Hoping more people will come and play here :P
We always organize activities at weekend in which many Chinese players are called online. We also welcome players from overseas to join.
To be honest, it's much more interesting when lots of players join the game and play together. ;D


Hei there, KL !
And congratulation for the server, I really enjoy it!

Could you accept my friend request on Discord ? I would like to talk to you, and for some reason I cannot send you PM here on forum.

For sure!
But it's not that convenient for me to get access to discord since I have to use it with vpn. That's why I rarely check messages on discord.
You can also try to download Tecent QQ to contact me.
#20
Videos & Screenshots / Re: Extreme Racing
May 11, 2021, 02:56 AM
Thanks for promoting my server!!
Hoping more people will come and play here :P
We always organize activities at weekend in which many Chinese players are called online. We also welcome players from overseas to join.
To be honest, it's much more interesting when lots of players join the game and play together. ;D
#21
Give a situation that I have localed a table like
local table = { "a": 1, "b": 2, "c": 3 };
How can I add a new key and a new value for it then?
For example a new key which is "d" and a new value which is 4 so that the table will become { "a": 1, "b": 2, "c": 3, "d": 4 };
#22
Support / Re: Question about player's marker
Nov 27, 2020, 04:36 AM
Alright hopefully developers could give some solution to this in the next update. Meanwhile I found some bugs in SetShowOnlyTeamMarkers(). I will post it on Bugs Report Board later.
#23
Support / Re: Question about player's marker
Nov 27, 2020, 12:55 AM
Quote from: Spiller on Nov 26, 2020, 11:15 AMThis 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.
I'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.
#24
Support / Question about player's marker
Nov 25, 2020, 04:45 AM
How to make the marker of a specific player visible for just part of players? Note that NEITHER FOR NONE OF PLAYERS NOR FOR ALL PLAYERS. Something like player.RemoveMarker() or player.IsOnRadar = false can only hide the marker for all which is not what I want. I know changing their world helps but I want them to be in one world.
Also, I am not talking about the function SetShowOnlyTeamMarkers(true). Let's just talk about the situation that players are grouped into two teams which are separately A and B, and I want to make A visible for B while B invisible for A.
#25
Bump, the same question as I want to ask.
#26
Bump, the same question as I want to ask.
#27
General Discussion / Re: VCMP wiki is down
Feb 29, 2020, 01:08 AM
When will wiki be up again?
#28
Quote from: Doom_Kill3R on Feb 15, 2020, 10:31 AMhttps://forum.vc-mp.org/?topic=5978.0
I was using the empty GUILabel() as he said in the topic however the problem still exists
#29
Bugs and Crashes / [BUG]GUI label invisible!!
Feb 15, 2020, 02:40 AM
Description
Some labels with certain text and font sizes do not show up.
For instance:
label = GUILabel();
label.Pos = VectorScreen(300, 200);
label.TextColour = Colour(255, 255, 255);
label.Text = "test";
label.FontSize = 14;
But if I change the text to "testtesttest" or set the font size to 18, it becomes visible again.

Reproducible
always

What you were doing when the bug happened
Not doing anything

What you think caused the bug
I don't know. It's very strange.
#30
Thx a lot.
Now problem has been solved.
I am not sure whether you are right but I did it like this
arr <- array(2, null);
arr[0] = [0, 0];
arr[1] = [0, 0];
and it works.