summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--plugins/plugin20.html27
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/plugin20.html b/plugins/plugin20.html
index b36490ba..a9aaaace 100644
--- a/plugins/plugin20.html
+++ b/plugins/plugin20.html
@@ -1068,7 +1068,32 @@ You should never need to edit this file manually.
 <br>
 </blockquote>
 <b>Returns:</b> 1 for success, 0 for failure.
-<br><br><br>
+<br><br><b>Example:</b>
+<blockquote>
+<pre>static int saveint_cb (char *word[], char *word_eol[], void *user_data)
+{
+	int buffer = atoi (word[2]);
+
+	if (buffer > 0 && buffer < INT_MAX)
+	{
+		if (xchat_set_pluginpref_int (ph, "myint1", buffer))
+		{
+			xchat_printf (ph, "Setting successfully saved!\n");
+		}
+		else
+		{
+			xchat_printf (ph, "Error while saving!\n");
+		}
+	}
+	else
+	{
+		xchat_printf (ph, "Invalid input!\n");
+	}
+
+	return XCHAT_EAT_XCHAT;
+}</pre>
+</blockquote>
+<br><br>
 
 <h3><a class=cmd name="xchat_get_pluginpref_int">&nbsp;xchat_get_pluginpref_int()&nbsp;</a><small>(new for 2.8.10)</small></h3>
 <b>Prototype:</b> int xchat_get_pluginpref_int (xchat_plugin *ph, const char *var);