View Single Post
  #4  
Old 06-22-2016, 11:09 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

I copy pasted mostly from a portion of code I already had written (however it was just a subroutine in a player.pl), added the $statuslevel and gave it a plugin filename. Sorry for not placing the plugin:: before UpdateStatus

Are you certain you have Perl DBI installed?

Also, I would up your logging (its my preferred setting anyway), do this in game:
Code:
#logs set gmsay 20 3
#logs reload_all
For testing, perhaps just keep it all confined within the NPC's script (for now). If it gives a warning about UpdateStatus being redefined (which would be good), just ignore it for now.

Code:
sub EVENT_SAY {
	if ($text=~/hail/i && $status == 0 && $ulevel=>10) {
		UpdateStatus($client->AccountID(),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();
}
Also providing this link, just in case:

http://wiki.eqemulator.org/p?Install..._other_Modules
Reply With Quote