![]() |
Control-NPC PM Responding
OK, I'm Making An Event System Similar To Era's, Without The GUI That Pops Up.
I Have The Weapon Finished and Working But I Just Need To Get The If Player PM The Server Saying "join" then it warps them to the level defined in serverr.event I Have This: if (pm){ if (strequals(#p(0),join)){ setlevel2 serverr.event[1],serverr.event[2],serverr.event[3]; } } I Have Also Tried function onPM if (params[0] == "join"){ setlevel2(serverr.event[1],serverr.event[2],serverr.event[3]); } } Any Suggestions, Fixes, or Alternatives? |
PHP Code:
|
That doesn't work at all (I work on bscharff's server). We've tried many alterations, even made it as simple as:
NPC Code: Nothing works, it just replies with the default "Hey I'm the NPC server and I control most of the NPC's". Any ideas? |
And this is in the Control-NPC?
|
function onPM no longer works since v5 was released.
|
Quote:
|
Quote:
|
That's odd. I know it stopped working on a lot of servers when v5 was released, you can even find several threads on the forum talking about it.
But yeah, it seems to be working on Zodiac.. PHP Code:
|
Quote:
|
I think the player's account name, but in this case is not needed.
|
Quote:
|
OK,
I Found out The Problem. Since I Was Doing setlevel2 on it's own with no this. or player. it didn't know what to do. So Mog put player.setlevel2(L,X,Y); it's works fine :P Thanks Guys! |
Thought I'd nought, for onPM to be called, I'm pretty sure in the onCreated, or such function, you need setPM( NULL );
|
Bump alert, but it might prevent similar threads in the future.
If you do NOT have setPM(""); in your Control-NPC, function onPM() will not be triggered. So, if function onPM() doesn't work for ya, simply do setPM(""); in your Control-NPC's onCreated() function. |
Quote:
I basically said put it in onCreated in the last post. |
Quote:
|
setPM() in onCreated() doesn't help since onCreated() is not called on server restart (it will call onInitialized()). It's better to call setPM("") in onActionPlayerOnline.
The first line is the "advertising URL", not used for a long time but to stay compatible with scripts that expect to skip the first line it's still inserting an empty line. |
Learn something new every day.
|
Quote:
|
| All times are GMT +2. The time now is 04:39 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.