Thread: Account Status
View Single Post
  #8  
Old 03-24-2017, 11:19 PM
GRUMPY
Discordant
 
Join Date: Oct 2016
Posts: 445
Default

I put this right on the npc script. It will put a marqee in the client window informing them of status update (plugin::MM)
Code:
sub EVENT_SAY {
	if ($text=~/hail/i && $status == 0) {
		my $actid = $client->AccountID();
		UpdateStatus($actid,1);
		plugin::MM("Greetings $name Your status has been set to 1.");
	}
}
	
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();
}
Reply With Quote