any solution for this error?

Started by Kid_Buu, Jan 20, 2018, 07:05 AM

Previous topic - Next topic

Kid_Buu

Hello, I wanted to know if someone could tell me what to do in this command

Error: [the index 'plr' does not exist]

Here the command:

else if ( cmd == "clanstats" )
{
(text) ? text = text : text = GetTag( plr.Name );
( plr ) ? text = GetTag( plr.Name ) : text = text;
if ( !text ) E_MSG( "Usted no tiene un tag", player );
else
{
local Tag = GetTok( text, " ", 1 );
if ( IsClanRegister( text ) )
{
if ( plr )
{
Kills <- ClanKills( GetTag( plr.Name ) ); Deaths <- ClanDeaths( GetTag( plr.Name ) ); Deads <- ClanDeads( GetTag( plr.Name ) ); Ratio <- GetRatio( Kills, Deaths, Deads ); ( Ratio ) ? All( GetTag( plr.Name ) + "'s Stats - Kills " + Kills + " Deaths " + Deaths + " Deads " + Deads + " Ratio K/DD: " + Ratio ): All( GetTag( plr.Name ) + "' Stats - Kills " + Kills + " Deaths " + Deaths + " Deads " + Deads );
}
else if ( text )
{
local q = QuerySQL( db, "SELECT Clan, Kills, Deaths, Deads FROM ClanStats WHERE Clan='" + Tag + "' COLLATE NOCASE" );   
local PKills = GetSQLColumnData( q, 1 ), PDeaths = GetSQLColumnData( q, 2 ), PDeads = GetSQLColumnData( q, 3 ), Ratio = GetRatio( PKills, PDeaths, PDeads );
( Ratio ) ? All( text + "'s Stats - Kills " + PKills + " Deaths " + PDeaths + " Deads " + PDeads + " Ratio K/DD: " + Ratio ): All( text + "' Stats - Kills " + PKills + " Deaths " + PDeaths + " Deads " + PDeads );
}
}
else E_MSG( "El clan: " + text + " no esta registrado.", player );
}
}

Retard

Add This in Your Script local plr = FindPlayer( player );
Just another retard roaming around.

Kid_Buu


Kid_Buu

[Unexpected argument in FindPlayer: must be integer or string]

umar4911

try using this
else if ( cmd == "clanstats" )
{
(text) ? text = text : text = GetTag( player.Name );
( player ) ? text = GetTag( player.Name ) : text = text;
if ( !text ) E_MSG( "Usted no tiene un tag", player );
else
{
local Tag = GetTok( text, " ", 1 );
if ( IsClanRegister( text ) )
{
if ( player )
{
Kills <- ClanKills( GetTag( player.Name ) ); Deaths <- ClanDeaths( GetTag( player.Name ) ); Deads <- ClanDeads( GetTag( player.Name ) ); Ratio <- GetRatio( Kills, Deaths, Deads ); ( Ratio ) ? All( GetTag( player.Name ) + "'s Stats - Kills " + Kills + " Deaths " + Deaths + " Deads " + Deads + " Ratio K/DD: " + Ratio ): All( GetTag( player.Name ) + "' Stats - Kills " + Kills + " Deaths " + Deaths + " Deads " + Deads );
}
else if ( text )
{
local q = QuerySQL( db, "SELECT Clan, Kills, Deaths, Deads FROM ClanStats WHERE Clan='" + Tag + "' COLLATE NOCASE" );   
local PKills = GetSQLColumnData( q, 1 ), PDeaths = GetSQLColumnData( q, 2 ), PDeads = GetSQLColumnData( q, 3 ), Ratio = GetRatio( PKills, PDeaths, PDeads );
( Ratio ) ? All( text + "'s Stats - Kills " + PKills + " Deaths " + PDeaths + " Deads " + PDeads + " Ratio K/DD: " + Ratio ): All( text + "' Stats - Kills " + PKills + " Deaths " + PDeaths + " Deads " + PDeads );
}
}
else E_MSG( "El clan: " + text + " no esta registrado.", player );
}
}
I am gamer, programmer and hacker. Try to find me!
xD