Well, you are missing the ; at the end of this line:
Code:
$client->AddAlternateCurrencyValue(15, 1)
You can run "perl -c global_player.pl" from command line and it will tell you of any syntax errors you have so you can fix them.
Also, for general troubleshooting purposes, I always simplify my script down as much as possible to verify things are working as expected. My suggestion would be to remove/comment out all of that except for a shout/debug message like this:
Code:
sub EVENT_CONNECT {
quest::settimer("Pearls", 10);
}
sub EVENT_TIMER {
if ($timer eq "Pearls")
{
quest::shout("IT WORKS!");
}
}
With that, you should see the IT WORKS! shout every 10 seconds. If you aren't seeing that, then either EVENT_CONNECT isn't working properly, or you don't have your global_player.pl in the templates folder.
Once you get that working, you can add your other stuff line by line and test as you go. Once it stops working, you will know where the issue is and just need to figure out why. One example might be that you could have a bad function name.
Most likely in this case, your problem is probably due to you trying to use the $client variable inside EVENT_TIMER which does not export that variable and cannot support it properly.
Alternatively, you could set an entity variable on the client and then loop through the client list and check each for the entity variable you set, and apply your currency that way. It is a bit more complex to do this properly, but it is probably the best way.
You could probably set the entity variables to a unix timestamp using time(). Then, in the timer you would check if the current timestamp is 1 hour later than what the client's entity variable is.