SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/06/2017, 04:53 PM   #1
jlalt
High-roller
 
Join Date: Oct 2014
Posts: 1,323
Reputation: 304
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, 01:35 PM   #2
Beryllium
Big Clucker
 
Join Date: May 2017
Location: Egypt.
Posts: 74
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, 01:56 PM   #3
iLearner
Banned
 
Join Date: Apr 2017
Posts: 434
Reputation: 89
Default Re: C++ Vectors plugin

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

Any documentation page?
iLearner is offline   Reply With Quote
Old 30/06/2017, 02:03 PM   #4
jlalt
High-roller
 
Join Date: Oct 2014
Posts: 1,323
Reputation: 304
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, 04:46 PM   #5
coool
Huge Clucker
 
Join Date: Feb 2013
Location: Pakistan, Sindh
Posts: 449
Reputation: 23
Default Re: C++ Vectors plugin

Looks sick *appreciated*
__________________
My Writing Works
Lost In Future

coool is offline   Reply With Quote
Old 30/06/2017, 06:51 PM   #6
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 526
Reputation: 209
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.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like Mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 30/06/2017, 08: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, 08:20 PM   #8
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 526
Reputation: 209
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.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like Mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 03/07/2017, 08:09 PM   #9
ArminKH
Little Clucker
 
Join Date: Sep 2015
Posts: 8
Reputation: 1
Default Re: C++ Vectors plugin

Nice job
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 03:16 PM
[Tutorial] Vectors in SA-MP RajatPawar Tutorials 11 04/02/2014 02:02 AM
Playing around with vectors (0.3z) Dragony92 Screenshots and Videos 9 31/01/2014 07:54 AM
Using vectors & maps Maxips2 Scripting Help 4 22/06/2013 12:19 PM
Vectors potato Help Archive 1 08/08/2010 06:09 AM


All times are GMT. The time now is 07:31 AM.


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