Approved Fougerite MC [Deleted]

Status
Not open for further replies.

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
As far as i know MC are update packages which rely on the base 1.0.5. Tho not sure about this issue.
This would make sense, however should be said and highlighted that this is an update package, I do believe I read that in first post now that you mention it. Also would make perfect sense why 1.0.5 > MC5 worked.

I will update my install guide with how to UPGRADE to MC5. :)
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Installing 1.0.5 on a clean server then pasting MC5 files and overwritting.
None of these builds have dependency on a previous installation of Fougerite being there. I always test Vanilla unpatched, and also my already-patched server. You don't have to patch again for a new build, just overwrite the files and restart the server.

"Update" simply means it doesn't include the sample plugins and default configuration files. Just the new dll.

MC5 includes the config files and sample plugins, because I added IronPythonModule and its example plugin. I also wanted to enable IPM and JintPlugin by default in Fougerite.cfg. I've given MC5 to FPSplayers to make available to their customers in their control panel. So I needed to make a "Full" install this time. You can surely use a "Full" install as an update. Just be careful not to unzip default config files overwriting your settings.

We don't have a polished installer/patcher yet that does the right thing. Take my new Fougerite.cfg, or not, it's your choice. This thing is configurable to your liking.
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
None of these builds have dependency on a previous installation of Fougerite being there. I always test Vanilla unpatched, and also my already-patched server. You don't have to patch again for a new build, just overwrite the files and restart the server.

"Update" simply means it doesn't include the sample plugins and default configuration files. Just the new dll.

MC5 includes the config files and sample plugins, because I added IronPythonModule and its example plugin. I also wanted to enable IPM and JintPlugin by default in Fougerite.cfg. I've given MC5 to FPSplayers to make available to their customers in their control panel. So I needed to make a "Full" install this time. You can surely use a "Full" install as an update. Just be careful not to unzip default config files overwriting your settings.

We don't have a polished installer/patcher yet that does the right thing. Take my new Fougerite.cfg, or not, it's your choice. This thing is configurable to your liking.
AH, ok thanks for the clarification!


Had a question...why is the Save folder not named Plugins? Doesn't make sense to me...
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
That is where the Magma\ folder was located in the original Magma plugin. So the default settings would run existing Magma plugins after upgrading from Magma to Fougerite, right "out of the box."
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
That is where the Magma\ folder was located in the original Magma plugin. So the default settings would run existing Magma plugins after upgrading from Magma to Fougerite, right "out of the box."
Wow, so why was it that way originally? Not named plugins?

Having problems with plugins that havent been edited that didnt exist on MC4:

Code:
[9/24/2014 11:29:29 AM] [Error] [Magma] Error invoking function On_PlayerConnected in AutoKit plugin.
[9/24/2014 11:29:29 AM] [Exception] [ Plugin->Invoke | Plugin->OnPlayerConnected | Hooks->PlayerConnect | RustServerManagement->OnUserConnected | ConnectionAcceptor->uLink_OnPlayerConnected | GameObject->SendMessage | #=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=->#=qnBC8vvHltGiAoAcoGPaaAA== | #=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=->#=qopOwgPOjk_HOzOwWVDsWIQ== | #=qr9YotdsWVwSdbrj6D5OlmHWwwJVhBeBIJ5J461Az$DQ=->#=qM25p$Ei_tgo0VZPqr5NeJg== | #=qxj6gmeF_JmZ38rfyBJuqFoiB_sAo6WCf4j1AdQtxGgQ=->#=q2HqDTZFVDws8Yv2UHd8me8CJU2rmEhl0UENDzxjFAFA= | #=qxj6gmeF_JmZ38rfyBJuqFoiB_sAo6WCf4j1AdQtxGgQ=->#=qGm_HL$oYHQfIKbtxj_QFnQ== | NetworkPlayerApproval->Approve | <AuthorisationRoutine>c__Iterator31->MoveNext | ]
System.NullReferenceException: Object reference not set to an instance of an object
at Fougerite.PlayerInv..ctor (Fougerite.Player) <0x0001e>
at Fougerite.Player.get_Inventory () <0x00036>
at (wrapper dynamic-method) Jint.Marshal.ProxyHelper.dynamicPropertyGetter (Jint.Marshaller,Jint.Native.JsDictionaryObject) <0x00029>
at Jint.Native.NativeDescriptor.Get (Jint.Native.JsDictionaryObject) <0x0002a>
at Jint.Native.JsDictionaryObject.TryGetProperty (string,Jint.Native.JsInstance&) <0x00047>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.PropertyExpression) <0x00085>
at Jint.Expressions.PropertyExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.MemberExpression) <0x0003e>
at Jint.Expressions.MemberExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.MemberExpression) <0x00029>
at Jint.Expressions.MemberExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.MemberExpression) <0x00029>
at Jint.Expressions.MemberExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BinaryExpression) <0x00031>
at Jint.Expressions.BinaryExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BinaryExpression) <0x00031>
at Jint.Expressions.BinaryExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BinaryExpression) <0x00031>
at Jint.Expressions.BinaryExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BinaryExpression) <0x00031>
at Jint.Expressions.BinaryExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.IfStatement) <0x0001c>
at Jint.Expressions.IfStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BlockStatement) <0x000b4>
at Jint.Expressions.BlockStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BlockStatement) <0x000b4>
at Jint.Expressions.BlockStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.Native.JsFunction.Execute (Jint.Expressions.IJintVisitor,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[]) <0x0008c>
at Jint.ExecutionVisitor.ExecuteFunction (Jint.Native.JsFunction,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[],System.Type[]) <0x0033c>
at Jint.ExecutionVisitor.ExecuteFunction (Jint.Native.JsFunction,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[]) <0x0001b>
at Jint.JintEngine.CallFunction (Jint.Native.JsFunction,object[]) <0x00066>
at Jint.JintEngine.CallFunction (string,object[]) <0x00094>
at MagmaPlugin.Plugin.Invoke (string,object[]) <0x00024>
and

Code:
[9/24/2014 11:29:53 AM] [Error] [Magma] Error invoking function On_PlayerSpawned in AutoKit plugin.
[9/24/2014 11:29:53 AM] [Exception] [ Plugin->Invoke | Plugin->OnPlayerSpawned | Hooks->PlayerSpawned | ServerManagement->SpawnPlayer | NetUser->InitializeClientToServer | ServerManagement->ConnectUserToGame | ServerManagement->ClientFirstReady | MonoMethod->InternalInvoke | MonoMethod->Invoke | MethodBase->Invoke | #=qaL2AMBCaBLCj4lGSCwjcBVYUs_5vzeQVgu44HVklVYQ=->#=qG_E6hqIvz6NLWQQCT2N5IA== | #=q$NUWz6aT_ypN3cz7K6ce2gVWapiYAlnLPGzKjIUfT2w=->#=qS9ntZNSJqwnPkZv_HZvsug== | NetworkView->OnRPC | NetworkViewBase->#=qpJfiNEhSKsosBj54zW21Bw== | #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=->#=qlGEZiB55BOeKhe33IbTgs3lVmx7rHXWsIFfTvKtNlrQ= | #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=->#=qIPn628V9gmXGKu9CDwAT4Q== | #=qxj6gmeF_JmZ38rfyBJuqFoiB_sAo6WCf4j1AdQtxGgQ=->#=qpnen9BDYWb7GIHNeIDM0B2w3_bWY6Y1K7n6fbysAk2U= | #=qxj6gmeF_JmZ38rfyBJuqFoiB_sAo6WCf4j1AdQtxGgQ=->#=qnjPTIXsYLyWun9DHM4QyDdSqTLT$sNaH7rGgebuLUF8= | #=qxj6gmeF_JmZ38rfyBJuqFoiB_sAo6WCf4j1AdQtxGgQ=->#=q9Ox7MeTma6fxAsTig99GV6twoS8KYKSkq98q3ldn1AU= | #=qxj6gmeF_JmZ38rfyBJuqFoiB_sAo6WCf4j1AdQtxGgQ=->#=qdSwDnRo$f5EQslih94YkOg== | #=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=->#=qqJfJJIU5OocEzCry9eP0ew== | #=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=->#=qK4rBLHQlJi1c$9ISNO6Z6w== | InternalHelper->LateUpdate | ]
System.FormatException: Input string was not in the correct format
at int.Parse (string,System.Globalization.NumberStyles,System.IFormatProvider) <0x00046>
at int.Parse (string,System.IFormatProvider) <0x00015>
at System.Convert.ToInt32 (string,System.IFormatProvider) <0x0001d>
at string.System.IConvertible.ToInt32 (System.IFormatProvider) <0x00013>
at System.Convert.ToType (object,System.Type,System.IFormatProvider,bool) <0x003b8>
at System.Convert.ChangeType (object,System.Type) <0x0005c>
at Jint.Marshaller.MarshalJsValue<int> (Jint.Native.JsInstance) <0x0040f>
at (wrapper dynamic-method) Jint.Marshal.ProxyHelper.jsWrapper (Jint.Native.IGlobal,Jint.Native.JsInstance,Jint.Native.JsInstance[]) <0x000a8>
at Jint.Native.NativeMethodOverload.Execute (Jint.Expressions.IJintVisitor,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[],System.Type[]) <0x0008d>
at Jint.Native.NativeMethodOverload.Execute (Jint.Expressions.IJintVisitor,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[]) <0x00024>
at Jint.ExecutionVisitor.ExecuteFunction (Jint.Native.JsFunction,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[],System.Type[]) <0x0033c>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.MethodCall) <0x0042c>
at Jint.Expressions.MethodCall.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.MemberExpression) <0x0003e>
at Jint.Expressions.MemberExpression.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.ExpressionStatement) <0x0001c>
at Jint.Expressions.ExpressionStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BlockStatement) <0x000b4>
at Jint.Expressions.BlockStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.IfStatement) <0x0005d>
at Jint.Expressions.IfStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.IfStatement) <0x0007d>
at Jint.Expressions.IfStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BlockStatement) <0x000b4>
at Jint.Expressions.BlockStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.ExecutionVisitor.Visit (Jint.Expressions.BlockStatement) <0x000b4>
at Jint.Expressions.BlockStatement.Accept (Jint.Expressions.IStatementVisitor) <0x0001e>
at Jint.Native.JsFunction.Execute (Jint.Expressions.IJintVisitor,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[]) <0x0008c>
at Jint.ExecutionVisitor.ExecuteFunction (Jint.Native.JsFunction,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[],System.Type[]) <0x0033c>
at Jint.ExecutionVisitor.ExecuteFunction (Jint.Native.JsFunction,Jint.Native.JsDictionaryObject,Jint.Native.JsInstance[]) <0x0001b>
at Jint.JintEngine.CallFunction (Jint.Native.JsFunction,object[]) <0x00066>
at Jint.JintEngine.CallFunction (string,object[]) <0x00094>
at MagmaPlugin.Plugin.Invoke (string,object[]) <0x00024>
Plugin code:
JavaScript:
function On_PlayerConnected(Player){
    if(Player.Inventory.HasItem("Rock") == true && Player.Inventory.HasItem("Bandage") == true && Player.Inventory.HasItem("Torch") == true){
        Player.Inventory.ClearAll();
        Player.Inventory.AddItemTo("Kevlar Helmet", 36, 1);
        Player.Inventory.AddItemTo("Kevlar Vest", 37, 1);
        Player.Inventory.AddItemTo("Kevlar Pants", 38, 1);
        Player.Inventory.AddItemTo("Kevlar Boots", 39, 1);
        Player.Inventory.AddItemTo("M4", 30, 1);
        Player.Inventory.AddItemTo("Shotgun", 31, 1);
        Player.Inventory.AddItemTo("9mm Pistol", 32, 1);
        Player.Inventory.AddItemTo("Large Medkit", 33, 2);
        Player.Inventory.AddItemTo("Small Rations", 34, 5);
        Player.Inventory.AddItemTo("Hatchet", 35, 1);
        //Player.Inventory.AddItem("9mm Ammo", 23);
        //Player.Inventory.AddItem("556 Ammo", 250);
        //Player.Inventory.AddItem("Handmade Shell", 15);
        Player.Inventory.AddItem("Holo Sight", 1);
        Player.Inventory.AddItem("Silencer", 1);
    }else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItem("Rock");}
}
function On_PlayerSpawned(Player, SpawnEvent){
    if(Player.Inventory.HasItem("Rock") == true && Player.Inventory.HasItem("Bandage") == true && Player.Inventory.HasItem("Torch") == true){
        Player.Inventory.ClearAll();
        Player.Inventory.AddItemTo("Kevlar Helmet", 36, 1);
        Player.Inventory.AddItemTo("Kevlar Vest", 37, 1);
        Player.Inventory.AddItemTo("Kevlar Pants", 38, 1);
        Player.Inventory.AddItemTo("Kevlar Boots", 39, 1);
        Player.Inventory.AddItemTo("M4", 30, 1);
        Player.Inventory.AddItemTo("Shotgun", 31, 1);
        Player.Inventory.AddItemTo("9mm Pistol", 32, 1);
        Player.Inventory.AddItemTo("Large Medkit", 33, 2);
        Player.Inventory.AddItemTo("Small Rations", 34, 5);
        Player.Inventory.AddItemTo("Hatchet", 35, 1);
        //Player.Inventory.AddItem("9mm Ammo", 23);
        //Player.Inventory.AddItem("556 Ammo", 250);
        //Player.Inventory.AddItem("Handmade Shell", 15);
        Player.Inventory.AddItem("Holo Sight", 1);
        Player.Inventory.AddItem("Silencer", 1);
    }else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItem("Rock");}
}
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Player's inventory might not get instanced until On_PlayerSpawned. On_PlayerConnected can safely check Player.IP, GameID, the time of connection, and that's about it. Everything else should wait until On_PlayerSpawned,
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
Works on spawned however, doesnt like taking my rock...and that seems the be the error.
Code:
else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItem("Rock");}
even know I have rock, doesn't remove it. spits an error and doesn't remove rock.


Seems many rust++ functions aren't working. Time freeze doesnt work when set to true.
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Works on spawned however, doesnt like taking my rock...and that seems the be the error.
Code:
else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItem("Rock");}
even know I have rock, doesn't remove it. spits an error and doesn't remove rock.
That code is broken since Magma was a thing. Player Inventory needs a re-imagining.
JavaScript:
Player.Inventory.RemoveItem(30);
That's the only way to remove the Rock on spawn. Just remove it from slot 30. Testing for it always returns false. You should be able to test if it's not a Rock, and leave it. The problem is the test for an item in the slot looks for the item name and UsesLeft >= 1. Weapons have UsesLeft set to the number of rounds loaded. Rocks can't load rounds. Neither can Bows. UsesLeft is always zero for these items, so you can't find them with the method bugged like this. I don't believe you can find weapons that are not loaded, either. Anway, it's broke.

Seems many rust++ functions aren't working. Time freeze doesnt work when set to true.
That's probably fixable. I'll take a look. Thanks for the report.
 
Last edited:

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
Works fine first spawn or after death, but when you rejoin with items, it wont remove it; but if you are doing a battlefield server, and you spawn with other items, then are given a rock, makes it more difficult with your suggestion. Could I make an array of every item in game you can put in inventory and check against players inventory and if it !=null or not on item list remove it?

Or could just have the players drop the rock and get over it XD
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Works fine first spawn or after death, but when you rejoin with items, it wont remove it; but if you are doing a battlefield server, and you spawn with other items, then are given a rock, makes it more difficult with your suggestion.
The battlefield plugin should start a timer for 1 sec in on_PlayerSpawned. Don't give Battlefield items in the hook, give them in the timer callback. Then you can know the Rock is in slot 30, and not a weapon from the battlefield plugin. Yank it, give weapons, good to go.
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Seems many rust++ functions aren't working. Time freeze doesnt work when set to true.
Turns out there isn't any code in Rust++ that gets the setting for time_freeze. There isn't any code in Magma that looks for it, either. This feature was never implemented.

Other features that do not exist in Rust++, but have settings in the default cfg file:

rampfix=true
rampgiveback=true

Partial:
decay=false only affects deployable items that are placed on the ground. It has no effect on structures or items deployed on structures.
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
The battlefield plugin should start a timer for 1 sec in on_PlayerSpawned. Don't give Battlefield items in the hook, give them in the timer callback. Then you can know the Rock is in slot 30, and not a weapon from the battlefield plugin. Yank it, give weapons, good to go.
Actually this isn't required, with my current code gets rid of rock =D after death or on new join, PlayerInv.ClearAll(). The problem comes when they have stuff and leave then rejoin and still have the stuff, rust decides its a good idea to give them a rock. That's where the problem exists.

There should also be a rock=fuckoff setting in Rust++. I'll see what I can do.
That would be awesome! Like an override to any calls for a rock returns empty :)

Turns out there isn't any code in Rust++ that gets the setting for time_freeze. There isn't any code in Magma that looks for it, either. This feature was never implemented.

Other features that do not exist in Rust++, but have settings in the default cfg file:

rampfix=true
rampgiveback=true

Partial:
decay=false only affects deployable items that are placed on the ground. It has no effect on structures or items deployed on structures.
Say WHATTTTTTTTTT:eek::confused:
 
Last edited:

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Actually this isn't required, with my current code gets rid of rock =D after death or on new join, PlayerInv.ClearAll(). The problem comes when they have stuff and leave then rejoin and still have the stuff, rust decides its a good idea to give them a rock. That's where the problem exists.
Are you doing PlayerInv.ClearAll() to just remove a rock?
You could do
Code:
Player.Inventory.RemoveItem("Rock", 1);
(I probably read your post wrong, If so just ignore).
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
Works on spawned however, doesnt like taking my rock...and that seems the be the error.
Code:
else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItem("Rock");}
even know I have rock, doesn't remove it. spits an error and doesn't remove rock.


Seems many rust++ functions aren't working. Time freeze doesnt work when set to true.
The correct use of RemoveItem needs a PlayerItem or a slot (int) or a name (string) + quantity (int).



You should use :
Player.Inventory.RemoveItem("Rock"
, 1);



Probably, that's the reason it doesn't work.
 
  • Winner
Reactions: mikec

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
Are you doing PlayerInv.ClearAll() to just remove a rock?
You could do
Code:
Player.Inventory.RemoveItem("Rock", 1);
(I probably read your post wrong, If so just ignore).
LOL, thank goodness I'm a little smarter than using PlayerInv.ClearAll() just to remove rock. XD

But no when you first spawn (either from death or first connect, not respawning after reconnecting which is what the second if is for) I clear all inventory instead of select slots or items, before giving player items. Gets rid of the start items uses less code and works as effective if not better than your original battlefield plugin code in which uses RemoveItem for each starter item. I would suggest you "upgrade". Less code less that can go wrong and while very small, should run faster (1 command instead of 3). :)

The correct use of RemoveItem needs a PlayerItem or a slot (int) or a name (string) + quantity (int).



You should use :
Player.Inventory.RemoveItem("Rock"
, 1);

Probably, that's the reason it doesn't work.
Or could just use RemoveItemAll("Rock"); Which I have upgraded to already, that is old code. Check it out now, currently running on my Normal Modded Server:

JavaScript:
//Title: AutoKit
//Author: CorrosionX
//Version: 1.0
function On_PlayerConnected(Player, player){
    if(Player.Inventory.HasItem("Rock") == true && Player.Inventory.HasItem("Bandage") == true && Player.Inventory.HasItem("Torch") == true){
        Player.Inventory.ClearAll();
        Player.Inventory.AddItemTo("Cloth Helmet", 36, 1);
        Player.Inventory.AddItemTo("Cloth Vest", 37, 1);
        Player.Inventory.AddItemTo("Cloth Pants", 38, 1);
        Player.Inventory.AddItemTo("Cloth Boots", 39, 1);
        Player.Inventory.AddItemTo("9mm Pistol", 30, 1);
        Player.Inventory.AddItemTo("Pipe Shotgun", 31, 1);
        //Player.Inventory.AddItemTo("", 35, 1);
        Player.Inventory.AddItemTo("Small Medkit", 33, 2);
        Player.Inventory.AddItemTo("Small Rations", 34, 5);
        Player.Inventory.AddItemTo("Hatchet", 35, 1);
        Player.Inventory.AddItem("9mm Ammo", 23);
        //Player.Inventory.AddItem("556 Ammo", 250);
        Player.Inventory.AddItem("Handmade Shell", 15);
        //Player.Inventory.AddItem("Holo Sight", 1);
        //Player.Inventory.AddItem("Silencer", 1);
    }else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItemAll("Rock");}
}
function On_PlayerSpawned(Player, SpawnEvent){
    if(Player.Inventory.HasItem("Rock") == true && Player.Inventory.HasItem("Bandage") == true && Player.Inventory.HasItem("Torch") == true){
        Player.Inventory.ClearAll();
        Player.Inventory.AddItemTo("Cloth Helmet", 36, 1);
        Player.Inventory.AddItemTo("Cloth Vest", 37, 1);
        Player.Inventory.AddItemTo("Cloth Pants", 38, 1);
        Player.Inventory.AddItemTo("Cloth Boots", 39, 1);
        Player.Inventory.AddItemTo("9mm Pistol", 30, 1);
        Player.Inventory.AddItemTo("Pipe Shotgun", 31, 1);
        //Player.Inventory.AddItemTo("", 35, 1);
        Player.Inventory.AddItemTo("Small Medkit", 33, 2);
        Player.Inventory.AddItemTo("Small Rations", 34, 5);
        Player.Inventory.AddItemTo("Hatchet", 35, 1);
        Player.Inventory.AddItem("9mm Ammo", 23);
        //Player.Inventory.AddItem("556 Ammo", 250);
        Player.Inventory.AddItem("Handmade Shell", 15);
        //Player.Inventory.AddItem("Holo Sight", 1);
        //Player.Inventory.AddItem("Silencer", 1);
    }else if(Player.Inventory.HasItem("Rock") == true){Player.Inventory.RemoveItemAll("Rock");}
}
Problem is it STILL gives me an item error item not referenced on respawning after reconnecting when inventory doesn't contain rock, bandage, or torch.
 
Last edited:
Status
Not open for further replies.