Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   having a problem with onActionPlayerOnline event - help (https://forums.graalonline.com/forums/showthread.php?t=134268442)

khortez 07-07-2013 08:48 PM

having a problem with onActionPlayerOnline event - help
 
i've been trying to do stuff such as add weapons etc as soon as players login. but for some reason serverside and clientside that event hasn't done it for me. can someone tell me what i'm doing wrong with it? thanks

Tim_Rocks 07-07-2013 08:54 PM

Hmm, I think this is what you're looking for:

PHP Code:

function onPlayerLogin(temp.pl) {
  echo(
temp.pl);


You should be seeing your account name on RC whenever you login. After you can confirm that, I'd go ahead and add temp.pl.addweapon("wep");. Is this what you were looking for?

khortez 07-07-2013 08:57 PM

Quote:

Originally Posted by Tim_Rocks (Post 1720336)
Hmm, I think this is what you're looking for:

PHP Code:

function onPlayerLogin(temp.pl) {
  echo(
temp.pl);


You should be seeing your account name on RC whenever you login. After you can confirm that, I'd go ahead and add temp.pl.addweapon("wep");. Is this what you were looking for?

yeah thanks. lemme try it.

Emera 07-07-2013 08:58 PM

Make sure you're using onActionPlayerOnline() in the Control-NPC. onPlayerLogin() can be used in different NPCs/weapons/etc however.

khortez 07-07-2013 09:06 PM

so onActionPlayerOnline is only used for the control-NPC?

cbk1994 07-07-2013 09:16 PM

Quote:

Originally Posted by khortez (Post 1720339)
so onActionPlayerOnline is only used for the control-NPC?

Yes.

khortez 07-07-2013 09:24 PM

Quote:

Originally Posted by cbk1994 (Post 1720342)
Yes.

i see; just stating this then, the wiki has it like this:


Explanation:

it is invoked when a player logs on. Can be put in weapon NPCs and DBNPcs.


Example

if used in a weapon/GUI-script:

*example*


http://gscript.graal.net/onActionPlayerOnline

also onPlayerLogin doesn't even exist there

cbk1994 07-07-2013 11:38 PM

Pretty certain that wiki article is incorrect. I don't think the player object is passed as a parameter, either (player will be in scope; for onPlayerLogin it won't be in scope and will be passed).

In weapons and NPCs (including Control-NPC), you can use onPlayerLogin(pl). If I'm not mistaken, you can only use onActionPlayerOnline() in Control-NPC.

edit: yes, just tested, everything above is correct, the wiki article is wrong

callimuc 07-07-2013 11:40 PM

You can't really trust that list regarding available stuff. You can get a list though by doing the following:

Use 'Run' and type in the following:

HTML Code:

Path:\To\Your\Graal\Client\Graal6.exe -listscriptfunctions
(your .exe file might have another name, you should fix that one then)

After that check your Graal folder. There should be a file called scriptfunctions_client.txt. That list includes all (I believe) currently available functions

cbk1994 07-07-2013 11:44 PM

Quote:

Originally Posted by callimuc (Post 1720347)
That list includes all (I believe) currently available functions

Only client functions, and not necessarily all events. I don't think that list will include serverside events like onActionPlayerOnline.

callimuc 07-07-2013 11:46 PM

Quote:

Originally Posted by cbk1994 (Post 1720349)
Only client functions, and not necessarily all events. I don't think that list will include serverside events like onActionPlayerOnline.

My bad, but I believe it's enough for most of the purposes


All times are GMT +2. The time now is 08:44 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.