Removing fuel generator gives back one that doesn't require fuel
I guess you killed a bracket somewhere.

That is the full file which compiles well and works ingame (at least for me)

Moderator edit: Please do not post or link random versions of plugins in forum posts.
Toliman
I guess you killed a bracket somewhere.

That is the full file which compiles well and works ingame (at least for me)

Moderator edit: Please do not post or link random versions of plugins in forum posts.

All is took out is what you said to take out (Puts(TargetEntity.ToString());). I copied the original code from exactly how it was sent in this forum. I've checked it over and over to make sure :) 

If you want to send me your file, assuming from the Moderator edit that you tried here, You can send it to me privately and I can try it.

I have sent the updated version to the writer.
If mods dont like help here, i just stop helping.
Toliman
I have sent the updated version to the writer.
If mods dont like help here, i just stop helping.

Nothing about you personally, we just do not allow random versions of plugins to be posted in forum posts. 

Toliman
I have sent the updated version to the writer.
If mods dont like help here, i just stop helping.

I think snippets of code are fine here, just the full file isnt.

I got it, i am sorry. It could cause trouble with different versions out there if there is an update.
krazy

I think snippets of code are fine here, just the full file isnt.

I think it is any code related to .cs file , snippets are fine for config/data examples.

5b7d22c4ef71f.jpg pookins

I think it is any code related to .cs file , snippets are fine for config/data examples.

Code is fine as snippets, entire plugins are not.

Thank you for your help. This trouble has been solved.
krazy

Ok, I did what you said, Its still throwing that error, Ill keep what I changed last night for now because I know that method works for me at least as I tested it on my server. Gave me back a fuel generator every time. :D

(10:25:46) | [Oxide] 10:25 [Error] Error while compiling: RemoverTool.cs(1000,31): error CS0030: Cannot convert type `System.Collections.Generic.KeyValuePair' to `System.Collections.Generic.KeyValuePair'
void GiveRefund(BasePlayer player, BaseEntity TargetEntity)
        {
            var refund = GetRefund(TargetEntity);
			foreach (KeyValuePair p in refund)
            {
                var itemname = p.Key.ToLower();
                if (ItemNameToItemID.ContainsKey(itemname))
                {
                    var itemid = ItemNameToItemID[itemname];
					
					//Start -  Fuel Generator Fix
					if(TargetEntity.ToString().Contains("small_fuel_generator"))
					{
						itemid = 1849887541;
					}
					//End - Fuel Generator Fix

                    var itemamount = (int)p.Value;
                    var item = ItemManager.CreateByItemID(itemid, itemamount);
                    player.GiveItem(item, BaseEntity.GiveItemReason.Generic);
                }
                else { Interface.Oxide.LogWarning(string.Format("{0} {1} didn't receive refund because {2} doesn't seem to be a valid item name", player.UserIDString, player.displayName, itemname)); }
            }
        }

 

Edit this line from: foreach (KeyValuePair p in refund)
To: foreach (KeyValuePair p in refund)



Merged post

Why words put in < > are not showing in the forum???