-
Notifications
You must be signed in to change notification settings - Fork 5
Placeholders
What is Placeholders? Placeholders is a plugin designed to help plugin developers and server owners, by taking the trouble out of coding placeholders. Placeholders currently has over 70 pre-coded placeholders, but if that's not enough for you, you can add your own, by adding code to the placeholders.php file!
Notes:
The placeholders are case-insensitive.
$gvars contains global placeholders (like server info, and top kills)
$svars contains personal placeholders (like IP, name, and money)// Example placeholders
$svars["{example_placeholder}"] = "Example!";
// You can make a placeholder out of normal text if you want
// This will replace "this is just text" with "Another example!"$gvars["this is just text"] = "Another example!"
$manager = $this->getServer()->getPluginManager();
$msg = "Your ip is {ip}";
if(($placeholders = $manager->getPlugin("Placeholders")) !== null){
$msg = $placeholders->Placeholders($msg, $player);
/* Output: "Your ip is 192.168.0.18" (Player's IP) */
}