to only see the player which is near to you

Started by luchgox, Nov 17, 2017, 07:15 PM

Previous topic - Next topic

luchgox

Is its possible to see the player marker (on radar) which is near to you (ex-100 yards)?





Sorry if its mentioned in wiki
Strength does not come from wining.Your struggles develop your strengths.

umar4911

Quote from: luchgox on Nov 17, 2017, 07:15 PMIs 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



Mötley

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:

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


!

Quote from: =RK=MarineForce on Dec 08, 2017, 05:06 PMI 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 :)

Discord: zeus#5155

!

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

Bump, the same question as I want to ask.