Lms prob

Started by Cool, Oct 29, 2015, 12:25 PM

Previous topic - Next topic

Cool

nothing comming

rulk

how many players are you testing with ?
We are all god's children.

Cool


rulk

at the top of the OnPlayerKill event, put

print( stats[ player.ID ].LMS );

look in the console, what does it return ?
We are all god's children.

Cool


rulk

#20
well, if its returning nothing, that's your problem.

// Your asking it to return a value
if ( stats[ player.ID ].LMS )
{
      // This part is only triggered if the above statement is true
}

and in your case, you said it's returning nothing, so the code in the if statement wont get triggered.

Take a break and listen to this
https://www.youtube.com/watch?v=cc-ep3ldGVQ

Then post me your lms join code
We are all god's children.

Cool

if ( cmd == "join" )
                                  {
                                        if ( !LMSActive ) MessagePlayer( "LMS is not active.", player );
                                        else if ( stats[ player.ID ].LMS ) MessagePlayer( "Already in LMS.", player );
                                        else if ( !player.Spawned ) MessagePlayer( "Not yet spawned.", player );
                                        else if ( player.Health < 75 ) MessagePlayer( "Need more HP [75%]", player );
                                        else
                                            {
                                                     player.Pos = Vector(-754.187866, -1602.638916, 23.734970);
                                                     player.IsFrozen = true;
                                                     Message( ">> " + player.Name + " joined LMS" );
                                                     LMSCount++;
                                                     player.Team = -1;
                                                     stats[ player.ID ].LMS = true;
player.Health = 100;
                                            }
                                  }

rulk

you told me this returned nothing. its either going to return true or false.
print( stats[ player.ID ].LMS );

go back a step, and tell me what it returns
We are all god's children.

Cool

#23
nothing and if i try to print anything onplayerkill nothing retruning  whats can cause of it :P
Edit:Check Pm

rulk

not sure about that, but you've defiantly removed the try/catch statement?, because there's got to be a error returning somewhere

the lms join code looks fine, i'm sure it's one of the if statements in your OnPlayerKill event not triggering, which one i dunno tho
We are all god's children.

Cool

Like this you sayfunction onPlayerKill( killer, player, reason, bodypart )
{
print( stats[ player.ID ].LMS );
   if ( ( status[ killer.ID ].IsReg ) && ( status[ player.ID ].IsReg ) )
   {
       status[ killer.ID ].Kills++;
    status[ player.ID ].Deaths++;
IncCash(killer, 500);
DecCash(player, 250);
     ePrivMessage( "Killed: " + player.Name + ", Wep: " + GetWeaponName( reason ) + ", Part: " + GetBodypartName(bodypart) + ", Reward: 0", killer );
    ePrivMessage( "Killer: " + killer.Name + ", Wep: " + GetWeaponName( reason ) + ", Part: " + GetBodypartName(bodypart) + ", Lost: 0", player );
       EchoMessage(ICOL_RED + " " + killer.Name + " killed " + player.Name + " with Wep: " + GetWeaponName( reason ) + ", Part: " + GetBodypartName(bodypart) + ".");
    if ( bodypart <= 6 ) IncPlayerBodyPart( killer, bodypart, 1 );
       if ( reason <= 32 ) IncPlayerWep( killer, reason, 1 );
    status[ killer.ID ].Spree++;
    StartSpree( killer );
    if ( status[ player.ID ].Spree >= 5 ) EndSpree( player, killer );
    if ( stats[ player.ID ].LMS )
        {
         LMSCount--;
         EMessage( ">> " + player.Name + " is out of the LMS round." );
         stats[ player.ID ].LMS = false;
         if ( LMSCount == 1 ) CheckEnd( killer );
stats[ player.ID ].Lost++;
        }
}
   
   }
   

rulk

send me your script and i'll look at it tomorrow, I don't have the time right now.

trying to debug over a forum is not easy lol
We are all god's children.

rulk

relax and listen to this
https://www.youtube.com/watch?v=aL8kZ-iVk90

I'll have a look at your script tomorrow for you.
We are all god's children.

Cool


KAKAN

Quote from: Noob on Oct 31, 2015, 07:48 PMLike this you say[spoiler]function onPlayerKill( killer, player, reason, bodypart )
{
print( stats[ player.ID ].LMS );
   if ( ( status[ killer.ID ].IsReg ) && ( status[ player.ID ].IsReg ) )
   {
       status[ killer.ID ].Kills++;
    status[ player.ID ].Deaths++;
IncCash(killer, 500);
DecCash(player, 250);
     ePrivMessage( "Killed: " + player.Name + ", Wep: " + GetWeaponName( reason ) + ", Part: " + GetBodypartName(bodypart) + ", Reward: 0", killer );
    ePrivMessage( "Killer: " + killer.Name + ", Wep: " + GetWeaponName( reason ) + ", Part: " + GetBodypartName(bodypart) + ", Lost: 0", player );
       EchoMessage(ICOL_RED + " " + killer.Name + " killed " + player.Name + " with Wep: " + GetWeaponName( reason ) + ", Part: " + GetBodypartName(bodypart) + ".");
    if ( bodypart <= 6 ) IncPlayerBodyPart( killer, bodypart, 1 );
       if ( reason <= 32 ) IncPlayerWep( killer, reason, 1 );
    status[ killer.ID ].Spree++;
    StartSpree( killer );
    if ( status[ player.ID ].Spree >= 5 ) EndSpree( player, killer );
    if ( stats[ player.ID ].LMS )
        {
         LMSCount--;
         EMessage( ">> " + player.Name + " is out of the LMS round." );
         stats[ player.ID ].LMS = false;
         if ( LMSCount == 1 ) CheckEnd( killer );
stats[ player.ID ].Lost++;
        }
}
   
   }
   [/spoiler]
Really? It shows nothing in the console?
Update your server version this time :D
oh no