![]() |
Script: findplayers and findnpcs
I am sure most people already made functions for this.. but some haven't so I have decided to post it for people to use.
This is a function to get all the players within a specified box. There are functions for this serverside, but not clientside so I figured I would add it. Syntax is simple, findplayers(x,y,w,h) Function to find an area of players NPC Code: It is probably best to make a class for them, ie: "findfunctions" that way you can simply put join("findfunctions") in a script and be able to use the find functions without having to copy and paste it over and over. :) **Note** the function returns the object of the npcs/players not the index (I think the serverside command returns the index) so to find the nickname of nearby player with nick "Tengo" you would do something like this: NPC Code: What do you think? Please do not flame this post because I am just trying to help PW's and scripters that are starting out. |
Hmm, wouldn't it be better if you just did something like:
PHP Code:
Also, you can't set other people's nicknames clientside :p |
Quote:
|
Quote:
|
Yes, it doesn't matter what you name it.
On Mana Realms we try to divide up the custom functions as much as we can so that later on we dont have one huge file with 3000 functions in it.. and we only need to access one :) |
temp. variables might be slightly more effective, since they are cleared at the end of the active function. It will save you doing treturn = NULL; or so.
|
Quote:
If not then that will save me lots of typing.. I hate having to prefix everything with this. moreso because I am lazy than anything but also for appearance. so many this. this. this. clutteres things and makes them less readable I try to make my variables easy to understand what they are and as dynamic as possible so that anyone can pick up the script and figure it out. Er1c on the other hand.. woof.. its like trying to put a jigsaw puzzle together with all the peices upside down. |
| All times are GMT +2. The time now is 04:54 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.