![]() |
Detecting Updates
Hi,
is there any way to detect if a weapon has been added/updated/whatever? |
Since you gave no real information, I'd say just have an updateid var. It checks itself against the server and updates itself if the server has a higher number.
|
Explain.
You could just use onCreated, if you mean when someone hits UPDATE in RC? |
Well, you have these:
PHP Code:
|
Quote:
Not exactly sure what onInitialized is. |
onInitialized is when the code is first executed on server start, I believe.
onCreated is fired whenever the NPC is saved/updated. |
Quote:
I think it's pretty nice :) |
Quote:
EDIT: On second thought, I used it once to make a zone system (meaning PK and No-PK zones). |
I use it for map-related instances.
|
i meant if theres a way to detect that a weapon has been added/updated(any weapon in rc)(from a weapon or dbnpc)(without changing the actual weapon you check)
|
The only way to detect if a weapon has been updated is to put something in its onCreated() area which is called when updated.
|
well i just wanna do a non-anonymous echo()(that it adds the weapon name)
but i need to know if a new weapon has been added xD |
Quote:
|
no, that a new wnpc has been added
|
Like added to the player?
in a loop something like: PHP Code:
|
no, added in rc
|
Quote:
|
Hmm, why would you want that? o.o
Anyways, you made this thread to see if there was an event for it? Or some way to detect it? Or an idea that you thought could be added :o |
to see if theres a way to do it :p
well because i have to overwrite the echo for all weapons, and new weapons don't have it overwritten, and i don't feel like using a timeout XD |
The only way to do that would be to have some script that would either read the "weapons/" folder (not recommended) or to read the "weapons" variable (serverside) which is a list of all weapons on the NPC Server.
Do the latter using a loop or so like someone previously suggested. Not a very good use of your NPC Server's CPU though. And no, there is no event for when a new WNPC is added to the NPC Server (other then locally with-in that script, but that doesn't help you). |
Add a weapon/object called "version". In every script, add version.(@this.name)++; If the version number is 1, doStuff();
Otherwise, I cannot see a point in your desires >_< |
Yeah but that requires adding stuff to each new script which kind of defeats the purpose.
|
| All times are GMT +2. The time now is 10:02 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.