This topic was marked solved by its starter, on December 14th, 2017, 07:45 AM

luchgox

  • Full Member
  • Posts: 145
Strength does not come from wining.Your struggles develop your strengths.

umar4911

  • Hero Member
  • Creating own server!
  • Posts: 527
I am gamer, programmer and hacker. Try to find me!
xD

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 461
Try to UnderStand ME!

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 229

Bob

  • Hero Member
  • Posts: 777
Re: to only see the player which is near to you
« Reply #4, 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

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 461
Try to UnderStand ME!

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 379
Re: to only see the player which is near to you
« Reply #7, 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

Discord: zeus#5155

Kenneth Law

  • Newbie
  • Posts: 35