<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DaRk+NiGhT</id>
	<title>AlliedModders Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DaRk+NiGhT"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/DaRk_NiGhT"/>
	<updated>2026-06-06T07:46:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=DataPacks&amp;diff=5640</id>
		<title>DataPacks</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=DataPacks&amp;diff=5640"/>
		<updated>2008-03-05T22:49:46Z</updated>

		<summary type="html">&lt;p&gt;DaRk NiGhT: New page: DataPacks are a way to store and move around various types of data in SourceMod Scripting. Since some things are not possible in SourcePawn, such as a fun...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DataPacks are a way to store and move around various types of data in [[:Category:SourceMod Scripting|SourceMod Scripting]]. Since some things are not possible in SourcePawn, such as a function consuming a String, DataPacks help us get these Strings and other items where they need to go.&lt;br /&gt;
&lt;br /&gt;
=Creating a DataPack=&lt;br /&gt;
Creating a DataPack is very simple; all you need is a Handle to write to.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new Handle:dataPackHandle = CreateDataPack();&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information on using Handles, see [[Handle API (SourceMod)]].&lt;br /&gt;
&lt;br /&gt;
=DataPack Functions=&lt;br /&gt;
On you have created your DataPack, you can use a variety of functions to manage the DataPack.&lt;br /&gt;
&lt;br /&gt;
==WritePackCell==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native WritePackCell(Handle:pack, cell);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WritePackFloat==&lt;br /&gt;
This function can be used to write a Float to a DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native WritePackFloat(Handle:pack, Float:val);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WritePackString==&lt;br /&gt;
This function can be used to write a String to a DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native WritePackString(Handle:pack, const String:str[]);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ReadPackCell==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native ReadPackCell(Handle:pack);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ReadPackFloat==&lt;br /&gt;
This function can be used to read a Float from a DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native Float:ReadPackFloat(Handle:pack);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ReadPackString==&lt;br /&gt;
This function can be used to read a String from a DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native ReadPackString(Handle:pack, String:buffer[], maxlen);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ResetPack==&lt;br /&gt;
This function resets your position in the DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native ResetPack(Handle:pack, bool:clear=false);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetPackPosition==&lt;br /&gt;
This function gets your current position in the DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native GetPackPosition(Handle:pack);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetPackPosition==&lt;br /&gt;
This function sets your current position in the DataPack.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;native SetPackPosition(Handle:pack, position);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Disposing of a DataPack=&lt;br /&gt;
To dispose of a DataPack, all you have to do is close its Handle.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;CloseHandle(dataPackHandle);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Scripting]]&lt;/div&gt;</summary>
		<author><name>DaRk NiGhT</name></author>
		
	</entry>
</feed>