Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Disabling Weapons when... (https://forums.graalonline.com/forums/showthread.php?t=24714)

zell12 02-28-2002 03:28 AM

Disabling Weapons when...
 
Only one weapon is highlighted... I think its something like:

NPC Code:
if (strequals(#w,RaWr)) {
disablewepons;
}
else enableweapons;
}


Goboom 02-28-2002 04:18 AM

.....wouldnt that disable the weapons list so you couldnt select another weapon...there for you cant ever select a new weapon?

zell12 02-28-2002 04:22 AM

well, there is something like disableinventorylist or somthing... but, it was on G2K1 with CTF

TDK_RC6 02-28-2002 04:33 AM

disableselectweapons
enableselectweapons

its something like that

zell12 02-28-2002 04:37 AM

i'll just talk to you on msn x.x

zell12 02-28-2002 05:09 AM

How do I destroy a weapon? like in the users inventory...
NPC Code:
if (platerenters&&strequals(#w,WeaponName&&isweapon)) {
destroy;
}


zell12 02-28-2002 06:36 AM

Anyone?:(

neomaximus2k 02-28-2002 06:40 AM

Quote:

Originally posted by zell12
How do I destroy a weapon? like in the users inventory...
NPC Code:
if (platerenters&&strequals(#w,WeaponName&&isweapon)) {
destroy;
}


not to sure on that, i had a script working but i lost it :(

joseyisleet 02-28-2002 11:08 AM

-=Josey=-
NPC Code:

if (playerenters&&hasweapon(yourweaponhere)){
toweapons yourweaponhere;
sleep .1;
destrory;
}



You may have to make the sleep just a tad bit longer. It should work though. Or in your weapon you could use:

NPC Code:

if (playerenters){
toweapons Destroying soon;
timeout=.05;
}
if (timeout&&hasweapon(Destroying soon)){
if (strequals(#L,levelname.graal)){
destroy;
}
timeout=.05;
}


You could use either of those two.

neomaximus2k 02-28-2002 02:18 PM

Quote:

Originally posted by joseyisleet
-=Josey=-
NPC Code:

if (playerenters&&hasweapon(yourweaponhere)){
toweapons yourweaponhere;
sleep .1;
destrory;
}



You may have to make the sleep just a tad bit longer. It should work though. Or in your weapon you could use:

NPC Code:

if (playerenters){
toweapons Destroying soon;
timeout=.05;
}
if (timeout&&hasweapon(Destroying soon)){
if (strequals(#L,levelname.graal)){
destroy;
}
timeout=.05;
}


You could use either of those two.


The question is when do you want the weapon to be destroyed?
if it is part of a trading system or something then you could add the bottom code from josey into everyweapon or try and make a global one.

zell12 03-01-2002 03:01 AM

well, I added a update, and im trying to get rid of the old weapon when they walk into a certian level

neomaximus2k 03-01-2002 06:01 AM

Quote:

Originally posted by zell12
well, I added a update, and im trying to get rid of the old weapon when they walk into a certian level
Ok then a simple thing would be...

in the weapon first of all...
NPC Code:

if (hasweapon(test)){
if (server.destroyweapon==1){server.destroy=0;
destroy;}
timeout=0.05;}


and the npc in a level
NPC Code:

if (playerenters && hasweapon(test)){
server.destroy=1;}


there are loads of other ways in which you can do this but that is the simpliest way of doing it i beleive

Saga2001 03-01-2002 06:18 AM

Quote:

Originally posted by TDK_RC6
disableselectweapons
enableselectweapons

its something like that

your right on the nose. and to answer the other question it has to be in the weapon, like:
NPC Code:

if (playertouchsme) toweapons weapon;
if (actionWeaponDestroy) destroy;


unless its p2p than its just:
NPC Code:

removeweapon weapon;



All times are GMT +2. The time now is 04:35 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.