How would you do this? I am trying to see if someone's BL ID matches the text in the file, and if so, display a message.
I tried this:
function dostuff()
{
%client.isThis = false;
%blid = %client.bl_id;
%fo = new FileObject();
%path = "Add-Ons/Script_Stuff/stuff.txt";
%fo.openForRead(%path)
%line = %fo.readLine();
if(!isFile(%path)
{
error("Stuff does not exist!");
echo("Creating stuff...");
%fo.openForWrite(%path);
%fo.close();
}
else if(getWord(getSubStr(%line)) $="")
{
$BLIDcheck = false;
}
else if(getWord(getSubStr(%line)) $="%blid")
{
%client.isThis = true;
messageAll('MsgAdminForce', "\c6" @ %client.getPlayerName @ "\c6 is a this!");
$BLIDcheck = true;
}
}
I don't get any syntax errors or anything, but am I doing the getWord(getSubStr(%line)) $=""
stuff correctly? Or is this wrong and there's a better way of doing it?