View Single Post
  #2  
Old 06-21-2016, 09:13 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

This assumes you have Perl DBI installed.


/plugins/statusupdate.pl
Code:
sub UpdateStatus {
	my $idargument = $_[0];
	my $statuslevel = $_[1];
	my $dbh = plugin::MySQL_Connect();
	my $query = "UPDATE account SET status = ".$statuslevel." WHERE id = ".$idargument.";";
	$dbh->do($query);
	$dbh->disconnect();
	$client->UpdateAdmin();
}

return 1;
Code:
sub EVENT_SAY {
	if ($status == 0) {
		UpdateStatus($client->AccountID(),1);
	}
}
You could substitute 1 for whatever status level you want of course (0-255 anyway).

Last edited by ghanja; 06-21-2016 at 09:13 PM.. Reason: code block fail
Reply With Quote