[Help] How i use this.

For everything NOT server specific support. Do NOT ask for connectivity help here!.

Moderator: Moderators

Unknown6996
Human
Human
Posts: 24
Joined: 07 Oct 2011, 11:21
Noob?: No

[Help] How i use this.

#1 Post by Unknown6996 »

I'am creating a Plugin to recognizes a player !
And as hook i use this :

Code: Select all

Plugins::addHook('player', \&onPlayer);

sub onPlayer {
Commands::run("pm $player Give me my money");
}

1;
How i do to recognizes the player ? In plugin,no macro.I Try :

Code: Select all

my (player) => $actor;
Commands::run ("pm $actor Give me my money);

Code: Select all

my ($player) = @_;
Commands::run ("pm $actor Give me my money);
Its very easy i put so :

Code: Select all

my ($player) = "Player Name";
Commands::run ("pm $actor Give me my money);
But no.I'm learning and don't want very easy :).
Understand my ask ? Thanks very much,thanks for attention and for your availability
1;
User avatar
4epT
Developers
Developers
Posts: 627
Joined: 30 Apr 2008, 14:17
Noob?: No
Discord: ya4ept#8494
Location: Moskow (Russia)

Re: [Help] How i use this.

#2 Post by 4epT »

try:

Code: Select all

sub onPlayer {
my (undef, $args) = @_;
my $player = $args->{player};
Commands::run("pm $player Give me my money");
}
see playerRecorder.pl
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image
Unknown6996
Human
Human
Posts: 24
Joined: 07 Oct 2011, 11:21
Noob?: No

Re: [Help] How i use this.

#3 Post by Unknown6996 »

:) Okay,but i have other problem.
With :

Code: Select all

 
sub onPlayer {
my (undef, $args) = @_; 
my $player = $args->{player};
message "Exists a player : $player";
}

1;
All players are appeared as Unknown. (I Download openkore much times) Sorry for my English !

And with :

Code: Select all

sub onPlayer {
my (undef, $args) = @_; 
my $player = $args->{player};
Commands::run("pm $player Give me my money");
}

1; 
Appears:

Code: Select all

Player is not online
Don't know what i do.I Had several tentatives,several.And some doesnt work !
I need Help ! Thanks for your attention and understanding!
Fr3DBr
Developers
Developers
Posts: 60
Joined: 05 Oct 2011, 09:21
Noob?: No
Location: Brazil

Re: [Help] How i use this.

#4 Post by Fr3DBr »

Unknown6996 wrote::) Okay,but i have other problem...
Sup bro, i've figured out my doubts from the other forum ^____^, wasn't so hard considering took me just a few hours (i am a programmer) :P.
User avatar
4epT
Developers
Developers
Posts: 627
Joined: 30 Apr 2008, 14:17
Noob?: No
Discord: ya4ept#8494
Location: Moskow (Russia)

Re: [Help] How i use this.

#5 Post by 4epT »

Hook 'player' transfers only ID, but not NAME!!!

Use Hook 'charNameUpdate'
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image
Unknown6996
Human
Human
Posts: 24
Joined: 07 Oct 2011, 11:21
Noob?: No

Re: [Help] How i use this.

#6 Post by Unknown6996 »

Oh,Finally.Thanks very much boy.
But i have a new problem.The peoples have 2 name,example : Mario - Kart.
And the kore try pm him and appears (My english is very bad,i know) :
Player Mario is not online
How i resolve this ? And, How i add reputation for you ?
Thanks , very thanks !
Fr3DBr
Developers
Developers
Posts: 60
Joined: 05 Oct 2011, 09:21
Noob?: No
Location: Brazil

Re: [Help] How i use this.

#7 Post by Fr3DBr »

4epT wrote:Hook 'player' transfers only ID, but not NAME!!!

Use Hook 'charNameUpdate'
Altough charNameUpdate is very very slow, takes like ages to it recognize all the players around you, not sure why yet tho ?
User avatar
4epT
Developers
Developers
Posts: 627
Joined: 30 Apr 2008, 14:17
Noob?: No
Discord: ya4ept#8494
Location: Moskow (Russia)

Re: [Help] How i use this.

#8 Post by 4epT »

need to use quotes
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: [Help] How i use this.

#9 Post by EternalHarvest »

Unknown6996 wrote:And, How i add reputation for you ?
There's no dedicated "reputation" since it's unnecessary.
Fr3DBr wrote:Altough charNameUpdate is very very slow, takes like ages to it recognize all the players around you, not sure why yet tho ?
It's because character names are not sent with actor information and need to be requested (like when there may be no name in the client when you mouseover it for a first time); there are delays to prevent spamming the server, but you can reduce it in timeouts.
Unknown6996
Human
Human
Posts: 24
Joined: 07 Oct 2011, 11:21
Noob?: No

Re: [Help] How i use this.

#10 Post by Unknown6996 »

When you say "need use quotes",i got it use "if" in sub onPlayer {,to especific when the player have two names,join two names,in format of one and pm from him ! ?
I Think
I'll stop here.I'm already giving work more. :)