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 08-03-2005, 09:13 PM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
Adding weapons

How would i add a weapon though npc sever? i have no clue i forget i think is it addweapon weapon name or something like that
Reply With Quote
  #2  
Old 08-03-2005, 09:27 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by alissalee
How would i add a weapon though npc sever? i have no clue i forget i think is it addweapon weapon name or something like that
What do you mean?

Creating a weapon in NC or adding a weapon to a player?
Reply With Quote
  #3  
Old 08-03-2005, 09:28 PM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
adding a weapon to player by using the npc sever message
Reply With Quote
  #4  
Old 08-03-2005, 09:40 PM
URBANLEGEND URBANLEGEND is offline
No sleep till brooklyn!
Join Date: Sep 2002
Location: USA
Posts: 775
URBANLEGEND is on a distinguished road
Send a message via ICQ to URBANLEGEND Send a message via AIM to URBANLEGEND Send a message via MSN to URBANLEGEND Send a message via Yahoo to URBANLEGEND
adweapon weaponname;
__________________
~Urban
Reply With Quote
  #5  
Old 08-09-2005, 10:03 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
You might want to make a player class, and put this in. (GS2 Required.)

PHP Code:
// player.addWeapons({weap1,weap2,weap3,and so on});
public function addWeapons(weaps)
{
  for (
weapweaps)
  {
    
this.addweapon(weap);
  }

__________________
In a world of change... Who'll you believe?
Reply With Quote
  #6  
Old 08-10-2005, 07:55 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
You might want to make a player class, and put this in. (GS2 Required.)

PHP Code:
// player.addWeapons({weap1,weap2,weap3,and so on});
public function addWeapons(weaps)
{
  for (
weapweaps)
  {
    
this.addweapon(weap);
  }

Don't confuse the poor kid.
Reply With Quote
  #7  
Old 08-16-2005, 12:57 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
can i add a weapon to the player though a lvl npc like buying items how would i do that the same way?
Reply With Quote
  #8  
Old 08-16-2005, 01:50 AM
Matt Matt is offline
iZone Administrator
Matt's Avatar
Join Date: Apr 2005
Location: United States
Posts: 2,690
Matt is a jewel in the roughMatt is a jewel in the rough
Quote:
Originally Posted by alissalee
can i add a weapon to the player though a lvl npc like buying items how would i do that the same way?
Add the script to WEAPONS through NPC Control. Then open a level and put a script such as this in it:

//#CLIENTSIDE
if (playertouchsme){addweapon weaponnamehere';}

You'll have to get to known the scripting commands better if you want it to go to your attributes when you say something like 'buy 'weaponname'. Also i don't think it's a good idea to use Clientside anyways.

If you want an NPC to be added to everyones attributes once they logon put this in Control-NPC:

if (actionplayeronline){addweapon 'weaponnamehere';}
__________________
Need Playerworld or Account support?
GraalOnline/Toonslab Support Center
Reply With Quote
  #9  
Old 08-16-2005, 02:15 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
addweapon does not work clientside.

NPC Code:

// npc called "-weaponadder"

if (actionserverside) {
if (strequals(#p(0),addw)) {
with(getplayer(#p(1))) addweapon #p(2);
}
}

//#CLIENTSIDE
if (weaponfired) {
triggeraction 0,0,serverside,-weaponadder,addw,#a,NPC/Thinger;
}



that npc, when fired, adds the weapon NPC/Thinger to the player.


a level npc (shop or suchlike) could also use that trigger, granted the player has a weapon on them like that one that accepts the addw trigger
__________________
Reply With Quote
  #10  
Old 08-16-2005, 02:51 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Matt
Add the script to WEAPONS through NPC Control. Then open a level and put a script such as this in it:

//#CLIENTSIDE
if (playertouchsme){addweapon weaponnamehere';}

You'll have to get to known the scripting commands better if you want it to go to your attributes when you say something like 'buy 'weaponname'. Also i don't think it's a good idea to use Clientside anyways.

If you want an NPC to be added to everyones attributes once they logon put this in Control-NPC:

if (actionplayeronline){addweapon 'weaponnamehere';}
addweapon does not work clientside. Please do not give bad advice.
Reply With Quote
  #11  
Old 08-16-2005, 02:51 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by calani
addweapon does not work clientside.

NPC Code:

// npc called "-weaponadder"

if (actionserverside) {
if (strequals(#p(0),addw)) {
with(getplayer(#p(1))) addweapon #p(2);
}
}

//#CLIENTSIDE
if (weaponfired) {
triggeraction 0,0,serverside,-weaponadder,addw,#a,NPC/Thinger;
}



that npc, when fired, adds the weapon NPC/Thinger to the player.


a level npc (shop or suchlike) could also use that trigger, granted the player has a weapon on them like that one that accepts the addw trigger
If people were meant to be able to be able to add any weapon clientside, it would not be a serverside command. Please do not encourage the circumvention of this security measure.
Reply With Quote
  #12  
Old 08-16-2005, 03:05 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Quote:
Originally Posted by Lance
If people were meant to be able to be able to add any weapon clientside, it would not be a serverside command. Please do not encourage the circumvention of this security measure.
How else do you propose you make a shop that adds weapons, or a droppable inventory system?
A DB? That would confuse the poor person.
And besides, the only people that would know how to use the trigger would be staff. Players uploading a playerhouse with a script to add weapons wouldn't know how, plus, any player levels should be inspected and approved before uploading in the first place.
Nearly every server has a system npc with an addweapon function on it, so don't even go there.
__________________
Reply With Quote
  #13  
Old 08-16-2005, 03:54 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by calani
How else do you propose you make a shop that adds weapons, or a droppable inventory system?
Through a nifty serverside level NPC or DB NPC? Also: any decent inventory system would make sure the person should have something before adding it.

Quote:
A DB? That would confuse the poor person.
Moreso than a triggeraction? Take a moment and think about that.

Quote:
And besides, the only people that would know how to use the trigger would be staff.
Or clever trainer users. We don't need what happens on UN to happen on any other server.

Quote:
Players uploading a playerhouse with a script to add weapons wouldn't know how, plus, any player levels should be inspected and approved before uploading in the first place.
Irrelevant. We're talking about the security of a weapon NPC. One would not need to have any other scripts uploaded to exploit the security flaw in that weapon.

Quote:
Nearly every server has a system npc with an addweapon function on it, so don't even go there.
And nearly every server had an insecure Control-NPC triggeraction 'actionserverwarp' before we swept the servers and insisted they remove it. A lot of people doing a bad practice does not change the fact that it's a bad practice and insecure.
Reply With Quote
  #14  
Old 08-16-2005, 04:00 AM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
Calani got own't!

The person you're talking to, however, most likely lacks the intelligence to understand the difference between 'secure' and 'insecure' triggeractions.

And every single server has insecure triggeractions like this, which are actively abused to do things such as reseting people, but the PWA could really care less about their existance.
Reply With Quote
  #15  
Old 08-16-2005, 05:01 AM
Matt Matt is offline
iZone Administrator
Matt's Avatar
Join Date: Apr 2005
Location: United States
Posts: 2,690
Matt is a jewel in the roughMatt is a jewel in the rough
Quote:
Originally Posted by Lance
addweapon does not work clientside. Please do not give bad advice.
If i knew it was 'bad' i would'nt have given it. As i stated before, i'm not great when it comes to scripting. My mistake though, i guess.
__________________
Need Playerworld or Account support?
GraalOnline/Toonslab Support Center
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 07:30 PM.


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