![]() |
fromweapons <weapon name>;
Instead of adding a weapon, it takes away a weapon from your inventory.
So, for example, if I wanted to talk weapon "Nukeshot" out of the players inventory, NPC Code: Sound interesting? |
Re: fromweapons <weapon name>;
Um. "removeweapon"?
|
This exists on the NPC Server. Although it'd be neat if Stefan could add it for offline uses too (Even though I usually just code my weapons I want to do that with seperately for that)
|
Hers an idea. Making the Test program regonize with as a standerd operation rather than a variable syntax problem @.@;
|
maybe an option to switch the debugger to NPCServer mode, so it wont detect NPCServer realated *****ings and let you debug your scripts like a man
|
If you code your own nukeshot, add this line:
if(isweapon&&deletenukeshot){ unset deletenukeshot; destroy; } Voila. Personally, I'd rather have setweapon weaponname; |
Quote:
You mean a command to set the currently selected weapon? How about "selectedweapon=whatever;" ? I'm sure you can figure out how to achieve the same effect from there. |
That would make sense, I suppose, except that = denotes an integer value, and I'm fairly certain the code
for(this.i=-;this.i<weaponscount;this.i++){ if(strequals(#w(this.i),Nukeshot)) selectedweapon=this.i; } would fail horribly. I might have to try setplayerprop #w,Nukeshot; though. ^_^ Amazing....while that didn't work, this did! if(hasweapon(Fishing Rod)){ while(!strequals(#w,Fishing Rod)&&selectedweapon>0) selectedweapon--; if(selectedweapon=0){ while(!strequals(#w,Fishing Rod)) selectedweapon++; } } It's pretty much bulletproof too, or so it seems...Yup! Works if the weapon it seeks is above or below the current selected one. |
NPC Code: That would be how to find the Bow. |
~AlphaFlame~The Fool~
Getting off topic here... Anyway, I think a fromweapon command would be handy ^_^ Put an NPC in the starting levels or throughout the server to get rid of illegal NPCs, or the such... hmm... <Various RCs> *starts to protest then realizes they wouldn't have to check accounts for illegal items* YAYYYYYY! |
Quote:
|
Methinks that either the flag-in-level or server-string-purge method is perfect for ALL WEAPONS. That way, to remove them, you just have to plop NPCs in a lot of levels, or with server-string-purge just one in a staff area with:
if(washit){ server.purgesystemv1=1; } where the version 1 system NPC being removed has: if(server.purgesystemv1=1){ message Removing Outdated System NPC...; sleep 3; destroy; } Or you can set a server string with the current version of *System or *Bankcard or whatever...thus, In the new version: if(created){ ... server.systemversion=2 ... } In the old version: if(server.systemversion>1){ message Removing Outdated System NPC...; sleep 3; destroy; } |
Quote:
|
Eh..
Wasn't there a post by Stefan in which he stated that system NPCs and such would be automatically updated if a new version of the level was uploaded?
|
I think It would be quite usefull if removeweapon and addweapon had messagecode support. :D
|
And maybe have removeweapon work clientside but only for weapons that dont have a * or an - in front of them
|
....
If you dont want the player to have a weapon....put something in a systems weapon like
if (hasweapon(nukeshot) {putnpc gfx,dienukeshotdie.txt,x,y; } in the txt file...put if (created || playerenters) {toweapons nukeshot; timeout = .1; } if (timeout) { if (isweapon) {destroy;} destroy; } And that will get rid of your nuke shot...or, it should atleast. Although, putnpc isnt the best of commands. |
NEVAR USE PUT NPC!!!!! AAARRRRR!!!!!!
*catches breath* Sorry i jusyt hate that command deeply. Especially now that there is putnpc2 wich is SOOOO much better. But if your non p2p i guess putnpc will have to do. But it would be so sucky to put lines of code in every weapon just so they can be deleted. Id rather have removeweapon clientside and allow messagecodes. Somuch EZer. |
Quote:
|
Efficiency is what counts. Putting the same line of code in every weapon isnt efficient. Its just stupid.
|
And i am lazy for the fact that id rather not waist time on something that need not be done?
|
NPC Code: works |
Ack! There really IS a weaponscount variable!
*dok*:megaeek: |
You didnt know that? *smacks Tyhm*
har har |
~AlphaFlame~
Is it just me, or did Stefan look at this thread and see it as something to do with setting the selected weapon? :confused: Fromweapons would be good... as in, next version type good u.u |
I guess I should have used #v or something to read my server string there...silly me.
|
| All times are GMT +2. The time now is 01:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.