Vice City: Multiplayer

Server Development => Scripting and Server Management => Script and Content Requests => Topic started by: luchgox on November 17th, 2017, 07:15 PM

Title: to only see the player which is near to you
Post by: luchgox on November 17th, 2017, 07:15 PM
Is its possible to see the player marker (on radar) which is near to you (ex-100 yards)?





Sorry if its mentioned in wiki
Title: Re: to only see the player which is near to you
Post by: umar4911 on November 17th, 2017, 09:28 PM
Quote from luchgox on November 17th, 2017, 07:15 PM
Is its possible to see the player marker (on radar) which is near to you (ex-100 yards)?





Sorry if its mentioned in wiki
I think yes by constantl repeating the function
Title: Re: to only see the player which is near to you
Post by: =RK=MarineForce on November 23rd, 2017, 08:27 PM
Where is code?
Title: Re: to only see the player which is near to you
Post by: DarkRaZoR^ on November 23rd, 2017, 09:27 PM
Quote from =RK=MarineForce on November 23rd, 2017, 08:27 PM
Where is code?
You should help him by making it.
Title: Re: to only see the player which is near to you
Post by: Bob on December 6th, 2017, 12:15 AM
I mean, How far away are we talking? 20 Car lengths?

This is possible, But a little tricky.

My thoughts, Use district names to detect the where abouts of the players location.

You should make a class, And include every district name. from the first district to the last start from the number 1,

Example:

Code: [Select]
class District_Distances
{
  //These should be names, Not District_
  District_1 = 1;
  District_2 = 2;
  District_3 = 3;

  Current = 3;
}

For each ID inside of what the actual district name is set the players world to that ID/Int.



Districts are kinda really big.. So this might not be how you want it, but one district can be broken down to 6 different sectors. This would have to result in a massive amount of scripting, testing between two different districts that are next to each other. To needing to use a Timer to check if a players district has changed.... This could result in hours, Weeks, Months of scripting and testing, just to get it perfected...



It's possible but I wouldn't suggest doing this in squirrel, This is something that should be hard coded. You could prod developers to adding something ;).



Sorry, I no longer own this game, and don't intend to buy it in the foreseeable future so I would be coding blindly, I only visit rarely every so often and just wanted to share some logic in attempts to making interesting things happen... Feel free to help the guy out, if you have the time and patience ; ), But I wouldn't suggest doing it, This is calling for a lot of data. I prefer you not bug who I am and just leave me be
Title: Re: to only see the player which is near to you
Post by: =RK=MarineForce on December 8th, 2017, 05:06 PM
I din't understand .. ??? ???
Title: Re: to only see the player which is near to you
Post by: ! on December 9th, 2017, 03:41 PM
Quote from =RK=MarineForce on December 8th, 2017, 05:06 PM
I din't understand .. ??? ???
You are here for a help or you need something like this.

If you really want to help then stay away from this topic and try to use your mind to know what he need :)
Title: Re: to only see the player which is near to you
Post by: ! on December 9th, 2017, 04:34 PM
Code: [Select]
Marker_Allowed <- array( GetMaxPlayers(), null );
Marker_Timer <- array( GetMaxPlayers(), null );
Marker_Timer_Interval <- 7000; /* runs the timer for each player after 7 seconds */

function onPlayerJoin( player )
{
   if ( Marker_Allowed[ player.ID ] != null ) Marker_Allowed[ player.ID ] = null;
   Marker_Allowed[ player.ID ] = {};
   
   if ( Marker_Timer[ player.ID ] != null )
   {
      Marker_Timer[ player.ID ].delete();
      Marker_Timer[ player.ID ] = null;
   }
   Marker_Timer[ player.ID ] = NewTimer( "UpdateMarkers", Marker_Timer_Interval, 0, player.ID);
}

function onPlayerPart( player, reason )
{
   if ( Marker_Allowed[ player.ID ] != null )
   {
      Marker_Allowed[ player.ID ] = null;
   }
   
   if ( Marker_Timer[ player.ID ] != null )
   {
      Marker_Timer[ player.ID ].delete();
      Marker_Timer[ player.ID ] = null;
   }
   
   for( local i = 0; i < GetMaxPlayers(); i++ )
   {
      local plr = FindPlayer( i );
      if ( plr && plr.ID != player.ID )
      {
         if ( Marker_Allowed[ plr.ID ].rawin( player.ID ) )
         {
            Marker_Allowed[ plr.ID ].rawdelete( player.ID );
         }
      }
   }
}

function UpdateMarkers( playerID )
{
   local player = FindPlayer( playerID );
   
   if ( !player )
   {
      Marker_Allowed[ playerID ] = null;
     
      Marker_Timer[ playerID ].delete();
      Marker_Timer[ playerID ] = null;
     
      return;
   }
   
   for( local i = 0; i < GetMaxPlayers(); i++ )
   {
      local plr = FindPlayer( i );
      if ( plr && plr.ID != player.ID )
      {
         if ( Marker_Allowed[ player.ID ].rawin( plr.ID ) )
         {
           
         }
         else
         {
           
         }
      }
   }
}

Might be this helps you.I've left vcmp scripting and don't know which function is used to show markers I'll try to search it on wiki and update it as fast as I can
Title: Re: to only see the player which is near to you
Post by: Kenneth Law on November 24th, 2020, 02:42 PM
Bump, the same question as I want to ask.