SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 24/06/2017, 03:53 PM   #1
jlalt
High-roller
 
Join Date: Oct 2014
Location: Islamic Republic of Iran
Posts: 1,224
Reputation: 255
Default C++ Vectors plugin

Introduction:
This is a simple plugin which gives the ability to use c++ vectors in pawn.


What vectors are?
They are kind of arrys which can save huge amount of data. if you've worked before with c# or php they are just like c# Lists or php arrays.


Functions list:
Code:
native SetMaxVector(const kind, const value);
native Vector_Push(const kind, const vectorid, const value[] = "", Float:v2 = 0.0);
native Vector_GetValue(const kind, const vectorid, const itemid, const str_source[] = "", const len = sizeof str_source);
native Vector_GetSize(const kind, const vectorid);
native Vector_GetItemLen(const kind, const vectorid, const itemid);
native Vector_ItemErase(const kind, const vectorid, const itemid);
native Vector_SetItemValue(const kind, const vectorid, const itemid, const data[] = "", Float:v2 = 0.0);
native Vector_AppendItemValue(const kind, const vectorid, const itemid, const data[] = "", Float:v2 = 0.0);
native Vector_Clear(const kind, const vectorid);
native Vector_GetFreeVector(const kind);
sample of storing and loading float values:
https://pastebin.com/CePNKeQx

Download: https://github.com/Jlalt/CPPVectors/releases/tag/1.0
Source: https://github.com/Jlalt/CPPVectors

Credits:
Kurta for his c++ tutorials
X337 for his helps on building linux version
me for programming D:
jlalt is offline   Reply With Quote
Old 30/06/2017, 12:35 PM   #2
Beryllium
Big Clucker
 
Join Date: May 2017
Location: Egypt.
Posts: 70
Reputation: 4
Default Re: C++ Vectors plugin

Was looking for something like this, Good job jlalt.
Beryllium is offline   Reply With Quote
Old 30/06/2017, 12:56 PM   #3
iLearner
Huge Clucker
 
iLearner's Avatar
 
Join Date: Apr 2017
Posts: 314
Reputation: 72
Default Re: C++ Vectors plugin

I've used these in c#, very cool.

Any documentation page?
__________________
iLearner is online now   Reply With Quote
Old 30/06/2017, 01:03 PM   #4
jlalt
High-roller
 
Join Date: Oct 2014
Location: Islamic Republic of Iran
Posts: 1,224
Reputation: 255
Default Re: C++ Vectors plugin

Quote:
Originally Posted by iLearner View Post
I've used these in c#, very cool.

Any documentation page?
not yet, idk if will do one ever :#
jlalt is offline   Reply With Quote
Old 30/06/2017, 03:46 PM   #5
coool
Huge Clucker
 
Join Date: Feb 2013
Location: Pakistan, Sindh
Posts: 408
Reputation: 22
Default Re: C++ Vectors plugin

Looks sick *appreciated*
__________________
SCRIPTING ON LOW RATES

My Writing Works
Lost In Future


Code:
Every thing in the world either a potato or not a potato
coool is offline   Reply With Quote
Old 30/06/2017, 05:51 PM   #6
Freaksken
Huge Clucker
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 466
Reputation: 194
Default Re: C++ Vectors plugin

Don't know why no one else hasn't written a plugin that gives the ability to use data structures in general. Guess not enough people know what they are, or they just aren't needed in scripting a server.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
So if someone does reply and tries to help you, be grateful.


Includes:Filterscripts:Screenshots and Videos:Tutorials:Works in progress:
FCNPC A.I.Adminhelp (outdated)Leatherface/Jason Voorhees/Michael MyersSpeedometerSingle-player-like Mission
Freaksken is offline   Reply With Quote
Old 30/06/2017, 07:12 PM   #7
Michalec
Big Clucker
 
Michalec's Avatar
 
Join Date: Jun 2009
Location: Poland
Posts: 91
Reputation: 2
Default Re: C++ Vectors plugin

Quote:
Originally Posted by Freaksken View Post
Don't know why no one else hasn't written a plugin that gives the ability to use data structures in general. Guess not enough people know what they are, or they just aren't needed in scripting a server.
There are two plugins:
http://forum.sa-mp.com/showthread.php?t=238844
http://forum.sa-mp.com/showthread.php?t=364285

But... Both are bugged and crashes a server
Michalec is offline   Reply With Quote
Old 30/06/2017, 07:20 PM   #8
Freaksken
Huge Clucker
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 466
Reputation: 194
Default Re: C++ Vectors plugin

Quote:
Originally Posted by Michalec View Post
There are two plugins:
http://forum.sa-mp.com/showthread.php?t=238844
http://forum.sa-mp.com/showthread.php?t=364285

But... Both are bugged and crashes a server
Oh lol, I even posted on that second thread. That being said, there are a lot more useful datastructures than vectors, deques and maps.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
So if someone does reply and tries to help you, be grateful.


Includes:Filterscripts:Screenshots and Videos:Tutorials:Works in progress:
FCNPC A.I.Adminhelp (outdated)Leatherface/Jason Voorhees/Michael MyersSpeedometerSingle-player-like Mission
Freaksken is offline   Reply With Quote
Old 03/07/2017, 07:09 PM   #9
ArminKH
Little Clucker
 
Join Date: Sep 2015
Posts: 6
Reputation: 1
Default Re: C++ Vectors plugin

Nice job
__________________
» Best samp Call of Duty Server: 164.132.69.65:7730
» Join us now!
» Client: 0.3z
ArminKH is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vectors adri1 Scripting Help 4 28/02/2015 02:16 PM
[Tutorial] Vectors in SA-MP RajatPawar Tutorials 11 04/02/2014 01:02 AM
Playing around with vectors (0.3z) Dragony92 Screenshots and Videos 9 31/01/2014 06:54 AM
Using vectors & maps Maxips2 Scripting Help 4 22/06/2013 11:19 AM
Vectors potato Help Archive 1 08/08/2010 05:09 AM


All times are GMT. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.