Last Man Standing

Started by DizzasTeR, Nov 01, 2015, 04:03 AM

Previous topic - Next topic

Karthik

K dude i will try this system
if i will find error i will contact u

SAzEe21

Sorry for bumping the old topic, but i got an error.

717 line is end of main.nut.

DizzasTeR

You screwed up somewhere while copying. If you have that '_LMS' Table in onScriptLoad then remove it from there and keep it above onScriptLoad.

KAKAN

Quote from: Doom_Kill3R on Feb 20, 2016, 09:54 AMYou screwed up somewhere while copying. If you have that '_LMS' Table in onScriptLoad then remove it from there and keep it above onScriptLoad.
What about teams and other things? I know that this isn't important, but think, what if all the players are having the same team?
oh no

Karthik

It works fine for me good qork

dEaN

_LMS <- {
 Alive = 0,
 Players = [],
 iData = array( GetMaxPlayers() ),
 State = "OFF"

-Error-
I think first impressions are important when i pick up a Main.nut script and I'm sticking to the script, I'm putting that organic feeling back in the game.
-Since 2012-

KAKAN

Would you even bother to say what's the error code?
Maybe you are weak in copying code...
oh no

dEaN

Quote from: KAKAN on Dec 01, 2016, 08:53 AMWould you even bother to say what's the error code?
Maybe you are weak in copying code...


yes really i am weak... in copy paste becuase you are pro copy paster :p
I think first impressions are important when i pick up a Main.nut script and I'm sticking to the script, I'm putting that organic feeling back in the game.
-Since 2012-

MatheuS

Quote from: dEaN on Dec 01, 2016, 09:47 AM
Quote from: KAKAN on Dec 01, 2016, 08:53 AMWould you even bother to say what's the error code?
Maybe you are weak in copying code...

yes really i am weak... in copy paste becuase you are pro copy paster :p

if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

DizzasTeR

Quote from: dEaN on Dec 01, 2016, 07:09 AM_LMS <- {
 Alive = 0,
 Players = [],
 iData = array( GetMaxPlayers() ),
 State = "OFF"

-Error-

I'm pretty sure your script looks like this:
_LMS <- {
 Alive = 0,
 Players = [],
 iData = array( GetMaxPlayers() ),
 State = "OFF"

function onScriptLoad()
{
... shit here ...
}

.. other shit here ...

.. randomly pasted lms functions here

.. and so on ...

Did you notice that the _LMS is a huge table with meta-functions!

PASTE THIS WHOLE CODE SEPARATELY OUTSIDE ANY FUNCTION
_LMS <- {
 Alive = 0,
 Players = [],
 iData = array( GetMaxPlayers() ),
 State = "OFF"
 
 function AnnounceLMS()
 {
  State = "ON";
  Message( "[#FFFFFF]* LMS has been activated! /joinlms to join!" );
 }
 
 function JoinLMS( player )
 {
  Players.push( player.ID );
  Alive++;
  player.IsFrozen = true;
  iData[ player.ID ] = player.Pos;
  player.Pos = Vector( -195.861, 507.561, 16.4494 );
  MessagePlayer( "[#FFFFFF]* You have joined LMS!", player );
  Message( "[#FFFFFF]* " + player.Name + " has joined LMS!" );
 }
 
 function StartLMS()
 {
  local iPlayer;
 
  foreach( ID in Players ) {
  iPlayer = FindPlayer( ID );
  if( iPlayer ) iPlayer.IsFrozen = false;
  }
   
  if( Alive >= 2 )
  {
   State = "STARTED";
   Message( "[#FFFFFF]* LMS has started!" );
  }
  else
  {
   State = "OFF";
   Players.clear();
   Alive = 0;
   iPlayer.Pos = iData[ iPlayer.ID ];
   Message( "[#FFFFFF]* LMS was aborted due to lack of participants!" );
  }
 }
 
 function PartLMS( player, eliminated = false )
 {
  Alive--;
  Players.remove( player.ID );
 
  if( eliminated ) Message( "[#FFFFFF]* " + player.Name + " has been eliminated from LMS!" );
  else Message( "[#FFFFFF]* " + player.Name + " has left LMS!" );
 
  if( Alive <= 1 )
  {
   foreach( ID in Players ) {
   local iPlayer = FindPlayer( ID );
   if( iPlayer ) _LMS.Winner( iPlayer );
   }
  }
 }
 
 function Winner( player )
 {
  State = "OFF";
  Alive = 0;
  Players.clear();
  player.Pos = iData[ player.ID ];
  Message( "[#FFFFFF]* " + player.Name + " has won the LMS!" );
 }
}

// Here the rest of your script, onScriptLoad etc.

And then paste the rest in the events which are mentioned in first post, if you can't do it, stop scripting.

Cool

@Doom_Kill3R   i was just trying its work or not i found a small mistake if me and you are in lms and i type /kill so its should announce Doom Won its announcing Hercules win

KAKAN

#26
Quote from: Hercules on Dec 01, 2016, 07:34 PM@Doom_Kill3R   i was just trying its work or not i found a small mistake if me and you are in lms and i type /kill so its should announce Doom Won its announcing Hercules win
That's because your parameters name in onPlayerDeath and/or onPlayerKill function are wrong.
oh no

Mahmoud Tornado


umar4911

bump*

If player's are on same team. Forgot to add that
I am gamer, programmer and hacker. Try to find me!
xD

NicusorN5