Re: Brenbot Plugin [message #401358 is a reply to message #400153] |
Thu, 03 September 2009 01:16 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma:
|
General (5 Stars) |
|
|
You don't need to manually send RenRemCmd("player_info"), BRenBot already did that on the player_joined line, the reason for the timer is because you have to wait for the response to come back.
You also need to pass the name to the timer so you know which player it triggered for, ie;
$_[KERNEL]->alarm( end=> (int(time()) +3) => $player->{'name'} );
In the end sub you need to use something like
end => sub
{
my ( $result, %player ) = plugin::getPlayerData ( $_[ARG0] );
if ( $result != 1 )
{
brIRC::ircmsg( "7 Player 4 $player->{'name'} 4 $player->{'ip'} 7 Ping 4 $player->{'ping'} 7Serial 4 $player{'serial'} ", "A" );
}
}
Also, you should never use playerdata::getPlayerData in your plugin, use plugin::getPlayerData instead, it calls the same function but because its in the plugin interface it will always be supported in future regardless of internal changes.
[Updated on: Thu, 03 September 2009 01:18] Report message to a moderator
|
|
|