Hey, i need help i have a adduser command. its giving a error :-
params dose exist
command :-
else if ( cmd == "adduser" )
{
if ( !GetTag( player.Name ) ) MessagePlayer(YELLOW+"Error you no have clan!", player );
else if ( !IsClanManager( player.Name.tolower() ) ) MessagePlayer(YELLOW+"Error you not are leader of this clan.", player );
else if ( !text ) MessagePlayer(WHITE+"Syntax - !adduser <FullUser-WithoutTag>", player );
else
{
if ( !IsClanRegister( GetTag( player.Name ).tolower() ) ) MessagePlayer(YELLOW+"Error - The clan " + GetTag( player.Name ) + " is no register!", player );
else {
local User = params[ 0 ], Clan = GetTag( player.Name );
q <- QuerySQL( db, "SELECT * FROM ClanUsers WHERE Clans='" + GetTag( player.Name ) + "' COLLATE NOCASE" );
DBName <- GetSQLColumnData( q, 1 ).tostring();
if ( GetTag( User ) ) MessagePlayer(WHITE+"Error Only do this: !adduser " + TruncateClan( params[0] ) + ".", player );
else if ( DBName.tolower().find( User.tolower() ) )
{
MessagePlayer(YELLOW+"Error - This player is already in the list!", player );
}
else {
local dos = QuerySQL( db, "SELECT Users FROM ClanUsers WHERE Clans='" + Clan.tolower() + "' COLLATE NOCASE" );
local Users = GetSQLColumnData( dos, 0 );
// Making a new player for clan in database dont delete this "DFAX0067XLPKDW"
if ( Users ) QuerySQL( db, format( "UPDATE ClanUsers SET Users='%s' WHERE Clans='" + Clan + "' COLLATE NOCASE", ""+Users+" "+User+"" ) );
else QuerySQL( db, format( "UPDATE ClanUsers SET Users='%s' WHERE Clans='" + Clan + "' COLLATE NOCASE", "DFAX0067XLPKDW "+User+"" ) );
// Message confirmation
Message(LGREEN+"[INFO]:"+WHITE+"Leader"+ player.Name +"'s added new user in Clan: " + Clan +"." );
Message(LGREEN+"[INFO]:"+WHITE+"New User: " + User + " - Where: " + Clan + "." );
}
}
}
}
If you found any bug so tell me.
Looks like you can't even copy paste. Add this after the parenthesis
local params = split(text, " ");
1st tell me if your problem is fixed or not.
Btw why shall I check?
The creator of this script( obviously which is not you ) may had a final bugcheck, and you're the one who can't even copy paste
Quote from: KAKAN on Dec 26, 2015, 01:45 PMLooks like you can't even copy paste. Add this after the parenthesis
local params = split(text, " ");
@KAKAN Thanks Fixed