Solved Using the Lang API?
Discussion in 'Rust Development' started by TheMechanical97, Jan 4, 2016.
-
Wulf Community Admin
Take a look at some of my recent plugins, all of them use the Lang API. Resources from Wulf | Oxide
All you're doing is creating a dictionary, registering that dictionary with the Lang API, and then calling it with lang.GetMessage along with a Steam ID when sending to a player. -
How can replace this?
player.Message(GetMessage("Test", player));
messages.Add("Test", "test message! You have {0}$");
i want to replace the {0} with a variable :S -
Wulf Community Admin
Code:rust.SendChatMessage(player, string.Format(GetMessage("Test", player.UserIDString), moneyVar);
-
Should be like this?:
player.Message(GetMessage("test").Replace({0}, .VariableToString), player));
[DOUBLEPOST=1451943831][/DOUBLEPOST] -
Wulf Community Admin
-
Okay! Working thanksss.
The other question now is.... Popup notifications, How its suposet to get messages? just call it and set the message as:
string.Format(GetMessage("Test", player.UserIDString), moneyVar))
?? -
Wulf Community Admin
-
Plugin popup notifications
[DOUBLEPOST=1451944412][/DOUBLEPOST]PopupNotifications?.Call("CreatePopupNotification", "Test message");
[DOUBLEPOST=1451944454][/DOUBLEPOST]Alsoooo XD How can I replace {0} & {1} in the same message?? -
Wulf Community Admin
For the other question:
Code:string.Format(GetMessage("Test", player.UserIDString), moneyVar, otherVar))