SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 09/08/2018, 06:08 AM   #501
BigETI
High-roller
 
BigETI's Avatar
 
Join Date: Mar 2010
Location: Germany
Posts: 1,006
Reputation: 323
Default Re: Dialogs include - Adding new styles to SAMP GUI

Your MEM_copy will fail, because it tries to copy memory from out of bounds.

Why don't you just use pawn-vector?
BigETI is offline   Reply With Quote
Old 10/08/2018, 01:07 AM   #502
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,807
Reputation: 831
Default Re: Dialogs include - Adding new styles to SAMP GUI

Quote:
Originally Posted by BigETI View Post
Your MEM_copy will fail, because it tries to copy memory from out of bounds.
I don't know what you are talking about, i tested it before release and everything was working fine.

Quote:
Originally Posted by BigETI View Post
Why don't you just use pawn-vector?
I don't have time to read the documentation and change everything up in include. Also your include does the same thing i do(resize, etc), doesn't it?
__________________

My GitHub:

Gammix is offline   Reply With Quote
Old 10/08/2018, 02:12 PM   #503
BigETI
High-roller
 
BigETI's Avatar
 
Join Date: Mar 2010
Location: Germany
Posts: 1,006
Reputation: 323
Default Re: Dialogs include - Adding new styles to SAMP GUI

Let's look at this piece of code
Code:
if (count == MEM_get_size(Prev@PlayerListitemPointer[playerid])) {
	new Pointer:tmpPointer = MEM_new(count + DEFAULT_DIALOG_INCREMENT_SIZE);
	MEM_copy(tmpPointer, Prev@PlayerListitemPointer[playerid], MEM_get_size(tmpPointer));
	MEM_delete(Prev@PlayerListitemPointer[playerid]);
	Prev@PlayerListitemPointer[playerid] = tmpPointer;
}
Whenever MEM_get_size(Prev@PlayerListitemPointer[playerid]) equals count, it will allocate memory of size count + DEFAULT_DIALOG_INCREMENT_SIZE. Now MEM_copy will try to copy MEM_get_size(tmpPointer) cells from Prev@PlayerListitemPointer[playerid] to tmpPointer. Remember that MEM_get_size(Prev@PlayerListitemPointer[playerid]) returns the same value as count, so trying to copy MEM_get_size(tmpPointer) cells, which is count + DEFAULT_DIALOG_INCREMENT_SIZE is bigger than count. The plugin will not copy memory, because you specified an invalid cell count for Prev@PlayerListitemPointer[playerid].

About pawn-vector it's easy as doing something like this

Insertion:
Code:
MEM_struct MyStructure
{
	//...
}
//...
new Vector:my_vector;
//...
new some_array[MyStructure];
// Set some data at "some_array"...
VECTOR_push_back_arr(my_vector, some_array);
Reading:
Code:
new some_array[MyStructure];
VECTOR_get_arr(my_vector, some_index, some_array);
// "some_array" now contains the data from vector index "some_index"

Last edited by BigETI; 10/08/2018 at 05:11 PM.
BigETI is offline   Reply With Quote
Old 11/08/2018, 10:38 PM   #504
iAplle
Little Clucker
 
iAplle's Avatar
 
Join Date: Jul 2018
Posts: 14
Reputation: 0
Default Re: Dialogs include - Adding new styles to SAMP GUI

Any solution?

__________________
Vencedor não é aquele que sempre vence, mas sim aquele que
nunca para de lutar.
iAplle is offline   Reply With Quote
Old 11/08/2018, 11:50 PM   #505
Romz
High-roller
 
Romz's Avatar
 
Join Date: Jun 2013
Location: Ukraine
Posts: 1,046
Reputation: 59
Default Re: Dialogs include - Adding new styles to SAMP GUI

Quote:
Originally Posted by iAplle View Post
Any solution?



use the plugin to find out more information.
__________________
Romz is online now   Reply With Quote
Old 12/08/2018, 12:21 AM   #506
BigETI
High-roller
 
BigETI's Avatar
 
Join Date: Mar 2010
Location: Germany
Posts: 1,006
Reputation: 323
Default Re: Dialogs include - Adding new styles to SAMP GUI

you are using an old and deprecated build of the memory access plugin, which is not compatible with this library and the pawn-memory include
BigETI is offline   Reply With Quote
Old 12/08/2018, 12:48 AM   #507
iAplle
Little Clucker
 
iAplle's Avatar
 
Join Date: Jul 2018
Posts: 14
Reputation: 0
Default Re: Dialogs include - Adding new styles to SAMP GUI

Quote:
Originally Posted by Romz View Post
use the plugin to find out more information.
Here it is, how can I solve it?

__________________
Vencedor não é aquele que sempre vence, mas sim aquele que
nunca para de lutar.
iAplle is offline   Reply With Quote
Old 12/08/2018, 01:07 AM   #508
BigETI
High-roller
 
BigETI's Avatar
 
Join Date: Mar 2010
Location: Germany
Posts: 1,006
Reputation: 323
Default Re: Dialogs include - Adding new styles to SAMP GUI

One of the required plugins can be found here: https://github.com/BigETI/pawn-memory/releases
BigETI is offline   Reply With Quote
Old 12/08/2018, 01:20 AM   #509
iAplle
Little Clucker
 
iAplle's Avatar
 
Join Date: Jul 2018
Posts: 14
Reputation: 0
Default Re: Dialogs include - Adding new styles to SAMP GUI

Quote:
Originally Posted by BigETI View Post
One of the required plugins can be found here: https://github.com/BigETI/pawn-memory/releases
Thanks!!
__________________
Vencedor não é aquele que sempre vence, mas sim aquele que
nunca para de lutar.
iAplle is offline   Reply With Quote
Old 21/08/2018, 02:24 AM   #510
SapMan
Big Clucker
 
Join Date: Jul 2017
Posts: 112
Reputation: 12
Default Re: Dialogs include - Adding new styles to SAMP GUI

Brother, how do I do if I want to add objects for the users? Is that the objects I want to add have a varied identification, for example: objectsid: 1832, 1836, 1850, etc.
SapMan 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
[FilterScript] Items spawner dialogs (zcmd & dialogs include) Q_Lite Filterscripts 17 16/10/2016 11:09 AM
[FilterScript] [FS]Fighting Styles,5 most usable styles Like in SP By Don_(GH) HAYTXA Filterscripts 10 28/03/2013 06:39 AM
Making an OnFilterScriptInit in an include without adding anything in the .pwn exepct the #include r3k1lLz_ Help Archive 6 06/01/2011 06:49 AM
[FilterScript] [FS]Trans World Airlines v0.2 [TWA] - Bug Fixed - Adding Dialogs Soon. Toni Filterscripts 16 13/06/2010 02:57 PM
[FilterScript] [FS] Fighting Styles (0.3a) - |Save styles in Dini| MoBiL[e] Filterscripts 23 24/04/2010 11:12 AM


All times are GMT. The time now is 05:06 AM.


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