Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Windows

Server Support on Windows Get (and give) support on general questions related to the RunUO server itself.

Reply
 
Thread Tools Display Modes
Old 11-21-2004, 06:08 PM   #1 (permalink)
Forum Novice
 
Join Date: Nov 2004
Posts: 149
Default How do i add items to players packs?

I want to know if there is a command or series of comands that allows me to add a certain item to players who are logged on to the shard playing. Sort of like a reward for players that are playing the shard. I don't want the item to be added to players that are not loged in.

Thanks
Lifegranter is offline   Reply With Quote
Old 11-21-2004, 06:59 PM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Lifegranter
I want to know if there is a command or series of comands that allows me to add a certain item to players who are logged on to the shard playing. Sort of like a reward for players that are playing the shard. I don't want the item to be added to players that are not loged in.

Thanks
[global addtopack typehere where playermobile
Phantom is offline   Reply With Quote
Old 11-21-2004, 07:02 PM   #3 (permalink)
Forum Novice
 
Join Date: Nov 2004
Posts: 149
Default

and that won't add anyhting to players that arn't logged on?
Lifegranter is offline   Reply With Quote
Old 11-21-2004, 07:06 PM   #4 (permalink)
Forum Expert
 
Mortis's Avatar
 
Join Date: Oct 2002
Location: In My Cold Cell
Age: 44
Posts: 1,848
Default

Make an onlogon event. That way they get it when they login.

Something like this so they do not get it every login.

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;

namespace Server.Misc 
{ 
   public class XmasGift
   { 
      public static void Initialize() 
      { 

         EventSink.Login += new LoginEventHandler( OnLogin ); 
      } 

      public static void OnLogin( LoginEventArgs e ) 
      { 
		Mobile from = e.Mobile;

               if ( ((Account)from.Account).GetTag("XmasGift2004")== "true" )
	{
              }

              else if ( DateTime.Now.Month == 12 &&  DateTime.Now.Day == 25 ) 
	{

	     from.AddToBackpack( new GiftBox1() );
	     ((Account)from.Account).SetTag( "XmasGift2003", "true" );
	     from.SendMessage( "Happy Holidays from the staff of IRON MAIDEN. You have recieved a present in your backpack. :)" );
         }
      } 
   } 
}
You may not want the datetime stuff. so remove it.

This was just an example.
__________________
I'm waiting in my cold cell when the bell begins to chime
Reflecting on my past life and it doesn't have much time.
Mortis is offline   Reply With Quote
Old 11-27-2004, 08:47 AM   #5 (permalink)
Forum Novice
 
Join Date: Nov 2004
Posts: 149
Default

Phantom, that is the correct command, but when i use it, I added items to all the players wether or not they are loged in at the time of the command. I want to add items only to players that are logged in the world.
Is there a command for that?
Lifegranter is offline   Reply With Quote
Old 11-27-2004, 10:38 AM   #6 (permalink)
psz
UO Gamers: Demise Administrator
 
psz's Avatar
 
Join Date: Oct 2002
Location: Swamp
Age: 29
Posts: 10,819
Default

Sure, modify it to NOT add to players who are in Internal map.
__________________
psz
Demise' Creator (Retired)
The RunUO.com Forum Moderator Team
Former Official RunUO Scripter (Retired)
Websites:
My 360 Blog
My Gaming Site(Old Link)
My Gaming Site(New Link)
psz is online now   Reply With Quote
Old 11-27-2004, 10:40 AM   #7 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Lifegranter
Phantom, that is the correct command, but when i use it, I added items to all the players wether or not they are loged in at the time of the command. I want to add items only to players that are logged in the world.
Is there a command for that?

You asked for a command to add an item to your players pack, so I gave it to you.

There is of course the online command and many other ways you could do it, global is far from the best solution.
Phantom is offline   Reply With Quote
Old 11-27-2004, 01:14 PM   #8 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Quote:
Originally Posted by Lifegranter
...certain item to players who are logged on to the shard playing...


I'm not really a whiz at building those gm commands like psz and Asayre8 but it can be done, combine Phantoms command with psz's suggestion. I'll figure it out next time I log into the shard.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 11-27-2004, 01:44 PM   #9 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,372
Default

Use [online instead of [global ("where playermobile" not needed for this method).

[online addtopack dagger set loottype blessed name "a bloody knife" hue 0x22
HellRazor is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5