1

Topic: Creating a NPC

Okay, I downloaded Spectres' script editor. Took the sample scripts for npcs, made my own, Yadda yadda.

I have looked and looked, I haven't found a command that actually takes money from a player. Is that done server side? or what am I missing here?

Any help is appreciated, thanks.

-Chris

So let me simply add that it's my very good honor to meet you and you may call me "V"

2

Re: Creating a NPC

Scripts run entirely serverside, would be bad if they didn't  tongue

You have to use the inventory manipulation functions to remove items from inventory.

new gold = gsInvHasItem( sktid, 13, 100, 0, 0); // returns the inventory slot which contains the item or 0 if player doesn't have it.

if(gold != 0) { // player has it
gsInvDropItem(sktid, gold, 100); // removes 100 gold
gsInvSend(sktid); // notify player of the update

}

Last edited by Mr Spy (April 15th, 2010 3:59 PM)

3

Re: Creating a NPC

Mr Spy wrote:

Scripts run entirely serverside, would be bad if they didn't  tongue

You have to use the inventory manipulation functions to remove items from inventory.

new gold = gsInvHasItem( sktid, 13, 100, 0, 0); // returns the inventory slot which contains the item or 0 if player doesn't have it.

if(gold != 0) { // player has it
gsInvDropItem(sktid, gold, 100); // removes 100 gold
gsInvSend(sktid); // notify player of the update

}

I know they are all server side, just wanted to know if it was done at a later stage tongue

and thank you! smile

So let me simply add that it's my very good honor to meet you and you may call me "V"

4

Re: Creating a NPC

That syntax takes me back.  Haven't looked at a script in years.

5

Re: Creating a NPC

Just looks like java.

6

Re: Creating a NPC

morphine wrote:

Just looks like java.

The syntax yes, but sadly Pawn is all procedural.