Command tells much.....

Started by FarisDon, Feb 19, 2016, 12:37 PM

Previous topic - Next topic

DizzasTeR

I'm not putting it there just to avoid it from being called several times since it needs to be called only once. It may also interfere with the loop and may result wrong info.

FarisDon

Quote from: Doom_Kill3R on Feb 19, 2016, 05:48 PMI'm not putting it there just to avoid it from being called several times since it needs to be called only once. It may also interfere with the loop and may result wrong info.
Well, Dhoom Sir; actually the problem is that if we look to the Code, it isn't showing it once; however it is showing to those persons whom, it doesn't even have to show :|

KAKAN

Well, I got your problem now, here's the fixed code.
else if ( cmd =="bla")
{
local buffer = "";
    foreach( iPlayer in players ) if( GetKills( FindPlayer( iPlayer ) ) == 3 ) buffer = buffer + " " + FindPlayer( iPlayer ).Name;
if( buffer != "" ) ClientMessage("Players with 3 kills: [ " + buffer + " ]", player , 255, 255, 0 );
       else ClientMessage( "No player with 3 kills yet", player, 255, 255, 0 );
}
oh no

FarisDon

Quote from: KAKAN on Feb 20, 2016, 05:41 AMWell, I got your problem now, here's the fixed code.
else if ( cmd =="bla")
{
local buffer = "";
    foreach( iPlayer in players ) if( GetKills( FindPlayer( iPlayer ) ) == 3 ) buffer = buffer + " " + FindPlayer( iPlayer ).Name;
if( buffer != "" ) ClientMessage("Players with 3 kills: [ " + buffer + " ]", player , 255, 255, 0 );
       else ClientMessage( "No player with 3 kills yet", player, 255, 255, 0 );
}
Eh, it's already been fixed ._. i'm just waiting, for #Dhoom to answer why he didn't used the code in the 2nd row instead of 3rd. Anyway, for me I guess we did that cause we have to return something in end after all queries and stuff have been made, like just you did ._.

DizzasTeR

Its not 'Dhoom'.

Destroyer, script executes in sequence so if you send the message first and store the data later what will happen? Common Sense.

FarisDon

Quote from: Doom_Kill3R on Feb 20, 2016, 08:16 AMIts not 'Dhoom'.

Destroyer, script executes in sequence so if you send the message first and store the data later what will happen? Common Sense.
Uhm, right! Thanks :)