Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RemoveItem("tinderbox") not working!
ehovda321 Offline
Junior Member

Posts: 38
Threads: 22
Joined: Dec 2011
Reputation: 0
#1
RemoveItem("tinderbox") not working!

Here is my script -

Spoiler below!


void OnStart()
{
SetEntityPlayerInteractCallback("buy_a", "buy_a", false);
SetEntityPlayerInteractCallback("sell_a", "sell_a", false);
}

void buy_a(string &in asEntity)
{

if(GetGlobalVarInt("buy_a") == 0) // < --- STOCK \\
{
SetGlobalVarInt("buy_a", 0);
SetMessage("store", "out", 3);
}

if(GetGlobalVarInt("balance") < 3) // < --- BALANCE \\
{
SetMessage("store", "cannotafford", 3);
}

if(GetGlobalVarInt("buy_a") > 0) // < --- STOCK \\
{
if(GetGlobalVarInt("balance") > 2) // < --- BALANCE \\
{
t_count++;
GiveItemFromFile("tinderbox_"+(t_count), "tinderbox.ent");
PlayGuiSound("cash_register.ogg", 1);
AddGlobalVarInt("balance", -3);
AddGlobalVarInt("buy_a", -1);
AddGlobalVarInt("tinderbox_total", 1);
SetMessage("store", "bought_a", 2.5);
checkamount_buy();
checkbalance();
}
}

}

void sell_a(string &in asEntity) // < -- Player SELLS ONE TINDERBOX \\
{

if(GetGlobalVarInt("tinderbox_total") == 0)
{
SetMessage("store", "notenough", 3);
}

if(GetGlobalVarInt("tinderbox_total") > 0) // < --- YOUR AMOUNT \\
{

for(int z = 1; z < 251; z++)
{
RemoveItem("tinderbox_"+(z - 1));
}

for(int y = 0; y < GetGlobalVarInt("tinderbox_total"); y++)
{
RemoveItem("tinderbox");
}


t_count++;
GiveItemFromFile("tinderbox_"+(t_count), "tinderbox.ent");


PlayGuiSound("cash_register.ogg", 1);
AddGlobalVarInt("balance", 2);
AddGlobalVarInt("buy_a", 1);
AddGlobalVarInt("tinderbox_total", -1);
SetMessage("store", "sold_a", 2.5);
checkamount_sell();
checkbalance();

}
}





What's the problem? When I click the button for "sell_a", it will double the amount!?
(This post was last modified: 03-29-2013, 01:50 AM by ehovda321.)
03-29-2013, 01:50 AM
Find Reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: RemoveItem("tinderbox") not working!

Tinderboxes cannot be deleted nor can it be removed.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-29-2013, 01:51 AM
Find Reply
ehovda321 Offline
Junior Member

Posts: 38
Threads: 22
Joined: Dec 2011
Reputation: 0
#3
RE: RemoveItem("tinderbox") not working!

(03-29-2013, 01:51 AM)JustAnotherPlayer Wrote: Tinderboxes cannot be deleted nor can it be removed.

I figured out what to do, thanks for the reply- you helped me solve that problem... It could not be removed since the .ent file itself made it impossible to be removed via script.
04-09-2013, 05:35 AM
Find Reply




Users browsing this thread: 1 Guest(s)