![]() |
the NPC's name
The wiki has failed me again.
with(findnpc("turret")) that's great, but how do I get the NPC's name? I mean, how do I know which NPC to find? Does it even work with putnpc2sies? Here's the problem: I've made a script that, clientside, comes up with a list of targets, then sends these targets to the serverside. The serverside checks the list of targets to make sure the player isn't being cheeky, then applies damage. Currently I've got the clientside triggering with a list of npc.id s, and the server's catching it no problem, but I can't seem to go from a list of npc.ids to a list of actual NPCs, short of running a very large findareanpcs and comparing their IDs...I'd much rather either send a list of npc.names (or whatever the mysterious property is, the wiki's no help) or look them up by id directly. temp.npc=npc.id(param1)? =findnpcbyid(param1)? |
The only NPCs having names you can assign yourself are the database NPCs. The others either have no name, or they have a generated name (putnpc2()). Either way, you can't change the name yourself. Though, putnpc2() returns the name of the newly created NPC when it is called. Maybe you will find this useful.
|
Try using npc.name instead of the ID, then using findNPC(name) on serverside.
Quote:
PHP Code:
|
npc.name doesn't return the #n of the NPC?
|
Quote:
|
Sweet! Now if I can just get that to work...right now
PHP Code:
PHP Code:
In fact, PHP Code:
PHP Code:
|
So there IS such a command as findNPCByKD? You"wouldn't know by reading the wiki...OH, THERE IT IS. "findnpcby" brings nothing, "findnpc" has 0 hits, but "findnpcbyid" has a hit. SO YOU JUST HAVE TO SEARCH FOR THE EXMCT TERM. YOU JUST HAVE TO KNOW`EXACTLY WHAT YOU'RE LOO[ING FOR BEFORE YOU LOOK2FOR!IT.
Right now K got it passing ID from client to server (it stays the same), and the server does a gigantic findareanpcs, checks which one{ match IDs, and kills 'em. However - findnpcbyid is apparently clientside only. -_- |
Yea, I'm having the same problem right now actually...
It'd be nice if that worked serverside :( |
Quote:
|
All times are GMT +2. The time now is 04:19 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.