Hello, hoping someone can help me figure out this error I am having.
"Error while compiling: SkillPoints.cs(287,28): error CS0119: Expression denotes a `method group', where a `variable', `value' or `type' was expected"
The following are the lines 284-295. line 287 being "if (level == 3)":
Code:else if (skill.ToLower.Equals("gathering")) { int level = getGatherLevel(player); if (level == 3) { SendReply(player, "You cannot upgrade this skill further"); return; } int cost = getCost(level); SendReply(player, "Upgrading Gathering to level " + (level + 1) + " will cost " + (cost) + "Reward Points"); SendReply(player, "If you are sure, type '/skills upgrade gathering confirm"); }I am also attaching a copy of the fileCode:private int getGatherLevel(BasePlayer player) { if (permission.UserHasPermission(player.UserIDString, "skillpoints.gather3")) { return 3; } else if (permission.UserHasPermission(player.UserIDString, "skillpoints.gather2")) { return 2; } else if (permission.UserHasPermission(player.UserIDString, "skillpoints.gather1")) { return 1; } return 0; }
Thanks in advance for any help.
Maybe I am stupid? Cannot figure out this error
Discussion in 'Rust Development' started by mcydes, Apr 14, 2018.
-
Attached Files:
Last edited by a moderator: Apr 14, 2018 -
-
Line 70 : Typo on type -> BasePlayer not basePlayer;
Line 74, 78, 82: floats require 'f' after the value -> 0.25f
Line 97: Missing a argument for the OnHit method
Line 154, 166, 181, 196, 211, 248, 260, 272, 284 : ToLower is a method -> ToLower()
Line 171, 186, 201, 216: SendReply requires a BasePlayer as the first argument -> SendReply(player, "message");
Line 177, 178, 207, 208, 222, 223: Should be either rust.RunServerCommand(); or just covalence.Server.Command();
Line 234: -> Calls to other plugins should be cast as either the actual return type (if you are 100% sure that plugin exists on the server) or as an object with null checks
Code:if ((int)ServerRewards?.Call("CheckPoints", new object[] { player.userID }) >= cost )object success = ServerRewards?.Call("CheckPoints", player.userID); if (success != null && (int)success >= cost) { }
Attached Files:
Last edited by a moderator: Apr 14, 2018 -
-
:O . Wow, well you found the rest of the errors that I hadn't gotten to yet. Thanks a lot!