fodev.net

FOnline Development => General Discussion => Topic started by: ronon dex on June 21, 2012, 01:32:43 pm

Title: Script Base
Post by: ronon dex on June 21, 2012, 01:32:43 pm
What is a script for buying a base? could someone help me with this?
Title: Re: Script Base
Post by: JovankaB on June 21, 2012, 03:36:10 pm
Faction/bases is a 2238 feature. I'm not sure if SDK has something similar :?
Title: Re: Script Base
Post by: White150 on June 21, 2012, 03:50:23 pm
http://forum.newfmc.pl/index.php?topic=222.0
Title: Re: Script Base
Post by: muhoooool 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
Title: Re: Script Base
Post by: JovankaB 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.
Title: Re: Script Base
Post by: muhoooool 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 .
Title: Re: Script Base
Post by: JovankaB 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...
Title: Re: Script Base
Post by: muhoooool 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.
Title: Re: Script Base
Post by: JovankaB on June 25, 2012, 09:41:00 pm
try this:

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

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

}
Title: Re: Script Base
Post by: muhoooool on June 25, 2012, 09:42:08 pm
Nice, thanks a lot!!