Eviltyphoon Posted February 15, 2009 Author Share Posted February 15, 2009 Problem: Additions don't work. e.g. Sop=1 = Sopadd=1 then sopnew becomes 11…Code:``` Case "/sop" If GetPlayerAccess(Index) >= 3 Then Player = FindPlayer(Textsay(1)) Sopadd = Textsay(2) Sop = GetVar("Sop.ini", "Severity of Punishment", Getplayername(Player)&"") SopNew = Int(Sop + SopAdd) Call GlobalMsg(Getplayername(Player) & " has broken one of the rules of the game, because of that, his SoP is increased from " & Sop & " to " & Sopnew &".", RED) Call putvar("Sop.ini", "Severity of Punishment", Getplayername(Player)&"", Sopnew & "") Sop = GetVar("Sop.ini", "Severity of Punishment", Getplayername(Player)&"") Select case Sop Case 0 Call PlayerMsg(Player,"Looks like your record is clean, keep it that way!", GREEN) Case 1 Call PlayerMsg(Player,"You have broken one of the rules of MyWorld, please check the rules, so this won't happen again.", RED) Case 2 Call PlayerMsg(Player, "Second warning! Please change you behavior or punishment will follow!", RED) Case 3 Call HackingAttempt(Player, "Sop #3 reached.") Case 4 Call Jail(player, 5) Call MutePlayer(player) Call PlayerMsg(index, "You have been jailed for 5 minutes", RED) Case 5 Call Jail(player, 10) Call MutePlayer(player) Call PlayerMsg(index, "You have been jailed for 10 minutes", RED) Case 6 Call Jail(player, 20) Call RemoveCurrency(player) Call Muteplayer(player) Call PlayerMsg(player, "You have been jailed for 20 minutes, you have lost 5 in each stat and your money has been removed.", RED) Call Removestat(player, 5) Case 6 Call BanPlayer(player) End Select End if Exit Sub``` Link to comment Share on other sites More sharing options...
balliztik1 Posted February 15, 2009 Share Posted February 15, 2009 You're not adding. You're concatenating. It's not 1 + 1\. It's "1" + "1".```SopNew = Int(Sop) + Int(SopAdd)``` Link to comment Share on other sites More sharing options...
Jed Posted February 16, 2009 Share Posted February 16, 2009 why is it liek, everyone forgets the quotation marks in scripting. dont you….. oh wait, this isnt proper english. Link to comment Share on other sites More sharing options...
Eviltyphoon Posted February 16, 2009 Author Share Posted February 16, 2009 @Ballie:> You're not adding. You're concatenating. It's not 1 + 1\. It's "1" + "1".> > ```> SopNew = Int(Sop) + Int(SopAdd)> ```Thx, that worked. I hate how it's always the little thing I forget. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now