[EXTENSION] SHVector with example usage
2 Attachment(s)
Hey guys,
SHVector is an extension I made to expose the CVector class to SourceMod. Basically, a vector is like an array of data, without a set size and without many datatype limitations. You can have handles, floats, ints, and bools if you use the TYPE_CELL vector type, and there is TYPE_STRING for a string vector. Credit PimpinJuice, BAILOPAN, and everyone in IRC that kept me entertained. Installation 1. Extract 'shvector.ext.dll' and 'shvector.ext.so' to the 'addons/sourcemod/extensions' folder. 2. Extract 'shvector.inc' to the 'addons/sourcemod/scripting/include' folder. Functions There are 19 different functions that you can use in your plugins. They are documented and called as follows. Code:
/** Code:
#include <sourcemod> Quote:
Have fun. :) |
Re: [EXTENSION] SHVector with example usage
What it could be used for? Can you give some more practical examples?
thanks. |
Re: [EXTENSION] SHVector with example usage
Well, also here: http://forums.alliedmods.net/showthread.php?t=55114
It can be used for any type of data storage, my favorite part is the fact that you can mix multiple datatypes into one handle, and get the information with one call. Also, for strings you don't need to define string size and whatnot, in my War3Source plugin I can pull some code from it when I get home and show you. |
Re: [EXTENSION] SHVector with example usage
Its very nice, Maybe you should make it so you can specify a alias for a cell like this:
if(client>0) { new Handle:newPlayer=SHVectorCreate(TYPE_CELL); SHVectorInsert_Cell(newPlayer,ITER_BACK,"Inde x",client); // The first thing is client index SHVectorInsert_Cell(newPlayer,ITER_BACK,"XP", 0); // Place-holder for XP points SHVectorInsert_Cell(newPlayer,ITER_BACK,"Leve l",0); // Place-holder for current level SHVectorInsert_Cell(vecPlayers,ITER_BACK,newP layer); // Put our new player at the end of the vecPlayers vector } |
Re: [EXTENSION] SHVector with example usage
That would defeat the purpose and greatly cut down the speed. You're looking for associative arrays.
|
Re: [EXTENSION] SHVector with example usage
Quote:
|
Re: [EXTENSION] SHVector with example usage
Quote:
Great extension anyway! |
Re: [EXTENSION] SHVector with example usage
r u going to put all in extansions or ?
|
Re: [EXTENSION] SHVector with example usage
where to extract the shvector_source.zip?
|
Re: [EXTENSION] SHVector with example usage
You don't, that's for if you want to edit the extension. shvector_1_0_0.zip is for when you want to run it.
|
All times are GMT -4. The time now is 22:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.