Im really noob at programing and thats why i try this in javascript.Does anybody have any idea why i get error everytime on RustIO.HasFriend function?
I have tried it without if and as toString(myID). And i have even tried to put there some random IDs like "76561197961738671" but still i cannot get anything from it always error in there
Im really clueless now as the RustIO.IsInstalled work just fine!Any clarification on my error will be much appreciated.
Code:var friendstest = { Title : "Friends", Description : "Testing of RustIO Friends", Author : "Pleskac", Version : V(0, 1, 0), ResourceId : 666,OnPluginLoaded : function () { RustIO = plugins.Find('RustIO'); if(RustIO.IsInstalled = true){ print("OnPluginLoaded works!"); //this actually works well!! command.AddChatCommand("friend", this.Plugin, "friend") } },friend: function(player, command, arg) { RustIO = plugins.Find('RustIO'); if(arg[0] == null){ rust.SendChatMessage(player, "Friend", "FAIL.."); return;} switch (arg[0]){ case "test": var myID = rust.UserIDFromPlayer(player); if(arg[1] == null){ rust.SendChatMessage(player, "Friend", "Give me a name!"); return;} var friendname = arg[1]; friendname = friendname.toLowerCase(); var global = importNamespace(""); var findID = global.BasePlayer.Find(friendname); var friendID = rust.UserIDFromPlayer(findID); rust.SendChatMessage(player, "Friend", "Your Steam ID is: " + myID); rust.SendChatMessage(player, "Friend", "Your Friend Steam ID is: " + friendID); if(RustIO.HasFriend(myID , friendID) = true){ rust.SendChatMessage(player, "Friend", "You are already friends!"); }else rust.SendChatMessage(player, "Friend", "You are not friend!"); break; } } }
Can't figure out why RustIO.HasFriend fails
Discussion in 'Rust Development' started by Pleskac, Aug 18, 2015.

Does anybody have any idea why i get error everytime on RustIO.HasFriend function?