Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-23-2004, 05:21 AM
Blue_Dragn Blue_Dragn is offline
Registered User
Join Date: Jul 2003
Posts: 302
Blue_Dragn is on a distinguished road
setting player weapon

Is there anyway to do this? Say i want to have a certain weapon called to be the players active weapon (Thats activated when weaponfired)?

I tried a few things but have failed miserabally

Edit:

ive tried so far

selectedweapon =

but i think npcid changes, so that dosent work?
and i know you cant write #w like setplayerprop #w
__________________
No longer a Advertisement Goat

Last edited by Blue_Dragn; 02-23-2004 at 05:33 AM..
Reply With Quote
  #2  
Old 02-23-2004, 06:04 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
NPC Code:

for (a = 0;a < weaponscount;a++) {
if (strequals(#w(a),WeaponName)) selectedweapon = a;
}


?

(No, I don't like i.)
__________________
Kat
Reply With Quote
  #3  
Old 02-23-2004, 07:36 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Well if youre doing it from serverside access, you could remove it from their inventory then readd it. The newest weapon added always gets focus.
__________________
Reply With Quote
  #4  
Old 02-23-2004, 09:40 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
****y:
if(hasweapon(weaponname)){
}
Sorry double posted, here

if(!hasweapon(weaponname)){
addweapon namehere; //serverside
}

If they don't have the weapon it will add it.
__________________
V$:CONFL16T

Last edited by WanDaMan; 02-23-2004 at 02:58 PM..
Reply With Quote
  #5  
Old 02-23-2004, 11:31 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
What Kat said is clearly the preferred way
Please think of the background work that has to happen when deleting and readding a weapon.
Reply With Quote
  #6  
Old 02-23-2004, 06:07 PM
Blue_Dragn Blue_Dragn is offline
Registered User
Join Date: Jul 2003
Posts: 302
Blue_Dragn is on a distinguished road
Quote:
Originally posted by -Ramirez-
NPC Code:

for (a = 0;a < weaponscount;a++) {
if (strequals(#w(a),WeaponName)) selectedweapon = a;
}


?

(No, I don't like i.)
I hadnt thought of running it in a loop like that, thanks.
__________________
No longer a Advertisement Goat
Reply With Quote
  #7  
Old 02-23-2004, 11:11 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally posted by Loriel
What Kat said is clearly the preferred way
Please think of the background work that has to happen when deleting and readding a weapon.
Its a quick and dirty solution =p And Kat had already given a good one... and i like hearing myself speak...
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:26 AM.


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