Author Topic: Script Base  (Read 4530 times)

Offline ronon dex

  • Sateda my planet was destroyed.
Script Base
« on: June 21, 2012, 01:32:43 pm »
What is a script for buying a base? could someone help me with this?
Sorry, my english is bad.

JovankaB

  • Guest
Re: Script Base
« Reply #1 on: June 21, 2012, 03:36:10 pm »
Faction/bases is a 2238 feature. I'm not sure if SDK has something similar :?

Re: Script Base
« Reply #2 on: June 21, 2012, 03:50:23 pm »

Re: Script Base
« Reply #3 on: June 25, 2012, 08:18:24 pm »
Hello,
This Script from the site above works.
Though how to change
if (pid==PID_PRZEDMIOTU)
to multiple amounts?
would this be?
if (pid==PID_PRZEDMIOTU, 4 () )
Thanks

JovankaB

  • Guest
Re: Script Base
« Reply #4 on: June 25, 2012, 09:03:56 pm »
Hello,
This Script from the site above works.
Though how to change
if (pid==PID_PRZEDMIOTU)
to multiple amounts?
would this be?
if (pid==PID_PRZEDMIOTU, 4 () )
Thanks

You mean how to make it work for a few different item PIDs?

Code: [Select]
if( pid == PID_SOME_PID || pid == PID_SOME_OTHER_PID )which means: if pid is equal to PID_SOME_PID or PID_SOME_OTHER_PID

or

Code: [Select]
if( pid >= PID_SOME_PID_RANGE_START && pid <= PID_SOME_PID_RANGE_END )which means: if pid is in a range from PID_SOME_PID_RANGE_START to PID_SOME_PID_RANGE_END

Of course you have to use existing (defined) pid names,or just numbers.
« Last Edit: June 25, 2012, 09:06:07 pm by JovankaB »

Re: Script Base
« Reply #5 on: June 25, 2012, 09:13:43 pm »
Hello,
It wouldnt make too much sense in using multiple items, I mean, how are you going to do that inside of inventory?
what i meant was to have multiples of the same pid, such as 5 ropes .

JovankaB

  • Guest
Re: Script Base
« Reply #6 on: June 25, 2012, 09:31:48 pm »
Inside critter_use_item function I think this should work:

Code: [Select]
if( pid == PID_ROPE && item.GetCount() >= 5 )
But I'm not sure what you try to achieve...

Re: Script Base
« Reply #7 on: June 25, 2012, 09:35:32 pm »
Im trying to achieve so instead of using just one instance of rope to create a tent, you would need 10 ropes.

JovankaB

  • Guest
Re: Script Base
« Reply #8 on: June 25, 2012, 09:41:00 pm »
try this:

Code: [Select]
if( pid == PID_ROPE && item.GetCount() >= 10 ) {

   //...code...
    cr.DeleteItem(pid,10)

}

Re: Script Base
« Reply #9 on: June 25, 2012, 09:42:08 pm »
Nice, thanks a lot!!