PDA

View Full Version : Get credits


Mindtwistah
06-10-2007, 03:17 PM
What is the script to get credits?

I was thinking this:

Giveitem ("credits", "2000")

But I don't think that would work.

Gargoyle King
06-10-2007, 03:22 PM
What is the script to get credits?

I was thinking this:

Giveitem ("credits", "2000")

But I don't think that would work.

I'm quite a noob when it comes to modding, but i believe it is this:

To get credits:
GiveGoldToCreature( GetFirstPC(),nAmount);

To take credits away:
TakeGoldFromCreature( GetFirstPC(),nAmount);

- i think after the n, instead of "Amount" you put in the value for the credits.

Hope this helps! (if it's correct :lol: )

Master Zionosis
06-10-2007, 03:27 PM
A script like this would work, obviously "gold" is credits, lol:

void main() {
int nGoldPieces = (500);
object oNPC=GetObjectByTag("your_npc_tag");
GiveGoldToCreature(oNPC, nGoldPieces);
}

Replace 500 with the number of credits you want to be given to you, and replace "your_npc_tag" with the tag of the NPC thats giving you the credits. ;)

Mindtwistah
06-10-2007, 03:35 PM
If I put it in a dialog file where for example Bastila is giving me credits, do I have to put in this?
object oNPC=GetObjectByTag("your_npc_tag");

stoffe
06-10-2007, 04:10 PM
If I put it in a dialog file where for example Bastila is giving me credits, do I have to put in this?
object oNPC=GetObjectByTag("your_npc_tag");

No, if you give the credits to GetFirstPC() they will be added to the player/party credit account. This should be enough:


void main() {
GiveGoldToCreature(GetFirstPC(), 1000);
}

...where you replace 1000 with how many credits you want to give.

Mindtwistah
06-10-2007, 04:29 PM
Thanks to all of you for your help. I will probably use Stoffes scripts since it is the smallest one.