Most of my plugins use 5 languages.
Hurtworld itemv2 branch
Discussion in 'Hurtworld Discussion' started by CaptainNebulous, Jan 10, 2017.
-
Wulf Community Admin
-
Code:
void Loaded() { lang.RegisterMessages(Messages, this); lang.GetLanguages(language, Messages, this); }
SkipNightVote.cs(29,8): error CS1501: No overload for method `GetLanguages' takes `3' arguments
/home/k8169_s5095/server_5095/Oxide.Core.dll (Location of the symbol related to previous error)
I dont know what to do ;x SkipNightVote | Oxide Maybe u can explain me how to do it. Im really newbie. -
Wulf Community Admin
-
-
Wulf Community Admin
You need to use lang.RegisterMessages for each language, else manually create the files.
-
hastebin it should works, i created the files and still.. no idea
-
Code:
private string GetMSG(string key, string userid = null) => lang.GetMessage(key, this, userid); Dictionary<string, string> Messages = new Dictionary<string, string> { {"Force open a new vote", "Force open a new vote" }, {"Cancel the current vote", "Cancel the current vote" }, {"There is not a vote currently open", "There is not a vote currently open" }, {"You have voted to skip night", "You have voted to skip night" }, {"have voted to skip night", "players have voted to skip night" }, {"Voting was successful, skipping night.", "Voting was successful, skipping night." }, {"Voting was unsuccessful.", "Voting was unsuccessful." }, {"Minutes", "Minutes" }, {"Minute", "Minute" }, {"Seconds", "Seconds" }, {"voteMSG", "{secCol}Type</color> {mainCol}/voteday</color> {secCol}now if you want to skip night. If </color>{mainCol}{reqVote}%</color> {secCol}of players vote night will be skipped</color>" }, {"timeRem", "{secCol}Voting ends in</color> {mainCol}{time} {type}</color>{secCol}, use </color>{mainCol}/voteday</color>{secCol} to cast your vote</color>" } }, this); Dictionary<string, string> Messages = new Dictionary<string, string> { {"Force open a new vote", "Force open a new vote" }, {"Cancel the current vote", "Cancel the current vote" }, {"There is not a vote currently open", "There is not a vote currently open" }, {"You have voted to skip night", "You have voted to skip night" }, {"have voted to skip night", "players have voted to skip night" }, {"Voting was successful, skipping night.", "Voting was successful, skipping night." }, {"Voting was unsuccessful.", "Voting was unsuccessful." }, {"Minutes", "Minutes" }, {"Minute", "Minute" }, {"Seconds", "Seconds" }, {"voteMSG", "{secCol}Type</color> {mainCol}/voteday</color> {secCol}now if you want to skip night. If </color>{mainCol}{reqVote}%</color> {secCol}of players vote night will be skipped</color>" }, {"timeRem", "{secCol}Voting ends in</color> {mainCol}{time} {type}</color>{secCol}, use </color>{mainCol}/voteday</color>{secCol} to cast your vote</color>" } }, this, "pl"); Dictionary<string, string> Messages = new Dictionary<string, string> { {"Force open a new vote", "Force open a new vote" }, {"Cancel the current vote", "Cancel the current vote" }, {"There is not a vote currently open", "There is not a vote currently open" }, {"You have voted to skip night", "You have voted to skip night" }, {"have voted to skip night", "players have voted to skip night" }, {"Voting was successful, skipping night.", "Voting was successful, skipping night." }, {"Voting was unsuccessful.", "Voting was unsuccessful." }, {"Minutes", "Minutes" }, {"Minute", "Minute" }, {"Seconds", "Seconds" }, {"voteMSG", "{secCol}Type</color> {mainCol}/voteday</color> {secCol}now if you want to skip night. If </color>{mainCol}{reqVote}%</color> {secCol}of players vote night will be skipped</color>" }, {"timeRem", "{secCol}Voting ends in</color> {mainCol}{time} {type}</color>{secCol}, use </color>{mainCol}/voteday</color>{secCol} to cast your vote</color>" } }, this, "de");
btw. update was: P -
Will be update for itemv2 branch?
-
Wulf Community Admin
-
Okey, my plugin is working, generated lang/pl lang/ru lang/de lang/de, but i have Polish Hurtworld and is using english language, server was restarted.
-
Okey, i was talking with Tom and he said me i should contact with you Wulf,
Code:private new void LoadDefaultMessages() { // English lang.RegisterMessages(new Dictionary<string, string> { {"GiveRoll_ItemGive","<color=#7FFF00>[ROLL]</color> {player} has rolled the dice and recieved {amount} {itemname}"}, {"GiveRoll_StatGive","<color=#7FFF00>[ROLL]</color> {player} has rolled the dice and recieved {amount} {stat} points"}, {"GiveRoll_SpawnGive","<color=#7FFF00>[ROLL]</color> {player} has rolled the dice and spawned {amount} {creature}"}, {"GiveRoll_ItemReplace","<color=#7FFF00>[ROLL]</color> {player} has rolled the dice and replaced {amount1} {itemname1} with {amount2} {itemname2}"}, {"SendListRollEdition_1","permission \"permission name\" => set the permission needed to get this roll"}, {"SendListRollEdition_2","description \"description text here\" => set a description for this roll"}, {"SendListRollEdition_3","authlevel XXX"}, {"SendListRollEdition_4","cooldown XXX"}, {"SendListRollEdition_5","max XXX"}, {"SendListRollEdition_6","additem <itemId> <amount> <chance> => set new items for your roll"}, {"SendListRollEdition_7","addstat <type> <amount> <chance> => alter player stat"}, {"SendListRollEdition_8","addspawn <creature> <amount> <chance> => spawn creatures on player"}, {"SendListRollEdition_9","addreplace <itemId> <amount> <chance> => replace random inventory item"}, {"SendListRollEdition_10","hide TRUE/FALSE => dont show this roll in lists (EVER)"}, {"CmdRoll_CantSeeRoll", "{rollname} - {desc} {reason}"}, {"CmdRoll_Player1","====== Player Commands ======"}, {"CmdRoll_Player2","/roll => to get the list of rolls"}, {"CmdRoll_Player3","/roll ROLLNAME => to redeem the roll"}, {"CmdRoll_Admin1", "====== Admin Commands ======"}, {"CmdRoll_Admin2","/roll add ROLLNAME => add a roll"}, {"CmdRoll_Admin3","/roll remove ROLLNAME => remove a roll"}, {"CmdRoll_Admin4","/roll edit ROLLNAME => edit a roll"}, {"CmdRoll_Admin5","/roll list => get a raw list of rolls (the real full list)"}, {"CmdRoll_Admin6","/roll give PLAYER/STEAMID ROLLNAME => make a player roll the dice"}, {"CmdRoll_Admin7","/roll resetrolls => deletes all rolls"}, {"CmdRoll_Admin8","/roll resetdata => reset player data"}, {"CmdRoll_NoAccess","You don't have access to this command"}, {"CmdRoll_RollList","{rollname} - {description}"}, {"CmdRoll_ResetAll","All player and roll data has been reset"}, {"CmdRoll_ResetPlayer", "All player data has been reset"}, {"CmdRoll_NewRollExists", "This roll already exists"}, {"CmdRoll_NewRollNotExists", "This roll doesn't seem to exist"}, {"CmdRoll_NewRoll", "You've created a new roll: {rollname}"}, {"CmdRoll_Give","/roll give PLAYER/STEAMID ROLLNAME"}, {"CmdRoll_GiveNoPlayer", "No player found"}, {"CmdRoll_GiveMultiple", "Multiple players found"}, {"CmdRoll_Given","You gave {player} the roll: {rollname}"}, {"CmdRoll_GivenReceive", "You've received the roll {rollname} from {player} enjoy!"}, {"CmdRoll_Edit", "You are now editing roll: {rollname}"}, {"CmdRoll_Remove","{rollname} was removed"}, {"CmdRoll_NotInEdit", "You are not creating or editing a roll"}, {"CmdRoll_Dirty", "There was an error while getting this roll, was it changed while you were editing it?"}, {"CmdRoll_AddItem", "Item added successfully"}, {"CmdRoll_AddStat", "Stat added successfully"}, {"CmdRoll_AddSpawn", "Spawn added successfully"}, {"CmdRoll_AddReplace", "Item replacement added successfully"}, {"CmdRoll_InvalidArgs", "{arg} Invalid agrument"}, {"GiveRoll_NotExist", "The roll '{rollname}' doesn't exist"}, {"TryGiveRoll_Completed", "Roll Completed" }, {"CanRedeemARoll_NotExist", "The roll '{rollname}' doesn't exist"}, {"CanRedeemARoll_NotAllowed", "You are not allowed to roll the dice at this moment"}, {"CanRedeemARoll_NoLevel", "You don't have the level to use this roll"}, {"CanRedeemARoll_NoPerm", "You don't have the permissions to use this roll"}, {"CanRedeemARoll_Out", "You already took all your chances with this roll"}, {"CanRedeemARoll_Wait", "You need to wait {seconds} seconds to use this roll"} }, this); // Polish lang.RegisterMessages(new Dictionary<string, string> { {"GiveRoll_ItemGive","<color=#7FFF00>[ROLL]</color> {player} zalosował i wygrał {amount} {itemname}"}, {"GiveRoll_StatGive","<color=#7FFF00>[ROLL]</color> {player} zalosował i wygrał {amount} {stat}"}, {"GiveRoll_SpawnGive","<color=#7FFF00>[ROLL]</color> {player} zalosował i wygrał {amount} {creature}"}, {"GiveRoll_ItemReplace","<color=#7FFF00>[ROLL]</color> {player} rzucił kostką i wylosował zamianę {itemname1} {amount1} z {itemname2} {amount2}"}, {"SendListRollEdition_1","permission \"permission name\" => set the permission needed to get this roll"}, {"SendListRollEdition_2","description \"description text here\" => set a description for this roll"}, {"SendListRollEdition_3","authlevel XXX"}, {"SendListRollEdition_4","cooldown XXX"}, {"SendListRollEdition_5","max XXX"}, {"SendListRollEdition_6","additem <itemId> <amount> <chance> => set new items for your roll"}, {"SendListRollEdition_7","addstat <type> <amount> <chance> => alter player stat"}, {"SendListRollEdition_8","addspawn <creature> <amount> <chance> => spawn creatures on player"}, {"SendListRollEdition_9","addreplace <itemId> <amount> <chance> => replace random inventory item"}, {"SendListRollEdition_10","hide TRUE/FALSE => dont show this roll in lists (EVER)"}, {"CmdRoll_CantSeeRoll", "{rollname} - {desc} {reason}"}, {"CmdRoll_Player1","====== Player Commands ======"}, {"CmdRoll_Player2","/roll => to get the list of rolls"}, {"CmdRoll_Player3","/roll ROLLNAME => to redeem the roll"}, {"CmdRoll_Admin1", "====== Admin Commands ======"}, {"CmdRoll_Admin2","/roll add ROLLNAME => add a roll"}, {"CmdRoll_Admin3","/roll remove ROLLNAME => remove a roll"}, {"CmdRoll_Admin4","/roll edit ROLLNAME => edit a roll"}, {"CmdRoll_Admin5","/roll list => get a raw list of rolls (the real full list)"}, {"CmdRoll_Admin6","/roll give PLAYER/STEAMID ROLLNAME => make a player roll the dice"}, {"CmdRoll_Admin7","/roll resetrolls => deletes all rolls"}, {"CmdRoll_Admin8","/roll resetdata => reset player data"}, {"CmdRoll_NoAccess","Nie masz dostępu do tej komendy."}, {"CmdRoll_RollList","{rollname} - {description}"}, {"CmdRoll_ResetAll","All player and roll data has been reset"}, {"CmdRoll_ResetPlayer", "All player data has been reset"}, {"CmdRoll_NewRollExists", "This roll already exists"}, {"CmdRoll_NewRollNotExists", "This roll doesn't seem to exist"}, {"CmdRoll_NewRoll", "You've created a new roll: {rollname}"}, {"CmdRoll_Give","/roll give PLAYER/STEAMID ROLLNAME"}, {"CmdRoll_GiveNoPlayer", "No player found"}, {"CmdRoll_GiveMultiple", "Multiple players found"}, {"CmdRoll_Given","You gave {player} the roll: {rollname}"}, {"CmdRoll_GivenReceive", "You've received the roll {rollname} from {player} enjoy!"}, {"CmdRoll_Edit", "You are now editing roll: {rollname}"}, {"CmdRoll_Remove","{rollname} was removed"}, {"CmdRoll_NotInEdit", "You are not creating or editing a roll"}, {"CmdRoll_Dirty", "There was an error while getting this roll, was it changed while you were editing it?"}, {"CmdRoll_AddItem", "Item added successfully"}, {"CmdRoll_AddStat", "Stat added successfully"}, {"CmdRoll_AddSpawn", "Spawn added successfully"}, {"CmdRoll_AddReplace", "Item replacement added successfully"}, {"CmdRoll_InvalidArgs", "{arg} Invalid agrument"}, {"GiveRoll_NotExist", "Losowanie '{rollname}' nie istnieje."}, {"TryGiveRoll_Completed", "Losowanie zakończone." }, {"CanRedeemARoll_NotExist", "Losowanie '{rollname}' nie istnieje."}, {"CanRedeemARoll_NotAllowed", "Nie masz uprawnień, aby rzucić kostką w tej chwili."}, {"CanRedeemARoll_NoLevel", "Nie posiadasz odpowiedniego poziomu, aby rzucić kostką."}, {"CanRedeemARoll_NoPerm", "Nie posiadasz odpowiednich uprawnień, aby rzucić kostką."}, {"CanRedeemARoll_Out", "Wykorzystałeś już wszystkie losowania."}, {"CanRedeemARoll_Wait", "Musisz odczekać {seconds} sekund zanim użyjesz losowania ponownie."} }, this, "pl");
Attached Files:
-
-
Wulf Community Admin
Did you change your language using "/lang pl" or "lang pl"? -
bad image. it's proper: http://iv.pl/images/11568265821475229601.png
[DOUBLEPOST=1502729431][/DOUBLEPOST]Code:{ "GiveRoll_ItemGive": "<color=#7FFF00>[ROLL]</color> {player} zalosował i wygrał {amount} {itemname}", "GiveRoll_StatGive": "<color=#7FFF00>[ROLL]</color> {player} zalosował i wygrał {amount} {stat}", "GiveRoll_SpawnGive": "<color=#7FFF00>[ROLL]</color> {player} zalosował i wygrał {amount} {creature}", "GiveRoll_ItemReplace": "<color=#7FFF00>[ROLL]</color> {player} rzucił kostką i wylosował zamianę {itemname1} {amount1} z {itemname2} {amount2}", "SendListRollEdition_1": "permission \"permission name\" => set the permission needed to get this roll", "SendListRollEdition_2": "description \"description text here\" => set a description for this roll", "SendListRollEdition_3": "authlevel XXX", "SendListRollEdition_4": "cooldown XXX", "SendListRollEdition_5": "max XXX", "SendListRollEdition_6": "additem <itemId> <amount> <chance> => set new items for your roll", "SendListRollEdition_7": "addstat <type> <amount> <chance> => alter player stat", "SendListRollEdition_8": "addspawn <creature> <amount> <chance> => spawn creatures on player", "SendListRollEdition_9": "addreplace <itemId> <amount> <chance> => replace random inventory item", "SendListRollEdition_10": "hide TRUE/FALSE => dont show this roll in lists (EVER)", "CmdRoll_CantSeeRoll": "{rollname} - {desc} {reason}", "CmdRoll_Player1": "====== Player Commands ======", "CmdRoll_Player2": "/roll => to get the list of rolls", "CmdRoll_Player3": "/roll ROLLNAME => to redeem the roll", "CmdRoll_Admin1": "====== Admin Commands ======", "CmdRoll_Admin2": "/roll add ROLLNAME => add a roll", "CmdRoll_Admin3": "/roll remove ROLLNAME => remove a roll", "CmdRoll_Admin4": "/roll edit ROLLNAME => edit a roll", "CmdRoll_Admin5": "/roll list => get a raw list of rolls (the real full list)", "CmdRoll_Admin6": "/roll give PLAYER/STEAMID ROLLNAME => make a player roll the dice", "CmdRoll_Admin7": "/roll resetrolls => deletes all rolls", "CmdRoll_Admin8": "/roll resetdata => reset player data", "CmdRoll_NoAccess": "Nie masz dostępu do tej komendy.", "CmdRoll_RollList": "{rollname} - {description}", "CmdRoll_ResetAll": "All player and roll data has been reset", "CmdRoll_ResetPlayer": "All player data has been reset", "CmdRoll_NewRollExists": "This roll already exists", "CmdRoll_NewRollNotExists": "This roll doesn't seem to exist", "CmdRoll_NewRoll": "You've created a new roll: {rollname}", "CmdRoll_Give": "/roll give PLAYER/STEAMID ROLLNAME", "CmdRoll_GiveNoPlayer": "No player found", "CmdRoll_GiveMultiple": "Multiple players found", "CmdRoll_Given": "You gave {player} the roll: {rollname}", "CmdRoll_GivenReceive": "You've received the roll {rollname} from {player} enjoy!", "CmdRoll_Edit": "You are now editing roll: {rollname}", "CmdRoll_Remove": "{rollname} was removed", "CmdRoll_NotInEdit": "You are not creating or editing a roll", "CmdRoll_Dirty": "There was an error while getting this roll, was it changed while you were editing it?", "CmdRoll_AddItem": "Item added successfully", "CmdRoll_AddStat": "Stat added successfully", "CmdRoll_AddSpawn": "Spawn added successfully", "CmdRoll_AddReplace": "Item replacement added successfully", "CmdRoll_InvalidArgs": "{arg} Invalid agrument", "GiveRoll_NotExist": "Losowanie '{rollname}' nie istnieje.", "TryGiveRoll_Completed": "Losowanie zakończone.", "CanRedeemARoll_NotExist": "Losowanie '{rollname}' nie istnieje.", "CanRedeemARoll_NotAllowed": "Nie masz uprawnień, aby rzucić kostką w tej chwili.", "CanRedeemARoll_NoLevel": "Nie posiadasz odpowiedniego poziomu, aby rzucić kostką.", "CanRedeemARoll_NoPerm": "Nie posiadasz odpowiednich uprawnień, aby rzucić kostką.", "CanRedeemARoll_Out": "Wykorzystałeś już wszystkie losowania.", "CanRedeemARoll_Wait": "Musisz odczekać {seconds} sekund zanim użyjesz losowania ponownie." }
[DOUBLEPOST=1502729776][/DOUBLEPOST]Ok! I said on chat "/lang pl". Player language set to pl. Still English! -
Will be fix oxide or ?
-
Wulf Community Admin
-
Is that plugin working good? oxide-plugins/Robbery.cs at master · lukespragg/oxide-plugins · GitHub I was modeling on it. What a piece of code is responding about it?
[DOUBLEPOST=1502732318][/DOUBLEPOST]Code:void ShowMsg(PlayerSession session, string msg) => hurt.SendChatMessage(session, msg);
-
Wulf Community Admin
-
Okey, i find some. Only "You have voted to skip night" is working.
Code:if (VoteOpen) { if (!AlreadyVoted(player.Id)) { ReceivedVotes.Add(player.Id); player.Reply(GetMSG("You have voted to skip night", player.Id)); if (DisplayCountEveryVote) server.Broadcast($"{configData.Messaging.MainColor}{ReceivedVotes.Count} / {RequiredVotes}</color> {configData.Messaging.MSGColor}{GetMSG("have voted to skip night", player.Id)}</color>"); if (ReceivedVotes.Count >= RequiredVotes) VoteEnd(true); return; } }
Code:server.Broadcast($"<color=#66e42a>{GetMSG("Voting was successful, skipping night.")}</color>");
-
Wulf Community Admin
-
@Wulf pls update itemv2 github